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 604771 - Adding context to some strings
Adding context to some strings
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
HEAD
Other All
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-12-16 20:10 UTC by Alexander Shopov
Modified: 2010-02-16 12:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add contexts (5.11 KB, patch)
2009-12-16 20:10 UTC, Alexander Shopov
needs-work Details | Review

Description Alexander Shopov 2009-12-16 20:10:06 UTC
Created attachment 149873 [details] [review]
Patch to add contexts

The "Create Automatic Playlist" window has two drop downs with terms that would require different forms of words for languages with noun case  or suffixed articles systems.
I am sending a patch to add message contexts with the "C_" macro.
Comment 1 Jonathan Matthew 2009-12-20 07:12:28 UTC
Review of attachment 149873 [details] [review]:

This doesn't even build.

For this to actually work, some code changes are required.  Where we currently get the translated option name with _(options[i].name), we'd need to use g_dpgettext2 (NULL, context, options[i].name).

::: widgets/rb-query-creator-properties.c
@@ +71,3 @@
 const RBQueryCreatorPropertyOption property_options[] =
 {
+	{ C_("criterion", "Title"), RHYTHMDB_PROP_TITLE, RHYTHMDB_PROP_TITLE_FOLDED, &string_property_type },

This (and all the other strings) needs to use NC_("x", "y") .. which requires glib 2.18.  We currently only require 2.16.
Comment 2 Alexander Shopov 2009-12-29 10:17:11 UTC
> This doesn't even build.
Sigh, you are so right. When producing the patch I just tested the generation of the po-file.

> For this to actually work, some code changes are required.
Actually as my C is not quite good - I see several ways about it, but I am not sure whether the result will be according to the coding standards or will be palpable to a seasoned C programmer. If I am wasting your time - just say so.

The problem is that property_options is const and thus initialized on compile.
I could make it initialized on first run of a function that uses it. Or instead - it could be accessed as returned by a function every time.

Will this be a good way o doing it, or will be simpler to just wait for the bumping up of the needed glib? Then it could be just fixed as an enhancement.
Comment 3 Jonathan Matthew 2009-12-29 10:30:28 UTC
I'll probably be bumping the glib requirement up to 2.18 soon.  I'll fix this once I've done that.
Comment 4 Jonathan Matthew 2010-02-16 12:01:24 UTC
fixed in commit b9062fb