Merge lp:~aacid/unity8/gettext_textdomain into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1230
Merged at revision: 1247
Proposed branch: lp:~aacid/unity8/gettext_textdomain
Merge into: lp:unity8
Diff against target: 83 lines (+9/-12)
5 files modified
plugins/Unity/Launcher/backend/launcherbackend.cpp (+7/-0)
qml/Dash/DashApplication.qml (+0/-6)
qml/Shell.qml (+0/-6)
src/Dash/main.cpp (+1/-0)
src/main.cpp (+1/-0)
To merge this branch: bzr merge lp:~aacid/unity8/gettext_textdomain
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michael Zanetti (community) Approve
Review via email: mp+232899@code.launchpad.net

Commit message

Fix launcher internationalization

Call textdomain and use X-Ubuntu-Gettext-Domain

bindtextdomain doesn't set the text domain, only the folder the domain has to be looked for.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes, launcher is now in spanish

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
lp:~aacid/unity8/gettext_textdomain updated
1229. By Albert Astals Cid

We're setting this from cpp now

1230. By Albert Astals Cid

Use the non-standard X-Ubuntu-Gettext-Domain if present

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

I've added support for in .desktop file translations in the backend rework branch

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes

 * Did CI run pass? If not, please explain why.

no. jensins seems unreachable atm

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Unity/Launcher/backend/launcherbackend.cpp'
2--- plugins/Unity/Launcher/backend/launcherbackend.cpp 2014-06-11 15:36:51 +0000
3+++ plugins/Unity/Launcher/backend/launcherbackend.cpp 2014-09-01 15:24:21 +0000
4@@ -28,6 +28,8 @@
5 #include <QDebug>
6 #include <QStandardPaths>
7
8+#include <libintl.h>
9+
10 class LauncherBackendItem
11 {
12 public:
13@@ -350,7 +352,12 @@
14 QSettings settings(desktopFile, QSettings::IniFormat);
15
16 LauncherBackendItem* item = new LauncherBackendItem();
17+
18 item->displayName = settings.value("Desktop Entry/Name").toString();
19+ const QString domain = settings.value("Desktop Entry/X-Ubuntu-Gettext-Domain").toString();
20+ if (!domain.isEmpty()) {
21+ item->displayName = dgettext(domain.toUtf8().constData(), item->displayName.toUtf8().constData());
22+ }
23
24 QString iconString = settings.value("Desktop Entry/Icon").toString();
25 QString pathString = settings.value("Desktop Entry/Path").toString();
26
27=== modified file 'qml/Dash/DashApplication.qml'
28--- qml/Dash/DashApplication.qml 2014-08-07 15:29:12 +0000
29+++ qml/Dash/DashApplication.qml 2014-09-01 15:24:21 +0000
30@@ -24,12 +24,6 @@
31
32 useDeprecatedToolbar: false
33
34- Binding {
35- target: i18n
36- property: "domain"
37- value: "unity8"
38- }
39-
40 Dash {
41 anchors.fill: parent
42 }
43
44=== modified file 'qml/Shell.qml'
45--- qml/Shell.qml 2014-08-28 20:06:18 +0000
46+++ qml/Shell.qml 2014-09-01 15:24:21 +0000
47@@ -592,12 +592,6 @@
48 }
49 }
50
51- Binding {
52- target: i18n
53- property: "domain"
54- value: "unity8"
55- }
56-
57 Dialogs {
58 id: dialogs
59 anchors.fill: parent
60
61=== modified file 'src/Dash/main.cpp'
62--- src/Dash/main.cpp 2014-08-12 13:49:11 +0000
63+++ src/Dash/main.cpp 2014-09-01 15:24:21 +0000
64@@ -68,6 +68,7 @@
65 }
66
67 bindtextdomain("unity8", translationDirectory().toUtf8().data());
68+ textdomain("unity8");
69
70 QQuickView* view = new QQuickView();
71 view->setResizeMode(QQuickView::SizeRootObjectToView);
72
73=== modified file 'src/main.cpp'
74--- src/main.cpp 2014-07-31 10:52:30 +0000
75+++ src/main.cpp 2014-09-01 15:24:21 +0000
76@@ -108,6 +108,7 @@
77 }
78
79 bindtextdomain("unity8", translationDirectory().toUtf8().data());
80+ textdomain("unity8");
81
82 QQuickView* view = new QQuickView();
83 view->setResizeMode(QQuickView::SizeRootObjectToView);

Subscribers

People subscribed via source and target branches