r30898 - in /desktop/experimental/glib2.0/debian: changelog patches/01_gettext-desktopfiles.patch

mpitt at users.alioth.debian.org mpitt at users.alioth.debian.org
Fri Oct 21 10:36:02 UTC 2011


Author: mpitt
Date: Fri Oct 21 10:36:01 2011
New Revision: 30898

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=30898
Log:
* debian/patches/01_gettext-desktopfiles.patch:
  - Translate X-GNOME-FullName and X-GNOME-Keywords, too.

Modified:
    desktop/experimental/glib2.0/debian/changelog
    desktop/experimental/glib2.0/debian/patches/01_gettext-desktopfiles.patch

Modified: desktop/experimental/glib2.0/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/changelog?rev=30898&op=diff
==============================================================================
--- desktop/experimental/glib2.0/debian/changelog [utf-8] (original)
+++ desktop/experimental/glib2.0/debian/changelog [utf-8] Fri Oct 21 10:36:01 2011
@@ -1,3 +1,10 @@
+glib2.0 (2.30.1-2) UNRELEASED; urgency=low
+
+  * debian/patches/01_gettext-desktopfiles.patch:
+    - Translate X-GNOME-FullName and X-GNOME-Keywords, too.
+
+ -- Martin Pitt <mpitt at debian.org>  Fri, 21 Oct 2011 12:35:24 +0200
+
 glib2.0 (2.30.1-1) experimental; urgency=low
 
   [ Michael Biebl ]

Modified: desktop/experimental/glib2.0/debian/patches/01_gettext-desktopfiles.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/patches/01_gettext-desktopfiles.patch?rev=30898&op=diff
==============================================================================
--- desktop/experimental/glib2.0/debian/patches/01_gettext-desktopfiles.patch [utf-8] (original)
+++ desktop/experimental/glib2.0/debian/patches/01_gettext-desktopfiles.patch [utf-8] Fri Oct 21 10:36:01 2011
@@ -1,10 +1,10 @@
 # Description: If a .desktop file does not have inline translations, fall back to calling gettext.
 # Ubuntu: https://launchpad.net/bugs/3935
 # Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=569829
-Index: glib-2.30.0/glib/gkeyfile.c
+Index: glib2.0-2.30.0/glib/gkeyfile.c
 ===================================================================
---- glib-2.30.0.orig/glib/gkeyfile.c	2011-09-26 22:54:50.000000000 +0200
-+++ glib-2.30.0/glib/gkeyfile.c	2011-10-06 03:28:09.442777108 +0200
+--- glib2.0-2.30.0.orig/glib/gkeyfile.c	2011-09-26 22:54:50.000000000 +0200
++++ glib2.0-2.30.0/glib/gkeyfile.c	2011-10-20 11:30:05.798960213 +0200
 @@ -88,6 +88,7 @@
    GKeyFileFlags flags;
  
@@ -67,31 +67,32 @@
    gint i;
  
    g_return_val_if_fail (key_file != NULL, NULL);
-@@ -1719,6 +1739,23 @@
+@@ -1719,6 +1739,24 @@
        free_languages = FALSE;
      }
    
 +  /* we're only interested in gettext translation if we don't have a
 +   * translation in the .desktop file itself and if the key is one of the keys
-+   * we know we want to translate: Name, GenericName, Comment.  Blindly doing
-+   * this for all keys can give strange result for the icons, since the Icon is
-+   * a locale string in the spec, eg.  We also only get translation in the mo
-+   * file if the requested locale is the LC_MESSAGES one. Ideally, we should do
-+   * more and change LC_MESSAGES to use the requested locale, but there's no
-+   * guarantee it's installed on the system and it might have some
-+   * side-effects.  Since this is a corner case, let's ignore it. */
-+
++   * we know we want to translate: Name, GenericName, Comment, Keywords.
++   * Blindly doing this for all keys can give strange result for the icons,
++   * since the Icon is a locale string in the spec, eg.  We also only get
++   * translation in the mo file if the requested locale is the LC_MESSAGES one.
++   * Ideally, we should do more and change LC_MESSAGES to use the requested
++   * locale, but there's no guarantee it's installed on the system and it might
++   * have some side-effects.  Since this is a corner case, let's ignore it. */
 +  msg_locale = setlocale (LC_MESSAGES, NULL);
 +  try_gettext = msg_locale && key_file->gettext_domain &&
 +                strcmp (group_name, G_KEY_FILE_DESKTOP_GROUP) == 0 &&
 +                (strcmp (key, G_KEY_FILE_DESKTOP_KEY_NAME) == 0 ||
++                 strcmp (key, G_KEY_FILE_DESKTOP_KEY_FULLNAME) == 0 ||
 +                 strcmp (key, G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME) == 0 ||
++                 strcmp (key, G_KEY_FILE_DESKTOP_KEY_KEYWORDS) == 0 ||
 +                 strcmp (key, G_KEY_FILE_DESKTOP_KEY_COMMENT) == 0);
 +
    for (i = 0; languages[i]; i++)
      {
        candidate_key = g_strdup_printf ("%s[%s]", key, languages[i]);
-@@ -1735,6 +1772,39 @@
+@@ -1735,6 +1773,39 @@
        translated_value = NULL;
     }
  
@@ -131,15 +132,17 @@
    /* Fallback to untranslated key
     */
    if (!translated_value)
-Index: glib-2.30.0/glib/gkeyfile.h
+Index: glib2.0-2.30.0/glib/gkeyfile.h
 ===================================================================
---- glib-2.30.0.orig/glib/gkeyfile.h	2011-09-09 21:58:10.000000000 +0200
-+++ glib-2.30.0/glib/gkeyfile.h	2011-10-06 03:28:09.442777108 +0200
-@@ -256,6 +256,7 @@
+--- glib2.0-2.30.0.orig/glib/gkeyfile.h	2011-09-09 21:58:10.000000000 +0200
++++ glib2.0-2.30.0/glib/gkeyfile.h	2011-10-20 11:29:55.350960690 +0200
+@@ -256,6 +256,9 @@
  #define G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY   "StartupNotify"
  #define G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS "StartupWMClass"
  #define G_KEY_FILE_DESKTOP_KEY_URL              "URL"
 +#define G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN   "X-GNOME-Gettext-Domain"
++#define G_KEY_FILE_DESKTOP_KEY_FULLNAME         "X-GNOME-FullName"
++#define G_KEY_FILE_DESKTOP_KEY_KEYWORDS         "X-GNOME-Keywords"
  
  #define G_KEY_FILE_DESKTOP_TYPE_APPLICATION     "Application"
  #define G_KEY_FILE_DESKTOP_TYPE_LINK            "Link"




More information about the pkg-gnome-commits mailing list