File: langpack-gettext.diff

package info (click to toggle)
python3.13 3.13.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,328 kB
  • sloc: python: 704,014; ansic: 653,914; xml: 31,250; sh: 5,844; cpp: 4,326; makefile: 1,981; objc: 787; lisp: 502; javascript: 213; asm: 75; csh: 12
file content (38 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download | duplicates (3)
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
Description: Ubuntu: Support separate langpack packages
 Support alternative gettext tree in /usr/share/locale-langpack; if a file is
 present in both trees, prefer the newer one.
 Ubuntu collates gettext from packages on the DVD into language packs, to
 reduce disk-space on the image.
 This is Ubuntu-Specific.

Forwarded: not-needed

--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -513,11 +513,26 @@
         if lang == 'C':
             break
         mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
+        mofile_lp = os.path.join("/usr/share/locale-langpack", lang,
+                               'LC_MESSAGES', '%s.mo' % domain)
+
+	# first look into the standard locale dir, then into the 
+	# langpack locale dir
+
+	# standard mo file
         if os.path.exists(mofile):
             if all:
                 result.append(mofile)
             else:
                 return mofile
+        
+	# langpack mofile -> use it
+        if os.path.exists(mofile_lp): 
+            if all:
+                result.append(mofile_lp)
+            else:
+                return mofile_lp
+
     return result