[iagno] Add translators comments.



commit 3383c7a46612276586c637d51d0a4095c33329e7
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Jan 10 05:44:18 2019 +0100

    Add translators comments.

 data/org.gnome.Reversi.desktop.in  |  7 ++++-
 data/org.gnome.Reversi.gschema.xml | 16 ++++++++++
 data/ui/iagno-screens.ui           | 10 ++++++
 data/ui/iagno-themes.ui            |  2 ++
 data/ui/iagno.ui                   |  8 ++++-
 src/game-window.vala               |  7 ++++-
 src/iagno.vala                     | 63 ++++++++++++++++++++++++++------------
 7 files changed, 91 insertions(+), 22 deletions(-)
---
diff --git a/data/org.gnome.Reversi.desktop.in b/data/org.gnome.Reversi.desktop.in
index ea0c230..4a43927 100644
--- a/data/org.gnome.Reversi.desktop.in
+++ b/data/org.gnome.Reversi.desktop.in
@@ -2,9 +2,11 @@
 # Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=org.gnome.Reversi
 Name=Iagno
+# Translators: a GenericName that gives the application goal, as defined in the desktop file spec
 GenericName=Reversi
+# Translators: a Comment that gives the application function, as defined in the desktop file spec
 Comment=Dominate the board in a classic version of Reversi
-# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list 
MUST also end with a semicolon!
+# Translators: some search Keywords to find this application, as defined in the desktop file spec. Do NOT 
translate or localize the semicolons! The list MUST also end with a semicolon!
 Keywords=reversi;othello;
 Exec=iagno
 Terminal=false
@@ -14,13 +16,16 @@ StartupNotify=true
 Actions=First;Second;TwoPlayers;
 
 [Desktop Action First]
+# Translators: an action Name, as defined in the desktop file spec
 Name=Play first (Dark)
 Exec=iagno --first
 
 [Desktop Action Second]
+# Translators: an action Name, as defined in the desktop file spec
 Name=Play second (Light)
 Exec=iagno --second
 
 [Desktop Action TwoPlayers]
+# Translators: an action Name, as defined in the desktop file spec
 Name=Two players game
 Exec=iagno --two-players
diff --git a/data/org.gnome.Reversi.gschema.xml b/data/org.gnome.Reversi.gschema.xml
index 36c5f01..729cb52 100644
--- a/data/org.gnome.Reversi.gschema.xml
+++ b/data/org.gnome.Reversi.gschema.xml
@@ -8,40 +8,56 @@
     <key name="computer-level" type="i">
       <default>1</default>
       <range min="1" max="3" />
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/computer-level' -->
       <summary>Computer’s AI level</summary>
+      <!-- Translators: description of a settings key, see 'dconf-editor /org/gnome/iagno/computer-level' -->
       <description>From 1, the easiest, to 3, the hardest.</description>
     </key>
     <key name="num-players" type="i">
       <default>1</default>
       <range min="1" max="2" />
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/num-players' -->
       <summary>Whether to play against the computer or another human.</summary>
+      <!-- TODO add description? -->
     </key>
     <key name="color" enum="org.gnome.Reversi.Color">
       <default>'dark'</default>
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/color' -->
       <summary>Color to play as</summary>
+      <!-- Translators: description of a settings key, see 'dconf-editor /org/gnome/iagno/color' -->
       <description>Whether to play as Dark or Light. Ignored for two-player games.</description>
     </key>
     <key name="theme" type="s">
       <default>'default'</default>
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/theme' -->
       <summary>Theme</summary>
+      <!-- Translators: description of a settings key, see 'dconf-editor /org/gnome/iagno/theme'; TODO the 
themes names are translated in the UI, but not in the settings; not sure what to do for now -->
       <description>Filename of the theme used, or "default". Are provided "adwaita.theme", 
"high_contrast.theme" and "sun_and_star.theme".</description>
     </key>
     <key name="sound" type="b">
       <default>true</default>
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/sound' -->
       <summary>Sound</summary>
+      <!-- Translators: description of a settings key, see 'dconf-editor /org/gnome/iagno/sound' -->
       <description>Whether or not to play event sounds.</description>
     </key>
     <key name="window-width" type="i">
       <default>675</default>
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/window-width' -->
       <summary>Width of the window in pixels</summary>
+      <!-- TODO add description? -->
     </key>
     <key name="window-height" type="i">
       <default>550</default>
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/window-height' -->
       <summary>Height of the window in pixels</summary>
