Skip to content

Commit

Permalink
Add localization documentation
Browse files Browse the repository at this point in the history
A bit of info about working with the translations.
  • Loading branch information
dbnicholson committed Oct 31, 2024
1 parent fde1348 commit f805d5b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions addons/block_code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,43 @@ Lean into animations! Godot's animations functionality goes beyond just simple a

Please share feedback in the [Godot Forum Block Coding thread](https://forum.godotengine.org/t/block-coding-high-level-block-based-visual-programming/68941).

## Localization

The plugin supports translations through Godot's [gettext][godot-gettext]
support. We welcome contributions to make the plugin work better in your
language! However, please note that translations in the Godot editor **will
only work with Godot 4.4 or newer**.

The gettext PO files are located in the `addons/block_code/locale` directory.
See the Godot [documentation][godot-gettext] for instructions on working with
PO files.

[godot-gettext]: https://docs.godotengine.org/en/stable/tutorials/i18n/localization_using_gettext.html

For developers, a few things need to be done to keep the translatable strings
up to date.

* If files are added or removed, the list of translatable files needs to be
updated. This can be done by using the **Add** dialog in the [POT
Generation][pot-generation] tab. Or you can use the **Project → Tools →
Update BlockCode translated files** menu item in the editor.

* If translatable strings have changed, the POT file needs to be updated. This
can be done by using the **Generate POT** dialog in the [POT
Generation][pot-generation] tab. Or you can use the **Project → Tools →
Regenerate BlockCode POT file** menu item in the editor.

* If the POT file has changed, the PO message files need to be updated. This
can be done using the gettext `msgmerge` tool in the
`addons/block_code/locale` directory:
```
for po in *.po; do
msgmerge --update --backup=none "$po" godot_block_coding.pot
done
```

[pot-generation]: https://docs.godotengine.org/en/stable/tutorials/i18n/localization_using_gettext.html#automatic-generation-using-the-editor

## Development

### pre-commit
Expand Down

0 comments on commit f805d5b

Please sign in to comment.