Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/i18nctag into lp:ubuntu-ui-toolkit/staging
| Status: | Merged |
|---|---|
| Approved by: | Tim Peeters on 2015-02-05 |
| Approved revision: | 1398 |
| Merged at revision: | 1398 |
| Proposed branch: | lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/i18nctag |
| Merge into: | lp:ubuntu-ui-toolkit/staging |
| Diff against target: |
221 lines (+95/-5) 9 files modified
.bzrignore (+1/-0) components.api (+7/-0) modules/Ubuntu/Components/plugin/i18n.cpp (+40/-1) modules/Ubuntu/Components/plugin/i18n.h (+3/-1) po/update-pot.sh (+2/-1) tests/unit/tst_i18n/po/en_US.po (+7/-0) tests/unit/tst_i18n/src/LocalizedApp.qml (+15/-1) tests/unit/tst_i18n/src/tst_i18n.cpp (+13/-0) tests/unit/tst_i18n/tst_i18n.pro (+7/-1) |
| To merge this branch: | bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/i18nctag |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Tim Peeters | 2015-02-02 | Approve on 2015-02-05 | |
| PS Jenkins bot | continuous-integration | Approve on 2015-02-04 | |
|
Review via email:
|
|||
Commit Message
Implement and unit-test i18n.(c)tag
| Pete Woods (pete-woods) wrote : | # |
| Christian Dywan (kalikiana) wrote : | # |
No sweat, nothing is carved in stone yet, I went for this as I only saw the new suggestion after I wrote the unit tests for it :-)
| Tim Peeters (tpeeters) wrote : | # |
I will try to figure out the use case for this. It is not immediately clear to me. Perhaps this can be fixed by adding to the documentation of the methods?
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1395
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1396. By Christian Dywan on 2015-02-03
-
Add QML example of UserMetrics to i18n.tag documentation
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1396
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Tim Peeters (tpeeters) wrote : | # |
please use function overloading of tag() for the context instead of tag() and ctag(), as we have in the API proposal for tr() in https:/
We currently do have a ctr() implementation, but that should be deprecated as per https:/
- 1397. By Christian Dywan on 2015-02-03
-
There's no need for a ctag, tag can be overloaded'
| Tim Peeters (tpeeters) wrote : | # |
Below I copy&pasted parts of the IRC discussion that cleared up some issues for me:
<timp> in https:/
<ahayzen> timp, RTL and LTR languages
<kalikiana> timp: never ever do string manipulation in context of localization, this is unrelated to tag, tr or plurals
<dpm> timp, as per the question: i18n.tr("Songs played today: ") + "<b>%1</b>" would for example break for RTL languages
-- and --
<timp> why would i18n.dtr("metric", "Songs played today: %1") instead of i18n.tag("Songs played today: %1") not work?
<kalikiana> timp: because the string is displayed in the lockscreen and the language can be changed when the app isn't running
<timp> kalikiana: ah, so the string does not even exist in the list of translateable strings for the metrics?
<kalikiana> timp: the string is in the app's .mo files, and the domain is set in the metrics API
<timp> kalikiana: so the metrics somewhere call i18n.dtr(
<kalikiana> timp: yes
| Tim Peeters (tpeeters) wrote : | # |
How do we ensure the tagged strings are added to the pot files? Is this automatic on launchpad? We did not add it to po/update-pot.sh (but ctr() functions which we have now are not in there either).
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1397
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1398. By Christian Dywan on 2015-02-04
-
Add tag keyword to update-pot.sh
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1398
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://

Sorry to mess you around, but I think David wanted the function called noop as opposed to tag.
I don't have strong views either way, but it's probably worth checking which one to go for..