Skip to content

Update message catalogs for next round of translations - #2639

Open
emilyanndavis wants to merge 7 commits into
natcap:feature/reports-localizationfrom
emilyanndavis:feature/1951-translation-update-2026-july
Open

Update message catalogs for next round of translations#2639
emilyanndavis wants to merge 7 commits into
natcap:feature/reports-localizationfrom
emilyanndavis:feature/1951-translation-update-2026-july

Conversation

@emilyanndavis

Copy link
Copy Markdown
Member

Description

Update message catalogs in preparation for the next (upcoming) round of translations. Specifically:

  • Resolve lingering "fuzzy"/"needs work" messages in Spanish-language catalog.
  • Fix typos in source of a few English-language messages.
  • Extract messages from core InVEST code and use resulting updated (.pot) template to update es, zh (.po) catalogs.
  • Extract messages from Workbench code and add new messages to es, zh (.json) catalogs.

Checklist

- [ ] Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
- [ ] Updated the user's guide (if needed)
- [ ] Tested the Workbench UI (if relevant)

@emilyanndavis
emilyanndavis marked this pull request as draft July 10, 2026 20:37
@emilyanndavis
emilyanndavis marked this pull request as ready for review July 28, 2026 16:45
spec.Option(key="square"),
spec.Option(key="hexagon")
spec.Option(key="square", display_name=gettext("square")),
spec.Option(key="hexagon", display_name=gettext("hexagon"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should all display_names be wrapped in gettext? I see several models with Options that do not wrap the display_name, e.g., wave energy, HRA, UNA, CBC preprocessor. And other models where the options only have about text (not display_name) and that text isn't wrapped in gettext. Not sure how extensive this PR needs to be but wanted to mention it

Comment thread workbench/readme.md
8. If you are preparing translation files for multiple languages, repeat steps 2 through 7 for each remaining language.

```
9. Delete remaining temp files: `tmp.json` (if you generated a new one by following step 8), `main-messages.json`, and `renderer-messages.json`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
9. Delete remaining temp files: `tmp.json` (if you generated a new one by following step 8), `main-messages.json`, and `renderer-messages.json`.
9. Delete `main-messages.json` and `renderer-messages.json`.

Since deleting tmp.json is already referenced in step 7

pybabel update \
--locale $LL \
--input-file src/natcap/invest/internationalization/messages.pot \
--output-file src/natcap/invest/internationalization/locales/$LL/LC_MESSAGES/messages.po

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
--output-file src/natcap/invest/internationalization/locales/$LL/LC_MESSAGES/messages.po
--output-file src/natcap/invest/internationalization/locales/$LL/LC_MESSAGES/messages.po \

Human-readable message catalog file. Messages are added to this file from the PO template, and translations for the messages are added by the translator.
Human-readable message catalog file. Messages are added to this file from the PO template (`.pot` file), and translations for the messages are added by the translator.

Messages in `.po` files may be annotated with flags (comma-separated strings immediately preceding a `msgid`). Some flags are defined by the translation tooling and built into its automated processes; others may be custom, with special meaning and processes defined by a particular project or dev team.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be helpful to provide an example of this?

comma-separated strings immediately preceding a msgid

Comment thread workbench/readme.md
* Linux: "\~/.config/invest-workbench/logs/"
* Windows: `C:\Users\dmf\AppData\Roaming\invest-workbench\logs\`
* Mac: `\~/Library/Logs/invest-workbench/`
* Linux: `\~/.config/invest-workbench/logs/`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Linux: `\~/.config/invest-workbench/logs/`
* Linux: `~/.config/invest-workbench/logs/`

Comment thread workbench/readme.md
* Mac: "\~/Library/Logs/invest-workbench/"
* Linux: "\~/.config/invest-workbench/logs/"
* Windows: `C:\Users\dmf\AppData\Roaming\invest-workbench\logs\`
* Mac: `\~/Library/Logs/invest-workbench/`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Mac: `\~/Library/Logs/invest-workbench/`
* Mac: `~/Library/Logs/invest-workbench/`

Comment thread workbench/readme.md
InVEST models, and to be extensible to future models or InVEST-relevant auxiliary workflows.

## To develop and launch this app
1. From ``invest/``:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. From ``invest/``:
1. From `invest/`:


## Summary of files
None of the translations files (.pot, .po, .mo) should be manually edited by us.
None of the translation files (`.pot`, `.po`, `.mo`) should be manually edited by us.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a bit confusing to me, because later on the doc says "change python-format to no-python-format" and remove the incorrect python-format tags in the .po files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants