GNOME Bugzilla – Bug 703601
Make strings translatable
Last modified: 2013-08-12 15:34:26 UTC
Many strings are still not set as translatable in the sources. The gettext domain is also not set. Translation domains are not set in .ui files. Notes for developers/contributors for i18n: - Use double quotes for strings that are translatable, use single quotes otherwise. This will make looking for translatable strings easier. - Use _() so that the strings will be translated at runtime. Check first if the source file already has a "const _ = imports.gettext.gettext;" line, if not, add it after the "imports.gi.*" constants. - Use contexts if the string are too short. For example, C_("Song Title", "Title") instead of just _("Title"). Check first if the source file already has a "const C_ = imports.gettext.gettext;" line, if not, add it after "const _ = imports.gettext.gettext;" line. Add that line too if not available. - Add "Translators:" comments to strings where the context cannot be easily understood, or there are placeholders (and it is not easily understood). Something like this: // Translators: "Songs" refers to the Songs view - Use ngettext if strings have numbers/etc so that they will be properly translated when in plural: Gettext.ngettext("%d day ago", "%d days ago", days).format(days); Check first if the source file already has a "const Gettext = imports.gettext;" line, if not, add it before "const _ = imports.gettext.gettext;" line. Add that line too if not available. - Move translatable strings to .ui files if possible. - When editing .ui files in Glade, made sure to set the translation domain to "gnome-music" by going to main menu then: File > Properties > Project Properties > Translation Domain - In .ui files, make sure that strings like labels are set as translatable if it should be translated at runtime. - Strings in the settings schema file should be translatable. Enum values, key names, etc. are not translatable though. - Log messages ("log('Message');" lines) shouldn't be translated. - All source files and .ui files should be added to po/POTFILES.in file. For more info, refer to: - Gettext info page, or here online: http://www.gnu.org/software/gettext/manual/html_node/index.html - Internalization section of GLib Reference Manual using DevHelp, or online: https://developer.gnome.org/glib/stable/glib-I18N.html
Fixed in https://git.gnome.org/browse/gnome-music/commit/?id=a396038551e3ccb43fba65e65378956cbe27d16c