GNOME Bugzilla – Bug 549489
Context needed on Logout string
Last modified: 2008-08-28 20:55:35 UTC
The "logout string is now used in two different contexts: #: ../capplets/sound/sound-theme-definition.h:58 #: ../libslab/bookmark-agent.c:1060 msgid "Logout" msgstr "" In libslab, this is a button label (translated by a verb in French) while in sound capplet is is an event (translated by a noun in French). Therefore, we need to add translation context.
Created attachment 117419 [details] [review] Proposed patch to add context
The glib docs seem to suggest that when using NC_ you need to use a different gettext function to extract the string than if you were using N_. So, doesn't this break? Shouldn't we use Q_("Sound event|Logout") instead?
I thought we were in the case where Q_ or C_ couldn't be used directly (string initialization). If it's not the case, then you can use C_ (Q_ will soon be deprecated in GNOME, see http://live.gnome.org/GnomeGoals/MsgctxtMigration). But you're right in that NC_ should correspond to a g_dpgettext2 call at runtime. Moreover, I doubt it's possible to mix N_ and NC_ in the same array, as it will probably lead to problem at runtime where you have to choose either _( or g_dpgetext2. Anyway, I'm not expert in C programming. It might be worth to ping mclasen who added recently NC_ in glib.
Claude is right a) using Q_() in array initialization won't work, since it expands to a function call, and the compiler will complain. b) mixing NC_() and N_() in the same array will make it impossible for you to get the translated string later Jens is right that using NC_() means you need to slightly update the rule for generating your pot in po/Makefile.in.in for xgettext to do the right thing with NC_(). See the NC_ docs for details.
Created attachment 117477 [details] [review] Updated patch With latest intltool, the msgctxt are automatically added to the pot file.
Please use g_dpgettext2 (...) instead of g_dpgettext2(...) We also need to raise the glib requirement (to 2.17.4 I believe) if we start using NC_. Otherwise looks ok.
Created attachment 117544 [details] [review] Coding standard and glib 2.17.4 requirement
Will also write to gnome-i18n.