Skip to content

Commit

Permalink
Using domain argument for extraction
Browse files Browse the repository at this point in the history
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
  • Loading branch information
clintonb committed Sep 5, 2015
1 parent e7ca704 commit 87388b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ dist/
*.egg-info
*.mo
*.prob
*.dup
*.dup
.idea/
8 changes: 4 additions & 4 deletions i18n/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='i18n_tools',
version='0.1.3',
version='0.1.4',
description='edX i18n tools',
packages=[
'i18n',
Expand Down

0 comments on commit 87388b6

Please sign in to comment.