+      <!-- TODO add description? -->
     </key>
     <key name="window-is-maximized" type="b">
       <default>false</default>
+      <!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/iagno/window-is-maximized' 
-->
       <summary>true if the window is maximized</summary>
+      <!-- TODO add description? -->
     </key>
   </schema>
 </schemalist>
diff --git a/data/ui/iagno-screens.ui b/data/ui/iagno-screens.ui
index 239f0a4..a7ef435 100644
--- a/data/ui/iagno-screens.ui
+++ b/data/ui/iagno-screens.ui
@@ -19,6 +19,7 @@
           <object class="GtkLabel">
             <property name="visible">True</property>
             <property name="halign">start</property>
+            <!-- Translators: when configuring a new game, header of the row for choosing the number of 
players -->
             <property name="label" translatable="yes">Players</property>
             <style>
               <class name="bold-label"/>
@@ -34,6 +35,7 @@
               <object class="GtkModelButton">
                 <property name="visible">True</property>
                 <property name="use_underline">True</property>
+                <!-- Translators: when configuring a new game, row "Players", label of the button to choose 
a one-player game (with a mnemonic that appears pressing Alt) -->
                 <property name="text" translatable="yes">_One</property>
                 <property name="action-name">app.num-players</property>
                 <property name="action-target">1</property>
@@ -45,6 +47,7 @@
               <object class="GtkModelButton">
                 <property name="visible">True</property>
                 <property name="use_underline">True</property>
+                <!-- Translators: when configuring a new game, row "Players", label of the button to choose 
a one-player game (with a mnemonic that appears pressing Alt) -->
                 <property name="text" translatable="yes">_Two</property>
                 <property name="action-name">app.num-players</property>
                 <property name="action-target">2</property>
@@ -68,6 +71,7 @@
           <object class="GtkLabel">
             <property name="visible">True</property>
             <property name="halign">start</property>
+            <!-- Translators: when configuring a new game, header of the row for choosing the level of the 
artificial intelligence -->
             <property name="label" translatable="yes">Difficulty</property>
             <style>
               <class name="bold-label"/>
@@ -83,6 +87,7 @@
               <object class="GtkModelButton">
                 <property name="visible">True</property>
                 <property name="use_underline">True</property>
+                <!-- Translators: when configuring a new game, row "Difficulty", label of the button to 
choose an easy-level computer adversary (with a mnemonic that appears pressing Alt) -->
                 <property name="text" translatable="yes">_Easy</property>
                 <property name="action-name">app.computer-level</property>
                 <property name="action-target">1</property>
@@ -94,6 +99,7 @@
               <object class="GtkModelButton">
                 <property name="visible">True</property>
                 <property name="use_underline">True</property>
+                <!-- Translators: when configuring a new game, row "Difficulty", label of the button to 
choose a medium-level computer adversary (with a mnemonic that appears pressing Alt) -->
                 <property name="text" translatable="yes">_Medium</property>
                 <property name="action-name">app.computer-level</property>
                 <property name="action-target">2</property>
@@ -105,6 +111,7 @@
               <object class="GtkModelButton">
                 <property name="visible">True</property>
                 <property name="use_underline">True</property>
+                <!-- Translators: when configuring a new game, row "Difficulty", label of the button to 
choose a hard-level computer adversary (with a mnemonic that appears pressing Alt) -->
                 <property name="text" translatable="yes">_Hard</property>
                 <property name="action-name">app.computer-level</property>
                 <property name="action-target">3</property>
@@ -128,6 +135,7 @@
           <object class="GtkLabel">
             <property name="visible">True</property>
             <property name="halign">start</property>
+            <!-- Translators: when configuring a new game, header of the row for choosing the played color 
(whether to start or not) -->
             <property name="label" translatable="yes">Color</property>
             <style>
               <class name="bold-label"/>
@@ -143,6 +151,7 @@
               <object class="GtkModelButton">
                 <property name="visible">True</property>
                 <property name="use_underline">True</property>
+                <!-- Translators: when configuring a new game, row "Color", label of the button to play the 
dark color, so to start (with a mnemonic that appears pressing Alt) -->
                 <property name="text" translatable="yes">_Dark</property>
                 <property name="action-name">app.color</property>
                 <property name="action-target">'dark'</property>
@@ -154,6 +163,7 @@
               <object class="GtkModelButton">
                 <property name="visible">True</property>
                 <property name="use_underline">True</property>
