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

Merged
merged 23 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
12bfde7
avoid using variable keys with i18n
emlys Mar 25, 2024
9dff0e6
avoid translation template variables where possible
emlys Mar 25, 2024
0223b0d
add new messages into es translation files
emlys Mar 25, 2024
218cbc9
extract message catalog template and update es catalog from it
emlys Mar 25, 2024
8c545b2
extract message catalog template and update zh catalog from it
emlys Mar 25, 2024
58d33f0
add new messages into zh translation files
emlys Mar 25, 2024
59ecd73
minor updates to invest translation readme
emlys Mar 25, 2024
f9a3fd5
extract message catalog template and update zh catalog from it
emlys Mar 26, 2024
1f78fef
minor updates to workbench translation docs
emlys Mar 26, 2024
7d70242
translations for data download test
emlys Mar 26, 2024
bf38e77
add new messages into es translation files
emlys Mar 26, 2024
305de2c
add new messages into zh translation files
emlys Mar 26, 2024
e53094d
update ES message catalog with new translations
emlys Apr 29, 2024
8f8c9a6
add new workbench translations for ES
emlys Apr 29, 2024
276c74c
add no-python-format flag to gettext strings with percents
emlys Apr 29, 2024
7632025
Merge branch 'main' into translations-update
emlys Oct 2, 2024
82b3d43
add new translations for zh
emlys Oct 2, 2024
99c00be
update to UG revision with new translations; add history note
emlys Nov 21, 2024
f3bf6ba
Merge branch 'main' into translations-update
emlys Nov 21, 2024
f80212f
add pyyaml requirement to docs requirements for ug
emlys Nov 21, 2024
642516d
Merge branch 'translations-update' of https://github.com/emlys/invest…
emlys Nov 21, 2024
71c245f
correct numbering of steps in workbench readme
emlys Nov 22, 2024
710e19c
Merge branch 'main' into translations-update
emlys Nov 22, 2024
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
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Unreleased Changes
reflect changes in how InVEST is installed on modern systems, and also to
include images of the InVEST workbench instead of just broken links.
https://github.com/natcap/invest/issues/1660
* Updated translations for Spanish and Chinese
* natcap.invest now works with (and requires) ``gdal.UseExceptions``. A
``FutureWarning`` is raised on import if GDAL exceptions are not enabled.
* Workbench
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT_TEST_DATA_REPO_REV := 324abde73e1d770ad75921466ecafd1ec6297752

GIT_UG_REPO := https://github.com/natcap/invest.users-guide
GIT_UG_REPO_PATH := doc/users-guide
GIT_UG_REPO_REV := f203ec069f9f03560c9a85b268e67ebb6b994953
GIT_UG_REPO_REV := 5ee3616d4549baf3b1e44e0fcef485145389e29a

ENV = "./env"
ifeq ($(OS),Windows_NT)
Expand Down
1 change: 1 addition & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Sphinx>=1.3.1,!=1.7.1
sphinx-rtd-theme
sphinx-intl
sphinx-reredirects
pyyaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What relies on the pyyaml dependency?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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