@@ -130,9 +130,10 @@ install themselves in the built-in namespace as the function :func:`!_`.
130130 strings, where each string is a language code.
131131
132132 If *localedir * is not given, then the default system locale directory is used.
133- [# ]_ If *languages * is not given, then the following environment variables are
134- searched: :envvar: `LANGUAGE `, :envvar: `LC_ALL `, :envvar: `LC_MESSAGES `, and
135- :envvar: `LANG `. The first one returning a non-empty value is used for the
133+ [# ]_ If *languages * is not given, then the environment variable :envvar: `LANGUAGE `
134+ is searched, it falls back to :func: `locale.getlocale `, which in turn falls
135+ back to the environment variables :envvar: `LC_ALL `, :envvar: `LC_MESSAGES `, and
136+ :envvar: `LANG ` where the first one returning a non-empty value is used for the
136137 *languages * variable. The environment variables should contain a colon separated
137138 list of languages, which will be split on the colon to produce the expected list
138139 of language code strings.
@@ -147,6 +148,9 @@ install themselves in the built-in namespace as the function :func:`!_`.
147148 of all file names, in the order in which they appear in the languages list or
148149 the environment variables.
149150
151+ .. versionchanged :: next
152+ :func: `locale.getlocale ` is used to generate *languages * if *languages * is
153+ not provided.
150154
151155.. function :: translation(domain, localedir=None, languages=None, class_=None, fallback=False)
152156
0 commit comments