Permalink
Browse files

Start translating Shoop to Finnish

Init locale dir. Include compiled .mo files, for now. Add to manifest.
Bump Babel to 2.0 due to 3.4 Python compatibility, see bug:
python-babel/babel#91
  • Loading branch information...
jaywink committed Aug 2, 2015
1 parent 4c4345f commit 73c7ccee368c9a121f1e9298c676615a99b4d806
View
@@ -4,7 +4,6 @@
*.js.map
*.log
*.manifest
*.mo
*.pot
*.py[cod]
*.so
@@ -39,3 +38,4 @@ sdist/
target/
var/
node_modules
locales.pot
View
@@ -8,7 +8,8 @@ include tox.ini
recursive-include shoop \
*.jinja *.txt *.js *.css *.json *.less \
*.ico *.png *.svg \
*.woff *.woff2 *.eot *.otf *.ttf
*.woff *.woff2 *.eot *.otf *.ttf \
*.po *.mo
recursive-include shoop_tests *.jinja
View
@@ -0,0 +1,6 @@
# Extraction from Python source files
[python: **.py]
# Extraction from Jinja2 templates
[jinja2: **.jinja]
extensions = jinja2.ext.with_
@@ -114,3 +114,35 @@ The DocCov script is included for calculating some documentation coverage metric
.. code-block:: shell
python _misc/doccov.py shoop/core -o doccov.html
Translations
------------
All translations are under ``shoop/core/locale``.
To add new translations for existing strings, just edit the relevant ``shoop/core/locale/<code>/LC_MESSAGES/django.po``
file.
If you add new translatable strings to the code, you will need to first extract the translation strings to be able
to edit them in other languages. For this, use the ``pybabel`` command as follows, executed from git root.
To extract strings, first generate a template:
.. code-block:: shell
pybabel extract -F babel.cfg -o locales.pot shoop/
Then update message files by executing this:
.. code-block:: shell
pybabel update -D django -d shoop/core/locale -i locales.pot
Then you can edit the changed ``.po`` files with new translations, or just commit the new message files so someone
else can translate them.
To make changes to translation files available to your local installation, compile the messages:
.. code-block:: shell
pybabel compile -D django -d shoop/core/locale
View
@@ -70,7 +70,7 @@
])
REQUIRES = [
'Babel==1.3',
'Babel==2.0',
'Django>=1.8,<1.9',
'django-bootstrap3==6.1.0',
'django-countries==3.3',
Binary file not shown.
Oops, something went wrong.

0 comments on commit 73c7cce

Please sign in to comment.