From: Christopher Lenz Date: Wed, 20 Jun 2007 20:18:52 +0000 (+0000) Subject: The `LANGUAGE` environment variable may contain a colon-separated list of language... X-Git-Tag: 1.0~487 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6178a67180b0dde5b0ce326f9807668eb9d30c0;p=thirdparty%2Fbabel.git The `LANGUAGE` environment variable may contain a colon-separated list of language codes. --- diff --git a/babel/core.py b/babel/core.py index fcfa0d49..dcf16713 100644 --- a/babel/core.py +++ b/babel/core.py @@ -539,6 +539,10 @@ def default_locale(category=None): 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='_'):