GNOME Bugzilla – Bug 604771
Adding context to some strings
Last modified: 2010-02-16 12:01:24 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.
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.
> 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.
I'll probably be bumping the glib requirement up to 2.18 soon. I'll fix this once I've done that.
fixed in commit b9062fb