-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
148 changed files
with
29,671 additions
and
2,954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ below by module. | |
:maxdepth: 2 | ||
|
||
portal | ||
portal_config | ||
portal_models | ||
portal_views |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ Contents: | |
user_experience | ||
sessions | ||
development | ||
internationalization | ||
code | ||
docker | ||
contributing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Internationalization | ||
******************** | ||
|
||
.. contents:: | ||
:depth: 3 | ||
:local: | ||
|
||
Indicating Translatable Strings | ||
=============================== | ||
We use gettext for this within python files; we also use `Liferay to manage content in different languages <http://tiny.cc/truenth_liferay#heading=h.ei0lyxrk4ix0>`_. | ||
|
||
Surround all strings with ``_( )`` and it will automatically attempt to find a translation, like: | ||
|
||
| _('CELLPHONE') | ||
This should automatically be available in any template file. | ||
|
||
.. note:: | ||
|
||
we are moving to a model where en_US is used as the key here, with no | ||
need to use an english .po file.* | ||
|
||
For adding new translations, you need to add the blank translation to the .pot file: | ||
|
||
| # <optional comment pointing to where in the code the translation is used> | ||
| msgid "Cellphone" | ||
| msgstr "" | ||
Updating Translation Files | ||
========================== | ||
GNU Gettext translation files consist of a single Portable Object Template file (POT file) and Portable Object (PO file) for each localization (language). | ||
|
||
Updating POT files | ||
------------------ | ||
To update the .pot file with all source strings from the apptext/interventions tables run the following command:: | ||
|
||
$ FLASK_APP=manage.py flask translations | ||
|
||
Updating PO files | ||
----------------- | ||
To update the PO files with the latest translations from Smartling, run the following command:: | ||
|
||
$ FLASK_APP=manage.py flask translation_download | ||
|
||
Initializing Translation Files | ||
============================== | ||
You can create a new .pot file with all extracted translations from the code by running the following pybabel command:: | ||
|
||
$ pybabel extract -F instance/babel.cfg -o portal/translations/messages.pot portal/ | ||
|
||
External Documentation | ||
====================== | ||
`jinja i18n-extension <http://jinja.pocoo.org/docs/dev/extensions/#i18n-extension>`_ | ||
|
||
`gettext <https://docs.python.org/dev/library/gettext.html>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Portal.Config | ||
============= | ||
.. automodule:: portal.config.config | ||
:members: | ||
|
||
.. automodule:: portal.config.site_persistence | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.