summaryrefslogtreecommitdiffstats
path: root/gettext.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-09-20 15:34:52 +0000
committerMatt Wilson <msw@redhat.com>1999-09-20 15:34:52 +0000
commit16418b06ece578a61845a451c1c2be0ead138151 (patch)
treeac92bd55a5f0e37add30ec4b897a10cfbba38589 /gettext.py
parent611b6cd260204f683badfa48fb2cf8dbf893d903 (diff)
downloadanaconda-16418b06ece578a61845a451c1c2be0ead138151.tar.gz
anaconda-16418b06ece578a61845a451c1c2be0ead138151.tar.xz
anaconda-16418b06ece578a61845a451c1c2be0ead138151.zip
o dependent package selection - if games has conditional packages keyed on
kde, when kde is selected check to see if games is selected and if so select all the conditional packages in games. o pass LC_ALL from loader to anaconda o updated language table o fallback to two char LANG for translations o magically build kickstart lang dictionary o start of DHCP network insensitivity in GUI
Diffstat (limited to 'gettext.py')
-rw-r--r--gettext.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/gettext.py b/gettext.py
index d37e580aa..dcef90349 100644
--- a/gettext.py
+++ b/gettext.py
@@ -42,14 +42,38 @@ import os, string
prefix = '/usr/local'
localedir = prefix + '/share/locale'
+def _expandLang(str):
+ langs = [str]
+ # remove charset ...
+ if '.' in str:
+ langs.append(string.split(str, '.')[0])
+ # also add 2 character language code ...
+ if len(str) > 2:
+ langs.append(str[:2])
+ return langs
+
lang = []
for env in 'LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG':
if os.environ.has_key(env):
lang = string.split(os.environ[env], ':')
+ lang = map(_expandLang, lang)
+ lang = reduce(lambda a, b: a + b, lang)
break
if 'C' not in lang:
lang.append('C')
+# remove duplicates
+i = 0
+while i < len(lang):
+ j = i + 1
+ while j < len(lang):
+ if lang[i] == lang[j]:
+ del lang[j]
+ else:
+ j = j + 1
+ i = i + 1
+del i, j
+
if os.environ.has_key('PY_XGETTEXT'):
xgettext = os.environ['PY_XGETTEXT']
else:
@@ -302,5 +326,3 @@ def setlangs(newlang):
if __name__ == '__main__':
test()
-
-