Merge lp:~thomas-voss/trust-store/qml-fix-1354092 into lp:trust-store

Proposed by Thomas Voß
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 74
Merged at revision: 73
Proposed branch: lp:~thomas-voss/trust-store/qml-fix-1354092
Merge into: lp:trust-store
Diff against target: 42 lines (+10/-0)
3 files modified
src/CMakeLists.txt (+4/-0)
src/core/trust/i18n.cpp (+3/-0)
src/core/trust/mir/prompt_main.cpp (+3/-0)
To merge this branch: bzr merge lp:~thomas-voss/trust-store/qml-fix-1354092
Reviewer Review Type Date Requested Status
David Planella (community) Approve
Sebastien Bacher Approve
PS Jenkins bot continuous-integration Approve
Michał Sawicz code Approve
Review via email: mp+240816@code.launchpad.net

Commit message

Select correct gettext domain for the trust prompt.

Description of the change

Select correct gettext domain for the trust prompt.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

See inline comment. However, I still don't manage to get the prompt using OSMTouch on mako.

review: Needs Fixing
Revision history for this message
Sebastien Bacher (seb128) wrote :

That doesn't seem to work, the dialog fails to load with this change

review: Needs Fixing
73. By Thomas Voß

Adjust gettext domain in main.cpp.

Revision history for this message
David Planella (dpm) wrote :

After talking to the SDK guys, what they suggested was:

        Button {
            objectName: "deny"
- text: i18n.tr("Deny")
+ text: i18n.dtr("trust-store", "Deny")
            color: UbuntuColors.red
            onClicked: quit(1)
        }

        Button {
            objectName: "allow"
- text: i18n.tr("Allow")
+ text: i18n.dtr("trust-store", "Allow")
            color: UbuntuColors.green
            onClicked: quit(0)

This seems to work for me after testing it on the phone.

Revision history for this message
Michał Sawicz (saviq) wrote :

Yup, that's the approach we employ. Only way to make sure the domain is set early enough.

review: Approve (code)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
74. By Thomas Voß

Enfore initialization on query for default text domain.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Looks good, and confirmed to be working on silo 5, thanks

review: Approve
Revision history for this message
David Planella (dpm) wrote :

Same here, also successful test from silo 5.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2014-10-15 14:16:09 +0000
3+++ src/CMakeLists.txt 2014-11-07 08:17:57 +0000
4@@ -90,6 +90,10 @@
5 add_executable(
6 trust-prompt
7
8+ # Translation helper
9+ core/trust/i18n.h
10+ core/trust/i18n.cpp
11+
12 core/trust/mir/prompt_main.cpp
13 )
14
15
16=== modified file 'src/core/trust/i18n.cpp'
17--- src/core/trust/i18n.cpp 2014-10-14 07:22:40 +0000
18+++ src/core/trust/i18n.cpp 2014-11-07 08:17:57 +0000
19@@ -57,6 +57,9 @@
20
21 std::string core::trust::i18n::default_text_domain()
22 {
23+ if (not is_initialized())
24+ return std::string{};
25+
26 return this_text_domain;
27 }
28
29
30=== modified file 'src/core/trust/mir/prompt_main.cpp'
31--- src/core/trust/mir/prompt_main.cpp 2014-09-19 14:30:12 +0000
32+++ src/core/trust/mir/prompt_main.cpp 2014-11-07 08:17:57 +0000
33@@ -142,6 +142,9 @@
34 vm[core::trust::mir::cli::option_server_socket].as<std::string>());
35 }
36
37+ // We install our default gettext domain prior to anything qt.
38+ core::trust::i18n::default_text_domain();
39+
40 // We install a custom message handler to silence Qt's chattiness
41 qInstallMessageHandler([](QtMsgType type, const QMessageLogContext&, const QString& msg)
42 {

Subscribers

People subscribed via source and target branches