Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations update #1545

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/natcap/invest/internationalization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ When we are ready to get a new batch of translations, here is the process. These
pybabel extract \
--no-wrap \
--project InVEST \
--msgid-bugs-address [email protected] \
--version $(python -m setuptools_scm) \
--msgid-bugs-address [email protected] \
--copyright-holder "Natural Capital Project" \
--output src/natcap/invest/internationalization/messages.pot \
src/
Expand All @@ -38,14 +39,14 @@ pybabel update \
--input-file src/natcap/invest/internationalization/messages.pot \
--output-file src/natcap/invest/internationalization/locales/$LL/LC_MESSAGES/messages.po
```
This looks through the source code for strings wrapped in the `gettext(...)` function and writes them to the message catalog template. Then it updates the message catalog for the specificed language. New strings that don't yet have a translation will have an empty `msgstr` value. Previously translated messages that are no longer needed will be commented out but remain in the file. This will save translator time if they're needed again in the future.

2. Check that the changes look correct, then commit:
```
git diff
git add src/natcap/invest/internationalization/messages.pot src/natcap/invest/internationalization/locales/$LL/LC_MESSAGES/messages.po
git commit -m "extract message catalog template and update $LL catalog from it"
```
This looks through the source code for strings wrapped in the `gettext(...)` function and writes them to the message catalog template. Then it updates the message catalog for the specificed language. New strings that don't yet have a translation will have an empty `msgstr` value. Previously translated messages that are no longer needed will be commented out but remain in the file. This will save translator time if they're needed again in the future.

3. Send `src/natcap/invest/internationalization/locales/$LL/LC_MESSAGES/messages.po` to the translator and wait to get it back. The translator will fill in the `msgstr` values for any new or edited messages.

Expand Down
Loading
Loading