diff options
author | Wolfgang Müller | 2021-06-26 19:18:11 +0200 |
---|---|---|
committer | Wolfgang Müller | 2021-06-27 18:31:06 +0200 |
commit | 5fdfd3c6072ccb4af666603905c5965e4c6358f8 (patch) | |
tree | f55d984d28b83d264ff3bfa6d55f3ffe6c3562d4 | |
parent | 75ff67a99e3420ff49da7ec1b74f53a74451e874 (diff) | |
download | weltschmerz-5fdfd3c6072ccb4af666603905c5965e4c6358f8.tar.gz |
Mark messages for translation
With the translation infrastructure now in place, make sure to mark
every user-bound message for translation. All but one of the strings in
terminal.ui are already marked. This commit marks all remaining messages
in the Vala code as well as the missing one from terminal.ui.
One of the messages in terminal.ui is a sample error message for the
infobar label. Since this message will never be visible to the user (the
code overrides the label's contents with any relevant warning messages),
we do not need to keep it marked.
Finally, give translators ample context for what they will have to
translate and fix a small inconsistency with the capitalization of
warning messages in configreader.vala.
Diffstat (limited to '')
-rw-r--r-- | configreader.vala | 17 | ||||
-rw-r--r-- | terminal.ui | 4 | ||||
-rw-r--r-- | terminal.vala | 4 |
3 files changed, 16 insertions, 9 deletions
diff --git a/configreader.vala b/configreader.vala index 6348d5e..46f6b1f 100644 --- a/configreader.vala +++ b/configreader.vala @@ -106,8 +106,12 @@ class ConfigReader { } catch (KeyFileError e) {} if (keys.length > 0) { - string k = keys.length > 1 ? "keys" : "key"; - append_warning("Unknown %s in config: %s".printf(k, string.joinv(", ", keys))); + var keylist = string.joinv(", ", keys); + // TRANSLATORS: %s is the list of unknown keys joined with ', ' + var warning = ngettext("unknown key in config: %s", + "unknown keys in config: %s", keys.length).printf(keylist); + + append_warning(warning); } } @@ -161,7 +165,8 @@ class ConfigReader { var rgba = Gdk.RGBA(); if (!rgba.parse(str)) { - append_warning("invalid colour '%s' in %s.%s".printf(str, group, key)); + // TRANSLATORS: First %s is parsed colour, %s.%s is <group>.<key> from the config file + append_warning(_("invalid colour '%s' in %s.%s").printf(str, group, key)); rgba.parse(default); return rgba; @@ -181,7 +186,8 @@ class ConfigReader { case "underline": return UNDERLINE; default: - append_warning("invalid cursor shape '%s' in %s.%s".printf(cursor, group, key)); + // TRANSLATORS: First %s is parsed shape, %s.%s is <group>.<key> from the config file + append_warning(_("invalid cursor shape '%s' in %s.%s").printf(cursor, group, key)); return BLOCK; } } @@ -197,7 +203,8 @@ class ConfigReader { case "system": return SYSTEM; default: - append_warning("invalid cursor blink setting '%s' in %s.%s".printf(blink, group, key)); + // TRANSLATORS: First %s is parsed blink setting, %s.%s is <group>.<key> from the config file + append_warning(_("invalid cursor blink setting '%s' in %s.%s").printf(blink, group, key)); return SYSTEM; } } diff --git a/terminal.ui b/terminal.ui index 345c543..68a36b7 100644 --- a/terminal.ui +++ b/terminal.ui @@ -72,7 +72,7 @@ </child> <child> <object class="GtkImageMenuItem" id="copy_item_html"> - <property name="label">Copy as _HTML</property> + <property name="label" translatable="yes">Copy as _HTML</property> <property name="visible">True</property> <property name="can-focus">False</property> <property name="tooltip-text" translatable="yes">Copy the selection as HTML</property> @@ -276,7 +276,7 @@ <object class="GtkLabel" id="infobar_label"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes">Sample Error Message</property> + <property name="label">Sample Error Message</property> <property name="use-markup">True</property> <property name="wrap">True</property> </object> diff --git a/terminal.vala b/terminal.vala index dfe8130..fcd5ee0 100644 --- a/terminal.vala +++ b/terminal.vala @@ -138,10 +138,10 @@ class Terminal : Gtk.Overlay { vte.set_color_highlight(conf.selection_background); if (conf.get_warnings().length > 0) { - string header = "<b>Configuration loaded with warnings:</b>\n"; + string header = "<b>%s</b>\n".printf(_("Configuration loaded with warnings:")); infobar_show(header + string.joinv("\n", conf.get_warnings()), Gtk.MessageType.WARNING); } else if (reload) { - infobar_show("Configuration loaded successfully.", Gtk.MessageType.INFO, 3); + infobar_show(_("Configuration loaded successfully."), Gtk.MessageType.INFO, 3); } } |