# HG changeset patch # User cmlenz # Date 1182370732 0 # Node ID 1662e1a4fc7b5fea22102be4e329fe2d78da8700 # Parent 557d183d3160e0a262ce87766f5aa06747b3cf11 The `LANGUAGE` environment variable may contain a colon-separated list of language codes. diff --git a/babel/core.py b/babel/core.py --- 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='_'):