Mercurial > babel > old > mirror
changeset 150:1662e1a4fc7b
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 | 557d183d3160 |
children | 12e5f21dfcda |
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='_'):