[Debian-islamic-commits] [SCM] Packaging for Monajat branch, master, updated. debian/2.6.2-1-3-g5ea323c

أحمد المحمو =?UTF-8?Q?=D8=AF=D9=8A=20?=(Ahmed El-Mahmoudy) aelmahmoudy at sabily.org
Wed Oct 26 07:09:55 UTC 2011


The following commit has been merged in the master branch:
commit 3e6ed55e6397a8de53ac1b4e35bf8a398262dc48
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at sabily.org>
Date:   Wed Oct 26 08:12:01 2011 +0200

    Added fix_locale.diff patch to fix locale setting logic
    
    Closes: #646483

diff --git a/debian/patches/fix_locale.diff b/debian/patches/fix_locale.diff
new file mode 100644
index 0000000..16dca3f
--- /dev/null
+++ b/debian/patches/fix_locale.diff
@@ -0,0 +1,37 @@
+Description: Simplify locale setting logic
+ Removed logic that tries to guess the appropriate locale for the
+ selected language, and leave that to setlocale. If successful, also the
+ LC_MESSAGES environment variable is also set to that locale, otherwise
+ just continue.
+Origin: http://git.ojuba.org/cgit/monajat/commit/?id=2772f74cd4ecf5a1f613ea8ad10855f960621693
+Bug-Debian: http://bugs.debian.org/646483
+
+diff --git a/monajat/applet.py b/monajat/applet.py
+index fd9d122..048d9f0 100644
+--- a/monajat/applet.py
++++ b/monajat/applet.py
+@@ -241,7 +241,6 @@ class ConfigDlg(gtk.Dialog):
+     return gtk.Dialog.run(self, *a, **kw)
+ 
+ class applet(object):
+-  locale_re=re.compile('^[a-z]+_[A-Z]+$', re.I)
+   skip_auto_fn=os.path.expanduser('~/.monajat-applet-skip-auto')
+   def __init__(self):
+     self.conf_dlg=None
+@@ -253,12 +252,10 @@ class applet(object):
+     self.prayer_items=[]
+     kw=self.conf_to_prayer_args()
+     self.prayer=itl.PrayerTimes(**kw)
+-    l=filter(lambda i: i.startswith(self.m.lang+'_') and self.locale_re.match(i), locale.locale_alias.keys())
+-    if l:
+-      l,c=l[0].split('_',1)
+-      l=l+"_"+c.upper()+".UTF-8"
+-      os.environ['LC_MESSAGES']=l
+-      locale.setlocale(locale.LC_MESSAGES, l)
++    try:
++      l=locale.setlocale(locale.LC_MESSAGES, (self.m.lang, 'UTF-8'))
++      if l: os.environ['LC_MESSAGES']=l
++    except locale.Error: pass
+     ld=os.path.join(self.m.get_prefix(),'..','locale')
+     gettext.install('monajat', ld, unicode=0)
+     self.ptnames=[_("Fajr"), _("Sunrise"), _("Dhuhr"), _("Asr"), _("Maghrib"), _("Isha'a")]
diff --git a/debian/patches/series b/debian/patches/series
index 304961e..fb2cc4a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 drop_cmp_to_key.diff
+fix_locale.diff

-- 
Packaging for Monajat



More information about the Debian-islamic-commits mailing list