summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/manage_translations.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/manage_translations.py b/scripts/manage_translations.py
index d578a88ea9..9bc7c571d9 100644
--- a/scripts/manage_translations.py
+++ b/scripts/manage_translations.py
@@ -72,10 +72,10 @@ def _check_diff(cat_name, base_path):
"""
po_path = '%(path)s/en/LC_MESSAGES/django%(ext)s.po' % {
'path': base_path, 'ext': 'js' if cat_name.endswith('-js') else ''}
- p = Popen("git diff -U0 %s | egrep -v '^@@|^[-+]#|^..POT-Creation' | wc -l" % po_path,
+ p = Popen("git diff -U0 %s | egrep '^[-+]msgid' | wc -l" % po_path,
stdout=PIPE, stderr=PIPE, shell=True)
output, errors = p.communicate()
- num_changes = int(output.strip()) - 4
+ num_changes = int(output.strip())
print("%d changed/added messages in '%s' catalog." % (num_changes, cat_name))
@@ -91,9 +91,11 @@ def update_catalogs(resources=None, languages=None):
os.chdir(os.path.join(os.getcwd(), 'django'))
print("Updating en catalogs for Django and contrib apps...")
call_command('makemessages', locale=['en'])
- _check_diff('core', os.path.join(os.getcwd(), 'conf', 'locale'))
+ print("Updating en JS catalogs for Django and contrib apps...")
+ call_command('makemessages', locale=['en'], domain='djangojs')
- # Stats for contrib catalogs
+ # Output changed stats
+ _check_diff('core', os.path.join(os.getcwd(), 'conf', 'locale'))
for name, dir_ in contrib_dirs:
_check_diff(name, dir_)