+                <!-- Translators: when configuring a new game, row "Color", label of the button to play the 
light color, so not play second (with a mnemonic that appears pressing Alt) -->
                 <property name="text" translatable="yes">_Light</property>
                 <property name="action-name">app.color</property>
                 <property name="action-target">'light'</property>
diff --git a/data/ui/iagno-themes.ui b/data/ui/iagno-themes.ui
index f9badf4..a2dd3e0 100644
--- a/data/ui/iagno-themes.ui
+++ b/data/ui/iagno-themes.ui
@@ -6,6 +6,7 @@
     <property name="width-request">333</property>
     <property name="height-request">450</property>
     <property name="resizable">False</property>
+    <!-- Translators: title of the theme dialog -->
     <property name="title" translatable="yes">Select Theme</property>
     <property name="border-width">0</property>
     <child internal-child="vbox">
@@ -51,6 +52,7 @@
                             <child>
                               <object class="GtkLabel">
                                 <property name="visible">True</property>
+                                <!-- Translators: first row (default theme) in the theme dialog -->
                                 <property name="label" translatable="yes">Default</property>
                                 <style><class name="italic-label"/></style>
                               </object>
diff --git a/data/ui/iagno.ui b/data/ui/iagno.ui
index f4d2085..eba6aa4 100644
--- a/data/ui/iagno.ui
+++ b/data/ui/iagno.ui
@@ -4,20 +4,24 @@
   <menu id="primary-menu">
     <section>
       <item>
+        <!-- Translators: hamburger menu entry; open theme dialog button (with a mnemonic that appears 
pressing Alt) -->
         <attribute name="label" translatable="yes">A_ppearance</attribute>
         <attribute name="action">app.theme</attribute>
       </item>
       <item>
+        <!-- Translators: hamburger menu entry; sound togglebutton (with a mnemonic that appears pressing 
Alt) -->
         <attribute name="label" translatable="yes">_Sound</attribute>
         <attribute name="action">app.sound</attribute>
       </item>
     </section>
     <section>
       <item>
+        <!-- Translators: hamburger menu entry; open help (with a mnemonic that appears pressing Alt) -->
         <attribute name="label" translatable="yes">_Help</attribute>
         <attribute name="action">app.help</attribute>
       </item>
       <item>
+        <!-- Translators: hamburger menu entry; open about dialog (with a mnemonic that appears pressing 
Alt) -->
         <attribute name="label" translatable="yes">_About Iagno</attribute>
         <attribute name="action">app.about</attribute>
       </item>
@@ -40,6 +44,7 @@
             <property name="visible">False</property>
             <property name="halign">center</property>
             <property name="valign">center</property>
+            <!-- Translators: when configuring a new game, if the user has a started game, tooltip text of 
the Go back button -->
             <property name="tooltip-text" translatable="yes">Go back to the current game</property>
             <property name="use-underline">True</property>
             <property name="action-name">win.back</property>
@@ -113,11 +118,12 @@
                       <object class="GtkButton" id="new_game_button">
                         <property name="visible">True</property>
                         <property name="use-underline">True</property>
+                        <!-- Translators: during a game, label of the Start Over button (with a mnemonic 
that appears pressing Alt) -->
                         <property name="label" translatable="yes">_New Game</property>
-                        <property name="tooltip-text" translatable="yes">Configure a new game</property>
                         <property name="halign">center</property>
                         <property name="valign">center</property>
                         <property name="action-name">win.new-game</property>
+                        <!-- Translators: during a game, tooltip text of the Start Over button -->
                         <property name="tooltip-text" translatable="yes">Start a new game</property>
                         <property name="width-request">120</property>
                         <property name="height-request">60</property>
