changeset 148:6bb1026756f2 trunk

The `LANGUAGE` environment variable may contain a colon-separated list of language codes.
author cmlenz
date Wed, 20 Jun 2007 20:18:52 +0000
parents 63a93d33511a
children d62c63280e81
files babel/core.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/babel/core.py
+++ b/babel/core.py
@@ -539,6 +539,10 @@
     for name in filter(None, varnames):
         locale = os.getenv(name)
         if locale:
+            if name == 'LANGUAGE' and ':' in locale:
+                # the LANGUAGE variable may contain a colon-separated list of
+                # language codes; we just pick the language on the list
+                locale = locale.split(':')[0]
             return '_'.join(filter(None, parse_locale(locale)))
 
 def negotiate_locale(preferred, available, sep='_'):
Copyright (C) 2012-2017 Edgewall Software