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
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2014-10-15 14:16:09 +0000
+++ src/CMakeLists.txt 2014-11-07 08:17:57 +0000
@@ -90,6 +90,10 @@
90 add_executable(90 add_executable(
91 trust-prompt91 trust-prompt
9292
93 # Translation helper
94 core/trust/i18n.h
95 core/trust/i18n.cpp
96
93 core/trust/mir/prompt_main.cpp97 core/trust/mir/prompt_main.cpp
94 )98 )
9599
96100
=== modified file 'src/core/trust/i18n.cpp'
--- src/core/trust/i18n.cpp 2014-10-14 07:22:40 +0000
+++ src/core/trust/i18n.cpp 2014-11-07 08:17:57 +0000
@@ -57,6 +57,9 @@
5757
58std::string core::trust::i18n::default_text_domain()58std::string core::trust::i18n::default_text_domain()
59{59{
60 if (not is_initialized())
61 return std::string{};
62
60 return this_text_domain;63 return this_text_domain;
61}64}
6265
6366
=== modified file 'src/core/trust/mir/prompt_main.cpp'
--- src/core/trust/mir/prompt_main.cpp 2014-09-19 14:30:12 +0000
+++ src/core/trust/mir/prompt_main.cpp 2014-11-07 08:17:57 +0000
@@ -142,6 +142,9 @@
142 vm[core::trust::mir::cli::option_server_socket].as<std::string>());142 vm[core::trust::mir::cli::option_server_socket].as<std::string>());
143 }143 }
144144
145 // We install our default gettext domain prior to anything qt.
146 core::trust::i18n::default_text_domain();
147
145 // We install a custom message handler to silence Qt's chattiness148 // We install a custom message handler to silence Qt's chattiness
146 qInstallMessageHandler([](QtMsgType type, const QMessageLogContext&, const QString& msg)149 qInstallMessageHandler([](QtMsgType type, const QMessageLogContext&, const QString& msg)
147 {150 {

Subscribers

People subscribed via source and target branches