~ubuntu-branches/ubuntu/utopic/monajat/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/fix-lang-selection.diff

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2011-10-22 09:40:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20111022094019-gpw3oq0wcv8zh3k5
Tags: 2.6.2-1
* New upstream release.
* Removed patches applied upstream: fix-lang-selection.diff,
  remove-timeout-to-fix-lp-844680.patch
* debian/copyright: Updated copyright format & years

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Fix language selections
2
 
Origin: http://git.ojuba.org/cgit/monajat/commit/?id=e24c17ab572e5c56c14c8f3af465382ede61091b
3
 
Author: Muayyad Alsadi مؤيد السعدي <alsadi@ojuba.org>
4
 
 
5
 
 
6
 
--- a/monajat/applet.py
7
 
+++ b/monajat/applet.py
8
 
@@ -4,6 +4,7 @@
9
 
 from monajat import Monajat
10
 
 from utils import init_dbus
11
 
 import locale, gettext
12
 
+import re
13
 
 
14
 
 import glib
15
 
 import gtk
16
 
@@ -45,7 +46,7 @@
17
 
     
18
 
   def on_message(self, bus, message):
19
 
     t = message.type
20
 
-    print t
21
 
+    # print t
22
 
     if t == gst.MESSAGE_EOS:
23
 
       if self.change_play_status: self.change_play_status()
24
 
       self.gst_player.set_state(gst.STATE_NULL)
25
 
@@ -233,6 +234,7 @@
26
 
     return gtk.Dialog.run(self, *a, **kw)
27
 
 
28
 
 class applet(object):
29
 
+  locale_re=re.compile('^[a-z]+_[A-Z]+$', re.I)
30
 
   skip_auto_fn=os.path.expanduser('~/.monajat-applet-skip-auto')
31
 
   def __init__(self):
32
 
     self.conf_dlg=None
33
 
@@ -244,7 +246,7 @@
34
 
     self.prayer_items=[]
35
 
     kw=self.conf_to_prayer_args()
36
 
     self.prayer=itl.PrayerTimes(**kw)
37
 
-    l=filter(lambda i: i.startswith('ar_') and "_" in i and '.' not in i, locale.locale_alias.keys())
38
 
+    l=filter(lambda i: i.startswith(self.m.lang+'_') and self.locale_re.match(i), locale.locale_alias.keys())
39
 
     if l:
40
 
       l,c=l[0].split('_',1)
41
 
       l=l+"_"+c.upper()+".UTF-8"