From 87388b64efe7cec23a17f8a32e82973e18d76037 Mon Sep 17 00:00:00 2001 From: Clinton Blackburn Date: Fri, 4 Sep 2015 22:04:03 -0400 Subject: [PATCH] Using domain argument for extraction Use the domain argument on makemessages to determine which files to parse for translation. By default the django domain will pull data for all *.py, *.html and *.txt files. The djangojs domain will pull data for all *.js files. Fixes #23 --- .gitignore | 3 ++- i18n/extract.py | 8 ++++---- setup.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index b0d2f85..cbaf276 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,5 @@ dist/ *.egg-info *.mo *.prob -*.dup \ No newline at end of file +*.dup +.idea/ diff --git a/i18n/extract.py b/i18n/extract.py index 43880a5..5a05d38 100755 --- a/i18n/extract.py +++ b/i18n/extract.py @@ -103,12 +103,12 @@ def run(self, args): if ignores: makemessages += " " + ignores - # Extract strings from django source files, including .py files. - make_django_cmd = makemessages + ' --extension html' + # Extract strings from django source files (*.py, *.html, *.txt). + make_django_cmd = makemessages + ' -d django' execute(make_django_cmd, working_directory=config.BASE_DIR, stderr=stderr) - # Extract strings from Javascript source files. - make_djangojs_cmd = makemessages + ' -d djangojs --extension js' + # Extract strings from Javascript source files (*.js). + make_djangojs_cmd = makemessages + ' -d djangojs' execute(make_djangojs_cmd, working_directory=config.BASE_DIR, stderr=stderr) # makemessages creates 'django.po'. This filename is hardcoded. diff --git a/setup.py b/setup.py index ad762c4..e76adb7 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='i18n_tools', - version='0.1.3', + version='0.1.4', description='edX i18n tools', packages=[ 'i18n',