1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
Description: retrieve translations with the X-Ubuntu-Gettext-Domain key
Display translations for patched desktop files from Ubuntu whose
translations are stored in a different place ("X-Ubuntu-Gettext-Domain"
key is used to find it).
Author: Lionel Le Folgoc <mrpouit@ubuntu.com>
Forwarded: not-needed
@@ -555,10 +555,30 @@ xfce_rc_read_entry (const XfceRc *rc,
{
const gchar *value;
+#ifdef UBUNTU
+ gboolean has_gettext_domain;
+ const gchar *gettext_domain;
+#endif
+
g_return_val_if_fail (rc != NULL, fallback);
g_return_val_if_fail (rc->read_entry != NULL, fallback);
g_return_val_if_fail (key != NULL, fallback);
+#ifdef UBUNTU
+ has_gettext_domain = xfce_rc_has_entry (rc, "X-Ubuntu-Gettext-Domain");
+
+ if (has_gettext_domain == TRUE && (strcmp (key, "Name") == 0 || strcmp (key, "GenericName") == 0 || strcmp (key, "Comment") == 0))
+ {
+ gettext_domain = (*rc->read_entry) (rc, "X-Ubuntu-Gettext-Domain", FALSE);
+
+ if (gettext_domain != NULL)
+ {
+ value = dgettext (gettext_domain, xfce_rc_read_entry_untranslated (rc, key, fallback));
+ return value;
+ }
+ }
+#endif
+
value = (*rc->read_entry) (rc, key, TRUE);
if (value == NULL)
value = fallback;
|