diff --git a/src/game-window.vala b/src/game-window.vala
index e7d087b..5703c77 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -127,12 +127,14 @@ public class GameWindow : ApplicationWindow
         new_game_box.pack_start (new_game_screen, true, true, 0);
         if (GameWindowFlags.SHOW_START_BUTTON in flags)
         {
+            /* Translators: when configuring a new game, label of the blue Start button (with a mnemonic 
that appears pressing Alt) */
             start_game_button = new Button.with_mnemonic (_("_Start Game"));
-            // start_game_button.set_tooltip_text (_("Start a new game as configured"));
             start_game_button.width_request = 222;
             start_game_button.height_request = 60;
             start_game_button.halign = Align.CENTER;
             start_game_button.set_action_name ("win.start-game");
+            /* Translators: when configuring a new game, tooltip text of the blue Start button */
+            // start_game_button.set_tooltip_text (_("Start a new game as configured"));
             ((StyleContext) start_game_button.get_style_context ()).add_class ("suggested-action");
             start_game_button.show ();
             new_game_box.pack_end (start_game_button, false, false, 0);
@@ -152,6 +154,7 @@ public class GameWindow : ApplicationWindow
 
             Button undo_button = new Button.from_icon_name ("edit-undo-symbolic", Gtk.IconSize.BUTTON);
             undo_button.action_name = "win.undo";
+            /* Translators: during a game, tooltip text of the Undo button */
             undo_button.set_tooltip_text (_("Undo your most recent move"));
             undo_button.valign = Align.CENTER;
             undo_button.show ();
@@ -161,6 +164,7 @@ public class GameWindow : ApplicationWindow
             {
                 Button redo_button = new Button.from_icon_name ("edit-redo-symbolic", Gtk.IconSize.BUTTON);
                 redo_button.action_name = "app.redo";
+                / Translators: during a game, tooltip text of the Redo button /
                 redo_button.set_tooltip_text (_("Redo your most recent undone move"));
                 redo_button.valign = Align.CENTER;
                 redo_button.show ();
@@ -174,6 +178,7 @@ public class GameWindow : ApplicationWindow
         {
             Button hint_button = new Button.from_icon_name ("dialog-question-symbolic", Gtk.IconSize.BUTTON);
             hint_button.action_name = "app.hint";
+            / Translators: during a game, tooltip text of the Hint button /
             hint_button.set_tooltip_text (_("Receive a hint for your next move"));
             hint_button.valign = Align.CENTER;
             hint_button.show ();
diff --git a/src/iagno.vala b/src/iagno.vala
index 8933c3a..77b56d1 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -22,6 +22,9 @@ using Gtk;
 
 public class Iagno : Gtk.Application
 {
+    /* Translators: application name, as used in the window manager, the window title, the about dialog... */
+    internal const string PROGRAM_NAME = _("Iagno");
+
     /* Application settings */
     private GLib.Settings settings;
     private static bool fast_mode;
@@ -55,16 +58,35 @@ public class Iagno : Gtk.Application
 
     private const OptionEntry[] option_entries =
     {
+        /* Translators: command-line option description, see 'iagno --help' */
         { "alternative-start", 0, 0, OptionArg.NONE, ref alternative_start, N_("Start with an alternative 
position"), null},
-        { "fast-mode", 'f', 0, OptionArg.NONE, ref fast_mode, N_("Reduce delay before AI moves"), null},
-        { "first", 0, 0, OptionArg.NONE, null, N_("Play first"), null},
-        { "level", 'l', 0, OptionArg.STRING, ref level, N_("Set the level of the computer’s AI"), "LEVEL"},
-        { "mute", 0, 0, OptionArg.NONE, null, N_("Turn off the sound"), null},
-        { "second", 0, 0, OptionArg.NONE, null, N_("Play second"), null},
-        { "size", 's', 0, OptionArg.INT, ref size, N_("Size of the board (debug only)"), "SIZE"},
-        { "two-players", 0, 0, OptionArg.NONE, null, N_("Two-players mode"), null},
-        { "unmute", 0, 0, OptionArg.NONE, null, N_("Turn on the sound"), null},
-        { "version", 'v', 0, OptionArg.NONE, null, N_("Print release version and exit"), null},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "fast-mode", 'f', 0, OptionArg.NONE, ref fast_mode,               N_("Reduce delay before AI 
moves"), null},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "first", 0, 0, OptionArg.NONE, null,                              N_("Play first"), null},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "level", 'l', 0, OptionArg.STRING, ref level,                     N_("Set the level of the 
computer’s AI"), "LEVEL"},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "mute", 0, 0, OptionArg.NONE, null,                               N_("Turn off the sound"), null},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "second", 0, 0, OptionArg.NONE, null,                             N_("Play second"), null},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "size", 's', 0, OptionArg.INT, ref size,                          N_("Size of the board (debug 
only)"), "SIZE"},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "two-players", 0, 0, OptionArg.NONE, null,                        N_("Two-players mode"), null},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "unmute", 0, 0, OptionArg.NONE, null,                             N_("Turn on the sound"), null},
+
+        /* Translators: command-line option description, see 'iagno --help' */
+        { "version", 'v', 0, OptionArg.NONE, null,                          N_("Print release version and 
exit"), null},
         { null }
     };
 
@@ -83,7 +105,7 @@ public class Iagno : Gtk.Application
         Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
         Intl.textdomain (GETTEXT_PACKAGE);
 
-        Environment.set_application_name (_("Iagno"));
+        Environment.set_application_name (PROGRAM_NAME);
         Window.set_default_icon_name ("org.gnome.Reversi");
 
         return new Iagno ().run (args);
@@ -107,7 +129,7 @@ public class Iagno : Gtk.Application
 
         if (size < 4)
         {
-            /* Console message displayed for an incorrect size */
+            /* Translators: command-line error message, displayed for an incorrect game size request; try 
'iagno -s 2' */
             stderr.printf ("%s\n", _("Size must be at least 4."));
             return Posix.EXIT_FAILURE;
         }
@@ -155,6 +177,7 @@ public class Iagno : Gtk.Application
         else if (level == "three")  /*  || level == "hard" */
             settings.set_int ("computer-level", 3);
         else if (level != null)
+            /* Translators: command-line error message, displayed for an incorrect level request; try 'iagno 
-l 5' */
             stderr.printf ("%s\n", _("Level should be between 1 (easy) and 3 (hard). Settings unchanged."));
         //  stderr.printf ("%s\n", _("Level should be 1 (easy), 2 (medium) or 3 (hard). Settings 
unchanged."));     // TODO better?
 
@@ -170,7 +193,7 @@ public class Iagno : Gtk.Application
 
         /* Window */
         window = new GameWindow ("/org/gnome/Reversi/ui/iagno.css",
-                                 _("Iagno"),
+                                 PROGRAM_NAME,
                                  settings.get_int ("window-width"),
                                  settings.get_int ("window-height"),
                                  settings.get_boolean ("window-is-maximized"),
@@ -268,7 +291,7 @@ public class Iagno : Gtk.Application
         string[] documenters = { "Tiffany Antopolski", null };
 
         show_about_dialog (window,
-                           "name", _("Iagno"),
+                           "name", PROGRAM_NAME,
                            "version", VERSION,
                            "copyright",
                              "Copyright © 1998–2008 Ian Peters\n"+
@@ -276,9 +299,11 @@ public class Iagno : Gtk.Application
                              "Copyright © 2014–2019 Arnaud Bonatti",
                            "license-type", License.GPL_3_0,
                            "comments",
+                             /* Translators: about dialog text */
                              _("A disk flipping game derived from Reversi"),
                            "authors", authors,
                            "documenters", documenters,
+                           /* Translators: about dialog text; this string should be replaced by a text 
crediting yourselves and your translation team, or should be left empty. Do not translate literally! */
                            "translator-credits", _("translator-credits"),
                            "logo-icon-name", "org.gnome.Reversi",
                            "website", "https://wiki.gnome.org/Apps/Iagno";,
@@ -408,12 +433,12 @@ public class Iagno : Gtk.Application
         game.pass ();
         if (game.current_color == Player.DARK)
         {
-            /* Message to display when Light has no possible moves */
+            /* Translators: during a game, notification to display when Light has no possible moves */
             window.set_subtitle (_("Light must pass, Dark’s move"));
         }
         else
         {
-            /* Message to display when Dark has no possible moves */
+            /* Translators: during a game, notification to display when Dark has no possible moves */
             window.set_subtitle (_("Dark must pass, Light’s move"));
         }
     }
@@ -424,17 +449,17 @@ public class Iagno : Gtk.Application
 
         if (game.n_light_tiles > game.n_dark_tiles)
         {
-            /* Message to display when Light has won the game */
+            /* Translators: during a game, notification to display when Light has won the game */
             window.set_subtitle (_("Light wins!"));
         }
         else if (game.n_dark_tiles > game.n_light_tiles)
         {
-            /* Message to display when Dark has won the game */
+            /* Translators: during a game, notification to display when Dark has won the game */
             window.set_subtitle (_("Dark wins!"));
         }
         else
         {
-            /* Message to display when the game is a draw */
+            /* Translators: during a game, notification to display when the game is a draw */
             window.set_subtitle (_("The game is draw."));
         }
 
@@ -450,7 +475,7 @@ public class Iagno : Gtk.Application
 
         if (game.place_tile (x, y) == 0)
         {
-            /* Message to display when the player tries to make an illegal move */
+            /* Translators: during a game, notification to display when the player tries to make an illegal 
move */
             window.set_subtitle (_("You can’t move there!"));
         }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]