After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744255 - Disambiguate string "Add Tags"
Disambiguate string "Add Tags"
Status: RESOLVED FIXED
Product: shotwell
Classification: Other
Component: Internationalization
unspecified
Other Linux
: Normal normal
: 0.24
Assigned To: Shotwell Maintainers
Shotwell Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-10 11:44 UTC by Dušan
Modified: 2016-07-10 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
i18n: Disambiguate string "Add Tags" (1.28 KB, patch)
2016-07-03 09:58 UTC, Jens Georg
committed Details | Review
i18n: Add C_ to vala keywords (809 bytes, patch)
2016-07-10 12:49 UTC, Jens Georg
committed Details | Review

Description Dušan 2015-02-10 11:44:31 UTC
Please split this string because one is for dialog title and second case is for menu item. we have different translation for these cases.


#: ../src/Resources.vala:290 ../src/Resources.vala:323
msgid "Add Tags"


Dev wiki link:
https://wiki.gnome.org/TranslationProject/DevGuidelines/Translation%20contexts
Comment 1 Jens Georg 2016-04-23 20:43:18 UTC
Are there any conventions on the contexts or would something like 
diff --git a/src/Resources.vala b/src/Resources.vala
index 3b15d11..19f0ca4 100644
--- a/src/Resources.vala
+++ b/src/Resources.vala
@@ -320,7 +320,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
     public const string ADD_TAGS_MENU = _("Add _Tags...");
     public const string ADD_TAGS_CONTEXT_MENU = _("_Add Tags...");
     // Dialog title
-    public const string ADD_TAGS_TITLE = _("Add Tags");
+    public const string ADD_TAGS_TITLE = C_("Dialog Title", "Add Tags");
 
     public const string PREFERENCES_MENU = _("_Preferences");
     
@@ -353,7 +353,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
                 HierarchicalTagUtilities.get_basename(names[1]));
         } else {
             // Undo/Redo command name (in Edit menu)
-            return _("Add Tags");
+            return C_("Edit Menu", "Add Tags");
         }
     }

do?
Comment 2 Rafael Fontenelle 2016-07-03 03:23:24 UTC
This doesn't seem to work. I patched this into the source code, ran 'make update-po' inside po/, and the msgid "Add Tags" desappeared from PO files, indicating that it was not found in the source code.

Also, I tried to compile the source code with that patch and it failed with the following output:

  VALAC    shotwell_vala.stamp
src/Resources.vala:318.42-318.71: error: Value must be constant
    public const string ADD_TAGS_TITLE = C_("Dialog Title", "Add Tags");
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/Dialogs.vala:1977.15-1977.38: error: Invalid type for argument 1
        base (Resources.ADD_TAGS_TITLE, _("Tags (separated by commas):"));
              ^^^^^^^^^^^^^^^^^^^^^^^^
Compilation failed: 2 error(s), 0 warning(s)
make[2]: *** [Makefile:6707: shotwell_vala.stamp] Error 1
make[2]: Leaving directory '/build/shotwell-git/src/shotwell'
make[1]: *** [Makefile:6997: all-recursive] Error 1
make[1]: Leaving directory '/build/shotwell-git/src/shotwell'
make: *** [Makefile:1435: all] Error 2
Comment 3 Jens Georg 2016-07-03 07:14:58 UTC
Ah, sorry, I think didn't actually try the patch, this has to be NC_ of course.

Then with make update-po, you get

#: src/Resources.vala:318                                                       
#, fuzzy                                                                        
msgctxt "Dialog Title"                                                          
msgid "Add Tags"                                                                
msgstr "Stichworte hinzufügen"
Comment 4 Rafael Fontenelle 2016-07-03 07:22:43 UTC
Yep, adding NC_ do the job. I'm not the requester, but IMHO this patch solves the ambiguity.
Comment 5 Dušan 2016-07-03 07:26:32 UTC
yep. it looks fine now. thank you!
Comment 6 Jens Georg 2016-07-03 09:58:21 UTC
Created attachment 330808 [details] [review]
i18n: Disambiguate string "Add Tags"

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 7 Piotr Drąg 2016-07-03 15:27:03 UTC
You probably need to update https://git.gnome.org/browse/shotwell/tree/po/Makevars#n11 as well.
Comment 8 Jens Georg 2016-07-03 16:41:59 UTC
Looking at the documentation, I suspect just dropping the --keyword things would be sufficient?
Comment 9 Piotr Drąg 2016-07-03 16:51:22 UTC
I'm not sure about that, other modules define keywords:

https://git.gnome.org/browse/gnome-flashback/tree/po/Makevars#n11

https://git.gnome.org/browse/gtk+/tree/po/Makevars#n11
Comment 10 Jens Georg 2016-07-04 19:33:59 UTC
The xgettext info page says those are default for Vala:

        • For Vala: ‘_’, ‘Q_’, ‘N_’, ‘NC_’, ‘dgettext:2’, ‘dcgettext:2’,
          ‘ngettext:1,2’, ‘dngettext:2,3’, ‘dpgettext:2c,3’,
          ‘dpgettext2:2c,3’.

So I just remove _ and N_ and it should be fine. Texts show up in pot
Comment 11 Jens Georg 2016-07-04 19:42:31 UTC
Attachment 330808 [details] pushed as 80eb795 - i18n: Disambiguate string "Add Tags"
Comment 12 Piotr Drąg 2016-07-06 22:52:36 UTC
It appears that two strings are not extracted properly:

https://l10n.gnome.org/POT/shotwell.master/shotwell.master.pl.po - look at the end of the file:

#~ msgctxt "Dialog Title"
#~ msgid "Edit Title"
#~ msgstr "Modyfikacja tytułu"

#~ msgctxt "UndoRedo menu entry"
#~ msgid "Add Tags"
#~ msgstr "Dodaj etykiety"
Comment 13 Rafael Fontenelle 2016-07-06 23:15:42 UTC
Missing N from NC_
Comment 14 Jens Georg 2016-07-10 12:29:29 UTC
But the string is in normal code flow, not in array initializer
Comment 15 Jens Georg 2016-07-10 12:47:40 UTC
Ah, it's in comment 10 - C_ is not in the vala defaults.
Comment 16 Jens Georg 2016-07-10 12:49:09 UTC
Created attachment 331161 [details] [review]
i18n: Add C_ to vala keywords

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 17 Jens Georg 2016-07-10 12:49:46 UTC
Attachment 331161 [details] pushed as 1eb0bda - i18n: Add C_ to vala keywords