[i18n] Cannot use the i18n plugin in C++
Bug #1182577 reported by
David Planella
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
Wishlist
|
Cris Dywan |
Bug Description
For SDK apps developed in QML and C++ it would make sense to be able to use the i18n plugin consistently. I.e.:
1) To translate a string in QML: i18n.tr("Translate me!")
2) To translate a string in C++: UbuntuI18n:
Of these, 2) is currently not possible, although there is a workaround to use plain gettext in C++: C::gettext(
A use case is the phone-app, written in C++ and QML. Here's a merge proposal for internationaliz
https:/
Related branches
lp:~kalikiana/ubuntu-ui-toolkit/xdglocale
- PS Jenkins bot: Approve (continuous-integration)
- Tim Peeters: Approve
-
Diff: 444 lines (+270/-75)8 files modifieddebian/control (+2/-0)
modules/Ubuntu/Components/plugin/i18n.cpp (+29/-6)
tests/unit/tst_components/tst_plugin_i18n.qml (+0/-69)
tests/unit/tst_i18n/po/en_US.po (+17/-0)
tests/unit/tst_i18n/src/LocalizedApp.qml (+35/-0)
tests/unit/tst_i18n/src/tst_i18n.cpp (+175/-0)
tests/unit/tst_i18n/tst_i18n.pro (+11/-0)
tests/unit/unit.pro (+1/-0)
description: | updated |
summary: |
- Cannot use the i18n plugin in C++ + [i18n] Cannot use the i18n plugin in C++ |
tags: | added: touch-cn |
Changed in ubuntu-ui-toolkit: | |
assignee: | nobody → Christian Dywan (kalikiana) |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The browser use case is invalid since the window title should be set from QML: qt-project. org/doc/ qt-5.0/ qtquick/ qml-qtquick- window2- window. html
http://
Generally speaking I would not like to expose a C++ API if we can avoid it. So far we were able too :)