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
=== modified file 'plugins/Unity/Launcher/backend/launcherbackend.cpp'
--- plugins/Unity/Launcher/backend/launcherbackend.cpp 2014-06-11 15:36:51 +0000
+++ plugins/Unity/Launcher/backend/launcherbackend.cpp 2014-09-01 15:24:21 +0000
@@ -28,6 +28,8 @@
28#include <QDebug>28#include <QDebug>
29#include <QStandardPaths>29#include <QStandardPaths>
3030
31#include <libintl.h>
32
31class LauncherBackendItem33class LauncherBackendItem
32{34{
33public:35public:
@@ -350,7 +352,12 @@
350 QSettings settings(desktopFile, QSettings::IniFormat);352 QSettings settings(desktopFile, QSettings::IniFormat);
351353
352 LauncherBackendItem* item = new LauncherBackendItem();354 LauncherBackendItem* item = new LauncherBackendItem();
355
353 item->displayName = settings.value("Desktop Entry/Name").toString();356 item->displayName = settings.value("Desktop Entry/Name").toString();
357 const QString domain = settings.value("Desktop Entry/X-Ubuntu-Gettext-Domain").toString();
358 if (!domain.isEmpty()) {
359 item->displayName = dgettext(domain.toUtf8().constData(), item->displayName.toUtf8().constData());
360 }
354361
355 QString iconString = settings.value("Desktop Entry/Icon").toString();362 QString iconString = settings.value("Desktop Entry/Icon").toString();
356 QString pathString = settings.value("Desktop Entry/Path").toString();363 QString pathString = settings.value("Desktop Entry/Path").toString();
357364
=== modified file 'qml/Dash/DashApplication.qml'
--- qml/Dash/DashApplication.qml 2014-08-07 15:29:12 +0000
+++ qml/Dash/DashApplication.qml 2014-09-01 15:24:21 +0000
@@ -24,12 +24,6 @@
2424
25 useDeprecatedToolbar: false25 useDeprecatedToolbar: false
2626
27 Binding {
28 target: i18n
29 property: "domain"
30 value: "unity8"
31 }
32
33 Dash {27 Dash {
34 anchors.fill: parent28 anchors.fill: parent
35 }29 }
3630
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2014-08-28 20:06:18 +0000
+++ qml/Shell.qml 2014-09-01 15:24:21 +0000
@@ -592,12 +592,6 @@
592 }592 }
593 }593 }
594594
595 Binding {
596 target: i18n
597 property: "domain"
598 value: "unity8"
599 }
600
601 Dialogs {595 Dialogs {
602 id: dialogs596 id: dialogs
603 anchors.fill: parent597 anchors.fill: parent
604598
=== modified file 'src/Dash/main.cpp'
--- src/Dash/main.cpp 2014-08-12 13:49:11 +0000
+++ src/Dash/main.cpp 2014-09-01 15:24:21 +0000
@@ -68,6 +68,7 @@
68 }68 }
6969
70 bindtextdomain("unity8", translationDirectory().toUtf8().data());70 bindtextdomain("unity8", translationDirectory().toUtf8().data());
71 textdomain("unity8");
7172
72 QQuickView* view = new QQuickView();73 QQuickView* view = new QQuickView();
73 view->setResizeMode(QQuickView::SizeRootObjectToView);74 view->setResizeMode(QQuickView::SizeRootObjectToView);
7475
=== modified file 'src/main.cpp'
--- src/main.cpp 2014-07-31 10:52:30 +0000
+++ src/main.cpp 2014-09-01 15:24:21 +0000
@@ -108,6 +108,7 @@
108 }108 }
109109
110 bindtextdomain("unity8", translationDirectory().toUtf8().data());110 bindtextdomain("unity8", translationDirectory().toUtf8().data());
111 textdomain("unity8");
111112
112 QQuickView* view = new QQuickView();113 QQuickView* view = new QQuickView();
113 view->setResizeMode(QQuickView::SizeRootObjectToView);114 view->setResizeMode(QQuickView::SizeRootObjectToView);

Subscribers

People subscribed via source and target branches