Merge lp:~penk/ubuntu-clock-app/use_replace_to_trim_am_pm_text into lp:ubuntu-clock-app

Proposed by Penk Chen
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 267
Merged at revision: 267
Proposed branch: lp:~penk/ubuntu-clock-app/use_replace_to_trim_am_pm_text
Merge into: lp:ubuntu-clock-app
Diff against target: 17 lines (+2/-2)
1 file modified
app/components/DigitalMode.qml (+2/-2)
To merge this branch: bzr merge lp:~penk/ubuntu-clock-app/use_replace_to_trim_am_pm_text
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan Approve
Review via email: mp+260121@code.launchpad.net

Commit message

Use replace() to trim amText/pmText in DigitalMode

Description of the change

Using replace() instead of split() to trim amText/pmText, this prevents time string being cut empty in some locale (e.g. in Chinese).

English locale:

    10:01 AM // time
    10:01 // time.split(Qt.locale().amText)[0].trim()
    10:01 // time.replace(Qt.locale().amText, "").trim()

Chinese locale:

    上午 10:01 // time
    // time.split(Qt.locale().amText)[0].trim()
    10:01 // time.replace(Qt.locale().amText, "").trim()

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:267
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~penk/ubuntu-clock-app/use_replace_to_trim_am_pm_text/+merge/260121/+edit-commit-message

http://91.189.93.70:8080/job/ubuntu-clock-app-ci/648/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/generic-mediumtests-utopic/2813
        deb: http://91.189.93.70:8080/job/generic-mediumtests-utopic/2813/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/ubuntu-clock-app-ci/648/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Thanks for the MP. Works nicely! I tested it in Chinese Locale and French with no visible regressions on N4 Vivid. Approving!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/components/DigitalMode.qml'
2--- app/components/DigitalMode.qml 2014-10-10 19:58:49 +0000
3+++ app/components/DigitalMode.qml 2015-05-26 10:15:47 +0000
4@@ -58,11 +58,11 @@
5 text: {
6 if (time.search(Qt.locale().amText) !== -1) {
7 // 12 hour format detected with the localised AM text
8- return time.split(Qt.locale().amText)[0].trim()
9+ return time.replace(Qt.locale().amText, "").trim()
10 }
11 else if (time.search(Qt.locale().pmText) !== -1) {
12 // 12 hour format detected with the localised PM text
13- return time.split(Qt.locale().pmText)[0].trim()
14+ return time.replace(Qt.locale().pmText, "").trim()
15 }
16 else {
17 // 24-hour format detected, return full time string

Subscribers

People subscribed via source and target branches