[Python-apps-commits] r6083 - in packages/gtg/trunk/debian (3 files)

dktrkranz at users.alioth.debian.org dktrkranz at users.alioth.debian.org
Sun Sep 5 08:57:05 UTC 2010


    Date: Sunday, September 5, 2010 @ 08:56:49
  Author: dktrkranz
Revision: 6083

* debian/patches/locale.patch:
  - Use bindtextdomain to simplify locale handling (Closes: #595436, #595440)

Added:
  packages/gtg/trunk/debian/patches/locale.patch
Modified:
  packages/gtg/trunk/debian/changelog
  packages/gtg/trunk/debian/patches/series

Modified: packages/gtg/trunk/debian/changelog
===================================================================
--- packages/gtg/trunk/debian/changelog	2010-09-05 08:53:58 UTC (rev 6082)
+++ packages/gtg/trunk/debian/changelog	2010-09-05 08:56:49 UTC (rev 6083)
@@ -3,8 +3,10 @@
   * debian/patches/x_is_running.patch:
     - Check existence of X lock files and associated PIDs to see if X
       is running (Closes: #595430).
+  * debian/patches/locale.patch:
+    - Use bindtextdomain to simplify locale handling (Closes: #595436, #595440).
 
- -- Luca Falavigna <dktrkranz at debian.org>  Sun, 05 Sep 2010 10:49:08 +0200
+ -- Luca Falavigna <dktrkranz at debian.org>  Sun, 05 Sep 2010 10:54:51 +0200
 
 gtg (0.2.4-3) unstable; urgency=low
 

Added: packages/gtg/trunk/debian/patches/locale.patch
===================================================================
--- packages/gtg/trunk/debian/patches/locale.patch	                        (rev 0)
+++ packages/gtg/trunk/debian/patches/locale.patch	2010-09-05 08:56:49 UTC (rev 6083)
@@ -0,0 +1,38 @@
+Use bindtextdomain to simplify locale handling
+
+Index: gtg-0.2.4/GTG/__init__.py
+===================================================================
+--- gtg-0.2.4.orig/GTG/__init__.py	2010-09-05 01:56:48.621395656 +0200
++++ gtg-0.2.4/GTG/__init__.py	2010-09-05 02:08:23.560415693 +0200
+@@ -51,19 +51,7 @@
+ 
+ #Translation setup (from pyroom)
+ GETTEXT_DOMAIN = 'gtg'
+-LOCALE_PATH = abspath(join(dirname(__file__), pardir, 'locales'))
+-if not os.path.isdir(LOCALE_PATH):
+-    if os.path.isdir('/usr/local/share/locale') and os.uname()[0] != 'Linux':
+-        LOCALE_PATH = '/usr/local/share/locale'
+-    else:
+-        LOCALE_PATH = '/usr/share/locale'
+-languages_used = []
+-lc, encoding = locale.getdefaultlocale()
+-if lc:
+-    languages_used = [lc]
+-lang_in_env = os.environ.get('LANGUAGE', None)
+-if lang_in_env:
+-    languages_used.extend(lang_in_env.split(':'))
++LOCALE_PATH = gettext.bindtextdomain(GETTEXT_DOMAIN)
+ 
+ for module in gettext, loaded_glade:
+     #check if glade is well loaded to avoid error in Fedora build farm
+@@ -71,9 +59,7 @@
+         module.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH)
+         module.textdomain(GETTEXT_DOMAIN)
+ 
+-translation = gettext.translation(GETTEXT_DOMAIN, LOCALE_PATH,
+-                                  languages=languages_used,
+-                                  fallback=True)
++translation = gettext.translation(GETTEXT_DOMAIN, LOCALE_PATH, fallback=True)
+ 
+ _ = translation.gettext
+ #ngettext underscore when a phrase can be singular or plural. Usage:

Modified: packages/gtg/trunk/debian/patches/series
===================================================================
--- packages/gtg/trunk/debian/patches/series	2010-09-05 08:53:58 UTC (rev 6082)
+++ packages/gtg/trunk/debian/patches/series	2010-09-05 08:56:49 UTC (rev 6083)
@@ -2,3 +2,4 @@
 reaper_hang.patch
 xml_temp_file.patch
 x_is_running.patch
+locale.patch




More information about the Python-apps-commits mailing list