[i18n] i18n.language should return LANG, not LANGUAGE
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
Medium
|
Cris Dywan | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Currently, invoking i18n.language returns the value of the LANGUAGE environment variable.
LANGUAGE is a gettext locale extension and it is not supported by all toolkits. Its format is a prioritized list of languages separated by semicolon (e.g. ca:de:it) [1], which is not understood when passed to Qt locale functions.
Furthermore, it is not always defined, so in most cases, the result of invoking i18n.language will be an empty string.
It might be better to return the value of the LANG variable [2], defined in /etc/default/
[1]: http://
[2]: http://
Related branches
- 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 |
description: | updated |
Changed in ubuntu-ui-toolkit: | |
assignee: | nobody → Tim Peeters (tpeeters) |
status: | New → Confirmed |
Changed in ubuntu-ui-toolkit: | |
importance: | Undecided → Medium |
tags: | added: i18n |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
The attached branch in fact changes the code to use setlocale to user gettext's native behavior; the same GTK+ apps use on the desktop today.