-
Notifications
You must be signed in to change notification settings - Fork 47
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
34 changed files
with
1,074 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
*************************** | ||
Tethys Platform Translation | ||
*************************** | ||
|
||
Tethys uses the `Django Translation <https://docs.djangoproject.com/en/2.2/topics/i18n/translation/>`_ to provide translation support. | ||
|
||
Follow the steps below to add a new translation: | ||
================================================ | ||
|
||
1. Add the new language code to tethys_portal/settings.py | ||
--------------------------------------------------------- | ||
|
||
:: | ||
|
||
... | ||
|
||
LANGUAGES = [ | ||
('en', _('English')), | ||
('es', _('Spanish')), | ||
] | ||
|
||
... | ||
|
||
Language codes can be found `here <https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-LANGUAGE_CODE>`_. | ||
|
||
2. Go to tethys home and run the following commands: | ||
---------------------------------------------------- | ||
|
||
:: | ||
|
||
$ conda activate tethys | ||
$ python tethys_portal/manage.py makemessages -l <LANGUAGE_CODE> | ||
|
||
A .po file with the new language will be created at <TETHYS_HOME>/tethys_locale. | ||
|
||
3. Navigate to the .po file and populate the file with translations. | ||
-------------------------------------------------------------------- | ||
|
||
``#:/path/to/file:line`` shows the location of the text, ``msgid`` is the original text, ``msgstr`` is where the translation for that text should go. | ||
|
||
:: | ||
|
||
... | ||
|
||
#: tethys_portal/templates/admin/base.html:69 | ||
msgid "Home" | ||
msgstr "Inicio" | ||
|
||
... | ||
|
||
.. note:: | ||
|
||
Translation block with a ``fuzzy`` key, require revision. Remove the ``fuzzy`` key after confirming it looks the way it should (e.g. not a duplicate). | ||
|
||
4. Compile the .mo file: | ||
------------------------ | ||
|
||
:: | ||
|
||
$ conda activate tethys | ||
$ python tethys_portal/manage.py complilemessages |
Binary file not shown.
Oops, something went wrong.