diff --git a/CHANGELOG.md b/CHANGELOG.md index 78b53f8457..c6fbcdb209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ This upgrade requires running `evennia migrate` on your existing database - [Feat][pull3633]: Default object's default descs are now taken from a `default_description` class variable instead of the `desc` Attribute always being set (count-infinity) - [Feat][pull3718]: Remove twistd.bat creation for Windows, should not be needed anymore (0xDEADFED5) +- [Feat][pull3756]: Updated German translation (JohnFi) +- [Feat][pull3757]: Add more i18n strings to `DefaultObject` for easier translation (JohnFi) - [Fix][pull3677]: Make sure that `DefaultAccount.create` normalizes to empty strings instead of `None` if no name is provided, also enforce string type (InspectorCaracal) - [Fix][pull3682]: Allow in-game help searching for commands natively starting @@ -51,7 +53,7 @@ This upgrade requires running `evennia migrate` on your existing database it caused an OnDemandHandler save error on reload. Will now clean up on save. (Griatch) used as the task's category (Griatch) - Fix: Correct aws contrib's use of legacy django string utils (Griatch) -- [Docs]: Fixes from InspectorCaracal, Griatch, ChrisLR +- [Docs]: Fixes from InspectorCaracal, Griatch, ChrisLR, JohnFi [pull3633]: https://github.com/evennia/evennia/pull/3633 [pull3677]: https://github.com/evennia/evennia/pull/3677 @@ -77,6 +79,8 @@ This upgrade requires running `evennia migrate` on your existing database [pull3765]: https://github.com/evennia/evennia/pull/3765 [pull3753]: https://github.com/evennia/evennia/pull/3753 [pull3751]: https://github.com/evennia/evennia/pull/3751 +[pull3756]: https://github.com/evennia/evennia/pull/3756 +[pull3757]: https://github.com/evennia/evennia/pull/3757 [issue3688]: https://github.com/evennia/evennia/issues/3688 [issue3687]: https://github.com/evennia/evennia/issues/3687 diff --git a/docs/source/Concepts/Internationalization.md b/docs/source/Concepts/Internationalization.md index a57acc8803..0850770651 100644 --- a/docs/source/Concepts/Internationalization.md +++ b/docs/source/Concepts/Internationalization.md @@ -173,7 +173,7 @@ string = _("Text to translate") ### Formatting Considerations -When using formatted strings, ensure that you pass the "raw" string to `gettext` for translation first and then format the output. Otherwise, placeholders will be replaced before translation occurs, preventing the correct string from being found in the `.po` file. +When using formatted strings, ensure that you pass the "raw" string to `gettext` for translation first and then format the output. Otherwise, placeholders will be replaced before translation occurs, preventing the correct string from being found in the `.po` file. It's also recommended to use named placeholders (e.g., `{char}`) instead of positional ones (e.g., `{}`) for better readability and maintainability. ```python # incorrect: @@ -189,9 +189,3 @@ This is also why f-strings don't work with `gettext`: # will not work string = _(f"Hello {char}!") ``` - -However, you can use %-formatting. It’s recommended to use named placeholders because the order of placeholders may vary in different translations. - -```python -_("Today is %(month)s %(day)s.") % {"month": m, "day": d} -```