Merge lp://staging/~ubuntu-sdk-team/ubuntu-ui-toolkit/i18nctag into lp://staging/ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Merged
Approved by: Tim Peeters
Approved revision: 1398
Merged at revision: 1398
Proposed branch: lp://staging/~ubuntu-sdk-team/ubuntu-ui-toolkit/i18nctag
Merge into: lp://staging/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://staging/~ubuntu-sdk-team/ubuntu-ui-toolkit/i18nctag
Reviewer Review Type Date Requested Status
Tim Peeters Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+248260@code.staging.launchpad.net

Commit message

Implement and unit-test i18n.(c)tag

To post a comment you must log in.
Revision history for this message
Pete Woods (pete-woods) wrote :

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..

Revision history for this message
Cris 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 :-)

Revision history for this message
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?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1396. By Cris Dywan

Add QML example of UserMetrics to i18n.tag documentation

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
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://docs.google.com/a/canonical.com/document/d/1qDcfbu9aAj7uU9qzjXCOJn8zGexBnXwZCgO8pLDsO5M/edit#

We currently do have a ctr() implementation, but that should be deprecated as per https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1417680

1397. By Cris Dywan

There's no need for a ctag, tag can be overloaded'

Revision history for this message
Tim Peeters (tpeeters) wrote :

Below I copy&pasted parts of the IRC discussion that cleared up some issues for me:

<timp> in https://code.launchpad.net/~unity-team/music-app/infographics-translations/+merge/248251 why not use the string i18n.tr("Songs played today: ") + "<b>%1</b>"

<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("music-app", "Songs played today: %1")?
<kalikiana> timp: yes

review: Approve
Revision history for this message
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).

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1398. By Cris Dywan

Add tag keyword to update-pot.sh

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

Thanks, happroving.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches