Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Fix and move db_strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmize committed Jan 7, 2015
1 parent cfe27d6 commit f29e001
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/internationalization.rst
Expand Up @@ -41,7 +41,7 @@ Python and HTML files are automatically handled by django's
into a text file be parsable by `makemessages` command. To extract the
database strings run::

./manage.py cron extract_database_strings
./manage.py runscript db_strings

.. note::

Expand Down
Empty file.
Empty file.
23 changes: 0 additions & 23 deletions masterfirefoxos/base/management/commands/db_strings.py

This file was deleted.

2 changes: 1 addition & 1 deletion masterfirefoxos/base/utils.py
Expand Up @@ -9,7 +9,7 @@
Translators:
Page Title: {title}
Parent Page Title: {parent_title}
{{% endcoment %}}
{{% endcomment %}}
{{% blocktrans trimmed %}}
{string}
{{% endblocktrans %}}
Expand Down
19 changes: 19 additions & 0 deletions scripts/db_strings.py
@@ -0,0 +1,19 @@
import os

from django.conf import settings

from masterfirefoxos.base.utils import pages_l10n_template


def run(*args):
if args:
filename = args[0]
else:
filename = os.path.join(settings.BASE_DIR, 'db-strings.txt')
print(filename)
template_text = pages_l10n_template()
if filename == '-':
self.stdout.write(template_text)
else:
with open(filename, 'w') as f:
f.write(template_text)

0 comments on commit f29e001

Please sign in to comment.