GNOME Bugzilla – Bug 726890
use context to translate subcategory titles
Last modified: 2015-08-19 07:49:34 UTC
src/plugins/menu-spec-common.c gives subcategory titles a translation context but it is not being used when actually looking up the translation, that results in subcategories not being translated. Here is a patch to fix this (a static gchar array seemed ok in this case, but it could of course be changed to dynamic allocation and g_strdup_printf).
Created attachment 272641 [details] [review] use context to translate subcategory titles
Created attachment 272642 [details] [review] use context to translate subcategory titles The context is actually created based on the category name, not its path. (this caused subcategories of Games not being translated, because Games != Game).
Review of attachment 272642 [details] [review]: patch looks fine, though something mangled the From line
You okay to push this? Thanks.
I have now pushed this to master; do you want me to ask gnome-i18n@ for a string freeze break, to get in 3.12.1?
(In reply to comment #5) > I have now pushed this to master; do you want me to ask gnome-i18n@ for a > string freeze break, to get in 3.12.1? I think that's probably a good idea; we're not breaking translations, we're just making them possible, right?
Indeed, that doesn't even require a freeze break as the strings are already there. Cherry picked to gnome-3-12.
Created attachment 309511 [details] [review] Use the same algorithm in gs-plugin-menu-spec-refine.c The same problem is in gs-plugin-menu-spec-refine.c which causes the subcategory name not to be translated on the Details page of an application. To see the problem in your English desktop environment run: killall gnome-software LANG=es_US.UTF-8 gnome-software (or replace es_US with your favorite non-English language or if your desktop is not English simply run gnome-software as it is) then click any application and scroll down to Details and see the Category. The patch fixes the problem.
Review of attachment 309511 [details] [review]: Looks good to me, thanks! Just one nitpick: ::: src/plugins/gs-plugin-menu-spec-refine.c @@ +78,3 @@ str = g_strdup_printf ("%s → %s", gettext (cat->text), + g_dpgettext2(GETTEXT_PACKAGE, msgctxt, msdata[i].text)); Should be a space before the opening paren.
Pushed to master: https://git.gnome.org/browse/gnome-software/commit/?id=4fd1592bfc127533709e571eb399fbd11f0722c2