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

Update translations with collect_translations script #37

Merged
merged 2 commits into from
Apr 8, 2024
Merged
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,21 @@ isort configuration is stored in our [tox.ini](tox.ini) which isort automaticall
We lint using [autoflake](https://pypi.org/project/autoflake/) to flag and remove any unused import statement. If an
unused import is needed for some reason it can be ignored with a `#noqa` comment in the code.

## Internationalization (i18n, l10n, flask-pybabel, managing translations)

When adding new translations (with `gettext()` or alias `_()`), make sure to
update the translation files with:

```bash
bin/util/collect_translations
```

Here's what the script does:

1) Collects and generates translations from source files with a custom script.
2) Creates new translation templates (`*.pot`) with `pybabel extract`
3) Updates existing translation files (`*.po`) with `pybabel update`

## Continuous Integration

This project runs all the unit tests through Github Actions for new pull requests and when merging into the default
Expand Down
3 changes: 2 additions & 1 deletion translations/en/LC_MESSAGES/circulation-admin.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-03-05 22:39+0200\n"
"POT-Creation-Date: 2024-04-08 08:44+0300\n"
"PO-Revision-Date: 2024-02-19 22:15+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
Expand Down Expand Up @@ -668,3 +668,4 @@ msgstr ""
#, python-format
msgid "%(field)s cannot be greater than %(max)s."
msgstr ""

31 changes: 16 additions & 15 deletions translations/en/LC_MESSAGES/circulation.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-03-05 22:39+0200\n"
"POT-Creation-Date: 2024-04-08 08:44+0300\n"
"PO-Revision-Date: 2024-02-19 22:15+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
Expand Down Expand Up @@ -88,23 +88,23 @@ msgstr ""
msgid "Titles with no available loans will not be displayed in the Catalog view."
msgstr ""

#: api/circulation.py:507
#: api/circulation.py:508
msgid "Ebook Loan Duration (in Days)"
msgstr ""

#: api/circulation.py:509
#: api/circulation.py:510
msgid ""
"When a patron uses SimplyE to borrow an ebook from this collection, "
"SimplyE will ask for a loan that lasts this number of days. This must be "
"equal to or less than the maximum loan duration negotiated with the "
"distributor."
msgstr ""

#: api/circulation.py:522
#: api/circulation.py:523
msgid "Default Loan Period (in Days)"
msgstr ""

#: api/circulation.py:524
#: api/circulation.py:525
msgid ""
"Until it hears otherwise from the distributor, this server will assume "
"that any given loan for this library from this collection will last this "
Expand All @@ -113,22 +113,22 @@ msgid ""
"affect the actual length of loans."
msgstr ""

#: api/circulation.py:554
#: api/circulation.py:555
#, python-format
msgid ""
"Could not map delivery mechanism %(mechanism_name)s to internal delivery "
"mechanism!"
msgstr ""

#: api/circulation.py:1066
#: api/circulation.py:1068
msgid "You cannot renew a loan if other patrons have the work on hold."
msgstr ""

#: api/circulation.py:1338
#: api/circulation.py:1340
msgid "Cannot find your active loan for this work."
msgstr ""

#: api/circulation.py:1345
#: api/circulation.py:1347
#, python-format
msgid ""
"You already fulfilled this loan as %(loan_delivery_mechanism)s, you can't"
Expand All @@ -140,11 +140,11 @@ msgstr ""
msgid "Integration error communicating with %(service_name)s"
msgstr ""

#: api/circulation_manager.py:157
#: api/circulation_manager.py:158
msgid "Lane does not exist"
msgstr ""

#: api/circulation_manager.py:375
#: api/circulation_manager.py:378
msgid "All Books"
msgstr ""

Expand Down Expand Up @@ -239,19 +239,19 @@ msgstr ""
msgid "Send patrons to the lane with this ID."
msgstr ""

#: api/ekirjasto_authentication.py:65
#: api/ekirjasto_authentication.py:69
msgid "E-kirjasto API environment"
msgstr ""

#: api/ekirjasto_authentication.py:66
#: api/ekirjasto_authentication.py:70
msgid "Select what environment of E-kirjasto accounts should be used."
msgstr ""

#: api/ekirjasto_authentication.py:83
#: api/ekirjasto_authentication.py:87
msgid "Delegate token expire time in seconds"
msgstr ""

#: api/ekirjasto_authentication.py:84
#: api/ekirjasto_authentication.py:88
msgid ""
"Expire time for a delegate token to authorize in behalf of a ekirjasto "
"token. This should be less than the expire time for ekirjasto token, so "
Expand Down Expand Up @@ -889,3 +889,4 @@ msgstr ""

#~ msgid "API key"
#~ msgstr ""

9 changes: 5 additions & 4 deletions translations/en/LC_MESSAGES/core.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-03-05 22:39+0200\n"
"POT-Creation-Date: 2024-04-08 08:44+0300\n"
"PO-Revision-Date: 2024-02-19 22:14+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
Expand Down Expand Up @@ -114,15 +114,15 @@ msgid ""
"related errors."
msgstr ""

#: core/entrypoint.py:103 core/facets.py:116 core/facets.py:120
#: core/entrypoint.py:107 core/facets.py:116 core/facets.py:120
msgid "All"
msgstr ""

#: core/entrypoint.py:140
#: core/entrypoint.py:144
msgid "eBooks"
msgstr ""

#: core/entrypoint.py:149
#: core/entrypoint.py:153
msgid "Audiobooks"
msgstr ""

Expand Down Expand Up @@ -1087,3 +1087,4 @@ msgstr ""

#~ msgid "Self tests will use this value as the search term."
#~ msgstr ""

3 changes: 2 additions & 1 deletion translations/es/LC_MESSAGES/circulation-admin.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-03-05 22:39+0200\n"
"POT-Creation-Date: 2024-04-08 08:44+0300\n"
"PO-Revision-Date: 2016-06-14 13:23-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: es\n"
Expand Down Expand Up @@ -685,3 +685,4 @@ msgstr ""

#~ msgid "Error: %(error)s"
#~ msgstr "Error: %(error)s"

31 changes: 16 additions & 15 deletions translations/es/LC_MESSAGES/circulation.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-03-05 22:39+0200\n"
"POT-Creation-Date: 2024-04-08 08:44+0300\n"
"PO-Revision-Date: 2016-06-14 13:24-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: es\n"
Expand Down Expand Up @@ -85,23 +85,23 @@ msgstr ""
msgid "Titles with no available loans will not be displayed in the Catalog view."
msgstr ""

#: api/circulation.py:507
#: api/circulation.py:508
msgid "Ebook Loan Duration (in Days)"
msgstr ""

#: api/circulation.py:509
#: api/circulation.py:510
msgid ""
"When a patron uses SimplyE to borrow an ebook from this collection, "
"SimplyE will ask for a loan that lasts this number of days. This must be "
"equal to or less than the maximum loan duration negotiated with the "
"distributor."
msgstr ""

#: api/circulation.py:522
#: api/circulation.py:523
msgid "Default Loan Period (in Days)"
msgstr ""

#: api/circulation.py:524
#: api/circulation.py:525
msgid ""
"Until it hears otherwise from the distributor, this server will assume "
"that any given loan for this library from this collection will last this "
Expand All @@ -110,7 +110,7 @@ msgid ""
"affect the actual length of loans."
msgstr ""

#: api/circulation.py:554
#: api/circulation.py:555
#, fuzzy, python-format
msgid ""
"Could not map delivery mechanism %(mechanism_name)s to internal delivery "
Expand All @@ -119,17 +119,17 @@ msgstr ""
"No se pudo asignar el mecanismo simplificado de entrega "
"%(mechanism_name)s al mecanismo de distribución interna!"

#: api/circulation.py:1066
#: api/circulation.py:1068
msgid "You cannot renew a loan if other patrons have the work on hold."
msgstr ""
"No se puede renovar un préstamo si otros usuarios tienen el trabajo en "
"espera."

#: api/circulation.py:1338
#: api/circulation.py:1340
msgid "Cannot find your active loan for this work."
msgstr "No puede encontrar su préstamo activo para este trabajo."

#: api/circulation.py:1345
#: api/circulation.py:1347
#, python-format
msgid ""
"You already fulfilled this loan as %(loan_delivery_mechanism)s, you can't"
Expand All @@ -143,11 +143,11 @@ msgstr ""
msgid "Integration error communicating with %(service_name)s"
msgstr "Error de integración en la comunicación con %(service_name)s"

#: api/circulation_manager.py:157
#: api/circulation_manager.py:158
msgid "Lane does not exist"
msgstr ""

#: api/circulation_manager.py:375
#: api/circulation_manager.py:378
msgid "All Books"
msgstr ""

Expand Down Expand Up @@ -242,19 +242,19 @@ msgstr ""
msgid "Send patrons to the lane with this ID."
msgstr ""

#: api/ekirjasto_authentication.py:65
#: api/ekirjasto_authentication.py:69
msgid "E-kirjasto API environment"
msgstr ""

#: api/ekirjasto_authentication.py:66
#: api/ekirjasto_authentication.py:70
msgid "Select what environment of E-kirjasto accounts should be used."
msgstr ""

#: api/ekirjasto_authentication.py:83
#: api/ekirjasto_authentication.py:87
msgid "Delegate token expire time in seconds"
msgstr ""

#: api/ekirjasto_authentication.py:84
#: api/ekirjasto_authentication.py:88
msgid ""
"Expire time for a delegate token to authorize in behalf of a ekirjasto "
"token. This should be less than the expire time for ekirjasto token, so "
Expand Down Expand Up @@ -1020,3 +1020,4 @@ msgstr ""

#~ msgid "API key"
#~ msgstr ""

9 changes: 5 additions & 4 deletions translations/es/LC_MESSAGES/core.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-03-05 22:39+0200\n"
"POT-Creation-Date: 2024-04-08 08:44+0300\n"
"PO-Revision-Date: 2016-06-14 13:24-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: es\n"
Expand Down Expand Up @@ -110,15 +110,15 @@ msgid ""
"related errors."
msgstr ""

#: core/entrypoint.py:103 core/facets.py:116 core/facets.py:120
#: core/entrypoint.py:107 core/facets.py:116 core/facets.py:120
msgid "All"
msgstr ""

#: core/entrypoint.py:140
#: core/entrypoint.py:144
msgid "eBooks"
msgstr ""

#: core/entrypoint.py:149
#: core/entrypoint.py:153
msgid "Audiobooks"
msgstr ""

Expand Down Expand Up @@ -1107,3 +1107,4 @@ msgstr "El servidor hizo una petición al servicio (%) s, y esa solicitud expir

#~ msgid "Self tests will use this value as the search term."
#~ msgstr ""

Loading