2
## langpack-gettext.dpatch by <michael.vogt@ubuntu.com>
4
# DP: Description: support alternative gettext tree in
5
# DP: /usr/share/locale-langpack; if a file is present in both trees,
6
# DP: prefer the newer one
7
# DP: Upstream status: Ubuntu-Specific
8
#! /bin/sh /usr/share/dpatch/dpatch-run
9
## langpack-gettext.dpatch by <egon@localhost.localdomain>
11
## All lines beginning with `## DP:' are a description of the patch.
12
## DP: Support language packs with pythons gettext implementation
15
if [ $# -eq 3 -a "$2" = '-d' ]; then
18
elif [ $# -ne 1 ]; then
19
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
24
patch $pdir -f --no-backup-if-mismatch -p1 < $0
27
patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
30
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
35
diff -urNad python2.4-2.4.3~/Lib/gettext.py python2.4-2.4.3/Lib/gettext.py
36
--- python2.4-2.4.3~/Lib/gettext.py 2004-07-22 20:44:01.000000000 +0200
37
+++ python2.4-2.4.3/Lib/gettext.py 2006-08-18 12:49:07.000000000 +0200
41
mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
42
+ mofile_lp = os.path.join("/usr/share/locale-langpack", lang,
43
+ 'LC_MESSAGES', '%s.mo' % domain)
45
+ # first look into the standard locale dir, then into the
46
+ # langpack locale dir
49
if os.path.exists(mofile):
55
+ # langpack mofile -> use it
56
+ if os.path.exists(mofile_lp):
58
+ result.append(mofile_lp)