i18n: Add English locale to language list if missing.

The English locale data is only present if the user has run `manage.py
makemigrations` on the system.
This commit is contained in:
Umair Khan
2016-07-05 12:25:23 +05:00
committed by Tim Abbott
parent 84dac8950f
commit 47fb293f8a

View File

@@ -25,7 +25,11 @@ class Command(compilemessages.Command):
data = {'languages': []} # type: Dict[str, List[Dict[str, str]]]
lang_name_re = re.compile('"Language-Team: (.*?) \(')
for locale in os.listdir(locale_path):
locales = os.listdir(locale_path)
locales.append('en')
locales = list(set(locales))
for locale in locales:
info = {}
if locale == 'en':
data['languages'].append({'code': 'en', 'name': 'English'})