GNOME Bugzilla – Bug 567105
Migrate gok to use msgctxt
Last modified: 2009-02-16 11:11:31 UTC
http://live.gnome.org/GnomeGoals/MsgctxtMigration
Created attachment 126069 [details] [review] Migrated to msgctxt I'm not a hacker; please review this patch carefully.
Thanks Leonardo. I've made a few changes to your patch: - removed some code that searched for the old context separator "|" in the strings. - changed the context in gok_keyboard_get_alpha_by_frequency() to "freq-level #" instead of "level #". The problem was that the "level 2" and "level 3" strings of gok_keyboard_get_alpha() and gok_keyboard_get_alpha_by_frequency() were merged in the .po file, but it should be possible to translate each one individually. Tested with en and de locales.
Created attachment 126497 [details] [review] Migrate to msgctxt ver. 2
@Gerd Kohlberger: Will you commit your own patch? Do you want me to commit it?
I've committed the patch. 2009-01-16 Gerd Kohlberger <gerdk@svn.gnome.org> * gok/gok-keyboard.c: Migrate to msgctxt (GNOME Goal). * configure.in: Bump glib and intltool versions. Patch by Leonardo Ferreira Fontenelle. Fixes bug #567105.
Thanks Leonardo and Gerd! Great to have this fix.
Sorry, but the result is not acceptable, because empty msgids (msgid "") are not valid. The sequence msgid ""/msgstr"" is of special meaning in po files and is only used in the header. msgmerge output is invalid when this sequence appear inside translatable body (See http://l10n.gnome.org/POT/gok.HEAD/gok.HEAD.sv.po) Moreover translation status will always contain untranslated strings for language which do not fill these entries. The solution, even non ideal, is to fill these with some code (e.g. "no-level-2", "no-level-3") and explain how to translate in the comment. The code should then check if this value is changed after getting in with gettext to determine is the value is filled or not (if _("no-level-2") == "no-level-2", level2 should be considered empty).
Also see http://live.gnome.org/TranslationProject/DevGuidelines/Don%27t%20mark%20empty%20strings%20for%20translation
Thanks for the explanation Claude. I saw the thread on gnome-i18n, but wasn't sure what's going on. Your suggestions seems fine. I'll start working on a patch so we can fix this before string freeze.
Created attachment 128764 [details] [review] Fix msgids This adds 'no-level' flags. Please review the translator comments.
Yes, that's fine, thanks! The only minor thing I would change is the first parameter to C_ macro (contextual marker). It can be "level" and "freq-level" instead of "level 2", "level 3",...
Fixed in trunk. Claude, I left the context strings as they are for now.