From 5fdfd3c6072ccb4af666603905c5965e4c6358f8 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sat, 26 Jun 2021 19:18:11 +0200 Subject: 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. --- configreader.vala | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'configreader.vala') 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 . 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 . 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 . from the config file + append_warning(_("invalid cursor blink setting '%s' in %s.%s").printf(blink, group, key)); return SYSTEM; } } -- cgit v1.2.3-2-gb3c3