summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-05-19 09:26:31 +0200
committerClaude Paroz <claude@2xlibre.net>2014-05-19 09:30:26 +0200
commit7999ed9b69b8f1a0aed035d56d9102ef7881643f (patch)
tree8bbc7a0f117f9fa830efa3119eccc586166f0b2f
parent813ded775d2491bc12b55b8dbbb4a2e591e9dd15 (diff)
Updated Django makemessages process
makemessages should now automatically distribute translatable strings in the proper locale files, for Django too (see 50a8ab7cd1e6).
-rw-r--r--django/core/management/commands/makemessages.py2
-rw-r--r--scripts/manage_translations.py14
2 files changed, 5 insertions, 11 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 570e94c2a2..d7d4db2b81 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -260,8 +260,6 @@ class Command(NoArgsCommand):
self.locale_paths = [os.path.abspath(os.path.join('conf', 'locale'))]
self.default_locale_path = self.locale_paths[0]
self.invoked_for_django = True
- # Ignoring all contrib apps
- self.ignore_patterns += ['contrib/*']
else:
self.locale_paths.extend(list(settings.LOCALE_PATHS))
# Allow to run makemessages inside an app dir
diff --git a/scripts/manage_translations.py b/scripts/manage_translations.py
index e126a5c8bc..d578a88ea9 100644
--- a/scripts/manage_translations.py
+++ b/scripts/manage_translations.py
@@ -84,21 +84,17 @@ def update_catalogs(resources=None, languages=None):
Update the en/LC_MESSAGES/django.po (main and contrib) files with
new/updated translatable strings.
"""
- contrib_dirs = _get_locale_dirs(resources, include_core=False)
+ if resources is not None:
+ print("`update_catalogs` will always process all resources.")
+ contrib_dirs = _get_locale_dirs(None, include_core=False)
os.chdir(os.path.join(os.getcwd(), 'django'))
- print("Updating main en catalog")
+ print("Updating en catalogs for Django and contrib apps...")
call_command('makemessages', locale=['en'])
_check_diff('core', os.path.join(os.getcwd(), 'conf', 'locale'))
- # Contrib catalogs
+ # Stats for contrib catalogs
for name, dir_ in contrib_dirs:
- os.chdir(os.path.join(dir_, '..'))
- print("Updating en catalog in %s" % dir_)
- if name.endswith('-js'):
- call_command('makemessages', locale=['en'], domain='djangojs')
- else:
- call_command('makemessages', locale=['en'])
_check_diff(name, dir_)