Merge lp:~phillip-sz/switchboard-plug-about/more-translatable into lp:~elementary-apps/switchboard-plug-about/trunk

Proposed by Phillip Sz
Status: Merged
Approved by: David Gomes
Approved revision: 181
Merged at revision: 184
Proposed branch: lp:~phillip-sz/switchboard-plug-about/more-translatable
Merge into: lp:~elementary-apps/switchboard-plug-about/trunk
Diff against target: 81 lines (+18/-9)
2 files modified
cmake/Translations.cmake (+2/-2)
src/Plug.vala (+16/-7)
To merge this branch: bzr merge lp:~phillip-sz/switchboard-plug-about/more-translatable
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+223943@code.launchpad.net

Commit message

Improves translation-related code on the plug.

Description of the change

In german we use »« instead of "". This makes it possible.

To post a comment you must log in.
178. By Phillip Sz

update to Freya

Revision history for this message
Akshay Shekher (voldyman) wrote :

The idea is good but if by mistake a "%s" is removed, the app might crash.

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

It'd make sense to add an explicit comment to the translations then and if necessary have it marked for "needs review" in launchpad. I do think this would be the best way to go though.

Revision history for this message
Phillip Sz (phillip-sz) wrote :

Yes, I tried to add a comment, not successful so far though.

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

You have to add -c to the parameters of xgettext, like so: http://pastebin.com/qsmqhmfD
I haven't added comments for all the relevant strings yet.

179. By Phillip Sz

added comments for translators

Revision history for this message
Phillip Sz (phillip-sz) wrote :

Thanks Tom!

Revision history for this message
David Gomes (davidgomes) wrote :

Code style fixes necessary.

review: Needs Fixing
180. By Phillip Sz

fixed Code style

Revision history for this message
Cody Garver (codygarver) wrote :

Revert the translation template bump, that should be done after merge so that this commit diff looks cleaner

bzr revert -r 176 po/about-plug.pot

181. By Phillip Sz

Reverted the translation template

Revision history for this message
David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake/Translations.cmake'
2--- cmake/Translations.cmake 2012-09-22 19:00:59 +0000
3+++ cmake/Translations.cmake 2014-06-27 19:39:45 +0000
4@@ -35,7 +35,7 @@
5 endforeach()
6
7 add_custom_command (TARGET pot COMMAND
8- ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
9+ ${XGETTEXT_EXECUTABLE} -c -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
10 ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8
11 )
12-endmacro()
13+endmacro()
14\ No newline at end of file
15
16=== modified file 'src/Plug.vala'
17--- src/Plug.vala 2014-05-29 14:50:03 +0000
18+++ src/Plug.vala 2014-06-27 19:39:45 +0000
19@@ -113,10 +113,10 @@
20 }
21 }
22 } catch (Error e) {
23- warning("Couldn't read lsb-release file, assuming elementary OS 0.2");
24+ warning("Couldn't read lsb-release file, assuming elementary OS 0.3");
25 os = "elementary OS";
26- version = "0.2";
27- codename = "Luna";
28+ version = "0.3";
29+ codename = "Freya";
30 }
31
32 file = File.new_for_path("/etc/upstream-release/lsb-release");
33@@ -272,12 +272,18 @@
34 Granite.Widgets.Utils.apply_text_style_to_label (Granite.TextStyle.TITLE, title);
35 title.set_alignment (0, 0);
36
37- var version = new Gtk.Label (_("Version") + ": " + version + " \"" + codename + "\" ( " + arch + " )");
38+ // make sure to keep all three %s in the string, otherwise switchboard will crash!
39+ // the first %s will be replaced by the version, the second by the codename (e.g "Freya") and the third by the CPU architecture (e.g. "64-bit")
40+ // keep both \" if you want to use " as quote
41+ var version = new Gtk.Label (_("Version: %s \"%s\" ( %s )").printf (version, codename, arch));
42 version.set_alignment (0, 0);
43 version.set_selectable (true);
44
45 if (is_ubuntu != null) {
46- based_off = new Gtk.Label (_("Built on") + ": " + is_ubuntu + " " + ubuntu_version + " ( \"" + ubuntu_codename + "\" )");
47+ // make sure to keep all three %s in the string, otherwise switchboard will crash!
48+ // the first %s will be replaced by the OS (e.g. "Ubuntu"), the second by the version and the third by the codename (e.g. "Trusty")
49+ // keep both \" if you want to use " as quote
50+ based_off = new Gtk.Label (_("Built on: %s %s ( \"%s\" )").printf (is_ubuntu, ubuntu_version, ubuntu_codename));
51 based_off.set_alignment (0, 0);
52 based_off.set_selectable (true);
53 }
54@@ -301,16 +307,19 @@
55 hardware_title.set_markup (("<b><span size=\"x-large\">%s</span></b>").printf(_("Hardware:")));
56 hardware_title.set_alignment (0, 0);
57
58- // Hardware labels
59+ // Hardware label
60 var processor_label = new Gtk.Label (_("Processor:"));
61 processor_label.set_alignment (1, 0);
62
63+ // Hardware label
64 var memory_label = new Gtk.Label (_("Memory:"));
65 memory_label.set_alignment (1, 0);
66
67+ // Hardware label
68 var graphics_label = new Gtk.Label (_("Graphics:"));
69 graphics_label.set_alignment (1, 0);
70
71+ // Hardware label
72 var hdd_label = new Gtk.Label (_("Storage:"));
73 hdd_label.set_alignment (1, 0);
74
75@@ -452,4 +461,4 @@
76 debug ("Activating About plug");
77 var plug = new About.Plug ();
78 return plug;
79-}
80+}
81\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: