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
=== modified file 'cmake/Translations.cmake'
--- cmake/Translations.cmake 2012-09-22 19:00:59 +0000
+++ cmake/Translations.cmake 2014-06-27 19:39:45 +0000
@@ -35,7 +35,7 @@
35 endforeach()35 endforeach()
3636
37 add_custom_command (TARGET pot COMMAND37 add_custom_command (TARGET pot COMMAND
38 ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot38 ${XGETTEXT_EXECUTABLE} -c -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
39 ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-839 ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8
40 )40 )
41endmacro()41endmacro()
42\ No newline at end of file42\ No newline at end of file
4343
=== modified file 'src/Plug.vala'
--- src/Plug.vala 2014-05-29 14:50:03 +0000
+++ src/Plug.vala 2014-06-27 19:39:45 +0000
@@ -113,10 +113,10 @@
113 }113 }
114 }114 }
115 } catch (Error e) {115 } catch (Error e) {
116 warning("Couldn't read lsb-release file, assuming elementary OS 0.2");116 warning("Couldn't read lsb-release file, assuming elementary OS 0.3");
117 os = "elementary OS";117 os = "elementary OS";
118 version = "0.2";118 version = "0.3";
119 codename = "Luna";119 codename = "Freya";
120 }120 }
121 121
122 file = File.new_for_path("/etc/upstream-release/lsb-release");122 file = File.new_for_path("/etc/upstream-release/lsb-release");
@@ -272,12 +272,18 @@
272 Granite.Widgets.Utils.apply_text_style_to_label (Granite.TextStyle.TITLE, title);272 Granite.Widgets.Utils.apply_text_style_to_label (Granite.TextStyle.TITLE, title);
273 title.set_alignment (0, 0);273 title.set_alignment (0, 0);
274274
275 var version = new Gtk.Label (_("Version") + ": " + version + " \"" + codename + "\" ( " + arch + " )");275 // make sure to keep all three %s in the string, otherwise switchboard will crash!
276 // 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")
277 // keep both \" if you want to use " as quote
278 var version = new Gtk.Label (_("Version: %s \"%s\" ( %s )").printf (version, codename, arch));
276 version.set_alignment (0, 0);279 version.set_alignment (0, 0);
277 version.set_selectable (true);280 version.set_selectable (true);
278 281
279 if (is_ubuntu != null) {282 if (is_ubuntu != null) {
280 based_off = new Gtk.Label (_("Built on") + ": " + is_ubuntu + " " + ubuntu_version + " ( \"" + ubuntu_codename + "\" )");283 // make sure to keep all three %s in the string, otherwise switchboard will crash!
284 // 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")
285 // keep both \" if you want to use " as quote
286 based_off = new Gtk.Label (_("Built on: %s %s ( \"%s\" )").printf (is_ubuntu, ubuntu_version, ubuntu_codename));
281 based_off.set_alignment (0, 0);287 based_off.set_alignment (0, 0);
282 based_off.set_selectable (true);288 based_off.set_selectable (true);
283 }289 }
@@ -301,16 +307,19 @@
301 hardware_title.set_markup (("<b><span size=\"x-large\">%s</span></b>").printf(_("Hardware:")));307 hardware_title.set_markup (("<b><span size=\"x-large\">%s</span></b>").printf(_("Hardware:")));
302 hardware_title.set_alignment (0, 0);308 hardware_title.set_alignment (0, 0);
303309
304 // Hardware labels310 // Hardware label
305 var processor_label = new Gtk.Label (_("Processor:"));311 var processor_label = new Gtk.Label (_("Processor:"));
306 processor_label.set_alignment (1, 0);312 processor_label.set_alignment (1, 0);
307313
314 // Hardware label
308 var memory_label = new Gtk.Label (_("Memory:"));315 var memory_label = new Gtk.Label (_("Memory:"));
309 memory_label.set_alignment (1, 0);316 memory_label.set_alignment (1, 0);
310317
318 // Hardware label
311 var graphics_label = new Gtk.Label (_("Graphics:"));319 var graphics_label = new Gtk.Label (_("Graphics:"));
312 graphics_label.set_alignment (1, 0);320 graphics_label.set_alignment (1, 0);
313321
322 // Hardware label
314 var hdd_label = new Gtk.Label (_("Storage:"));323 var hdd_label = new Gtk.Label (_("Storage:"));
315 hdd_label.set_alignment (1, 0);324 hdd_label.set_alignment (1, 0);
316325
@@ -452,4 +461,4 @@
452 debug ("Activating About plug");461 debug ("Activating About plug");
453 var plug = new About.Plug ();462 var plug = new About.Plug ();
454 return plug;463 return plug;
455}464}
456\ No newline at end of file465\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: