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 726890 - use context to translate subcategory titles
use context to translate subcategory titles
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-03-22 16:40 UTC by Frederic Peters
Modified: 2015-08-19 07:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use context to translate subcategory titles (1.31 KB, patch)
2014-03-22 16:40 UTC, Frederic Peters
none Details | Review
use context to translate subcategory titles (1.31 KB, patch)
2014-03-22 16:54 UTC, Frederic Peters
committed Details | Review
Use the same algorithm in gs-plugin-menu-spec-refine.c (1.38 KB, patch)
2015-08-18 23:16 UTC, Rafal Luzynski
committed Details | Review

Description Frederic Peters 2014-03-22 16:40:29 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).
Comment 1 Frederic Peters 2014-03-22 16:40:30 UTC
Created attachment 272641 [details] [review]
use context to translate subcategory titles
Comment 2 Frederic Peters 2014-03-22 16:54:39 UTC
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).
Comment 3 Matthias Clasen 2014-03-23 19:27:39 UTC
Review of attachment 272642 [details] [review]:

patch looks fine, though something mangled the From line
Comment 4 Richard Hughes 2014-04-07 16:31:03 UTC
You okay to push this? Thanks.
Comment 5 Frederic Peters 2014-04-07 16:36:50 UTC
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?
Comment 6 Richard Hughes 2014-04-08 08:31:13 UTC
(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?
Comment 7 Frederic Peters 2014-04-08 08:52:41 UTC
Indeed, that doesn't even require a freeze break as the strings are already there.

Cherry picked to gnome-3-12.
Comment 8 Rafal Luzynski 2015-08-18 23:16:18 UTC
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.
Comment 9 Kalev Lember 2015-08-19 07:41:09 UTC
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.