309 | | langfile = gettext_module.find('django', globalpath, [to_locale(lang)]) |
310 | | if langfile: |
311 | | # reconstruct the actual language from the language |
312 | | # filename, because otherwise we might incorrectly |
313 | | # report de_DE if we only have de available, but |
314 | | # did find de_DE because of language normalization |
315 | | lang = langfile[len(globalpath):].split(os.path.sep)[1] |
316 | | _accepted[accept] = lang |
317 | | return lang |
| 315 | is_supported = False |
| 316 | for l in settings.LANGUAGES: |
| 317 | if lang == l[0]: |
| 318 | is_supported = True |
| 319 | if is_supported: |
| 320 | langfile = gettext_module.find('django', globalpath, [to_locale(lang)]) |
| 321 | if langfile: |
| 322 | # reconstruct the actual language from the language |
| 323 | # filename, because otherwise we might incorrectly |
| 324 | # report de_DE if we only have de available, but |
| 325 | # did find de_DE because of language normalization |
| 326 | lang = langfile[len(globalpath):].split(os.path.sep)[1] |
| 327 | _accepted[accept] = lang |
| 328 | return lang |