godot-demo-projects/gui/translation
Hugo Locurcio bac1e69164
Use static typing in all demos (#1063)
This leads to code that is easier to understand and runs
faster thanks to GDScript's typed instructions.

The untyped declaration warning is now enabled on all projects
where type hints were added. All projects currently run without
any untyped declration warnings.

Dodge the Creeps and Squash the Creeps demos intentionally don't
use type hints to match the documentation, where type hints haven't
been adopted yet (given its beginner focus).
2024-06-01 12:12:18 +02:00
..
audio Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
fonts Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00
images Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
screenshots Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
translations Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
README.md Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
icon.webp Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
icon.webp.import Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
project.godot Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00
translation_csv.gd Update GUI Translation demo for 4.0 (#930) 2024-04-11 20:55:49 -07:00
translation_demo_csv.tscn Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00
translation_demo_po.tscn Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00
translation_po.gd Use static typing in all demos (#1063) 2024-06-01 12:12:18 +02:00

README.md

GUI Translation Demo

This is a demo of how a project can be internationalized. Translations are created in a CSV file and then imported into Godot.

For correct display, the font used must contain the glyphs required by the target language. See the fonts folder for some fonts that you can use in your project. Godot can load system fonts as a fallback, but this is not supported on all platforms and the different visual design of system fonts can create inconsistencies.

Godot allows internationalized text to change automatically when the locale is modified. Resources can also be set to internationalized alternatives and replaced automatically on locale change. This process is known as remapping.

Both CSV and gettext (PO/POT) approaches are showcased. Use the button in the bottom-right corner to switch between the two approaches.

The resouce remapping process with PO is the same with CSV. The in-game text translation process is also the same use keys to fetch the appropriate translation.

The main difference between PO files and CSV files is the way both of them store the translated data in their files. Have a look at the translations/po and translations/csv folders to see the files involved.

See Internationalizing games and Localization using gettext for more information.

Language: GDScript

Renderer: Compatibility

Screenshots

Screenshot