[PATCH] Adapt expandLangs to work with three character base lang names (#517770).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 language.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/language.py b/language.py
index bba6acc..5469c10 100644
--- a/language.py
+++ b/language.py
@@ -35,6 +35,8 @@ log = logging.getLogger("anaconda")
 def expandLangs(astring):
     langs = [astring]
     charset = None
+    base = None
+
     # remove charset ...
     if '.' in astring:
 	langs.append(string.split(astring, '.')[0])
@@ -42,10 +44,15 @@ def expandLangs(astring):
     if '@' in astring:
         charset = string.split(astring, '@')[1]
 
-    # also add 2 character language code ...
-    if len(astring) > 2:
-        if charset: langs.append("%s@%s" %(astring[:2], charset))
-	langs.append(astring[:2])
+    if '_' in astring:
+        base = string.split(astring, '_')[0]
+
+        if charset:
+            langs.append("%s@%s" % (base, charset))
+
+        langs.append(base)
+    else:
+        langs.append(astring[:2])
 
     return langs
 
-- 
1.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux