-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add PO support in addition to CSV. Co-authored-by: SkyJJ <[email protected]>
- Loading branch information
1 parent
ea37c10
commit 0c48c79
Showing
65 changed files
with
991 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,36 @@ | ||
# GUI Translation Demo | ||
|
||
A demo showing how Godot seamlessly enables | ||
the use of localized resources and texts. | ||
This is a demo of how a project can be internationalized. Translations are | ||
created in a CSV file and then imported into Godot. | ||
|
||
Language: GDScript | ||
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. | ||
|
||
Renderer: Vulkan Mobile | ||
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](https://docs.godotengine.org/en/latest/tutorials/i18n/internationalizing_games.html) | ||
and [Localization using gettext](https://docs.godotengine.org/en/latest/tutorials/i18n/localization_using_gettext.html) | ||
for more information. | ||
|
||
Language: GDScript | ||
|
||
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/134 | ||
Renderer: Compatibility | ||
|
||
## Screenshots | ||
|
||
![Screenshot](screenshots/translation.png) | ||
![Screenshot](screenshots/translation.webp) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[remap] | ||
|
||
importer="wav" | ||
type="AudioStreamWAV" | ||
uid="uid://ciept8j0x21to" | ||
path="res://.godot/imported/hello_en.wav-2eea592f221b07e3c37c5477c1da8173.sample" | ||
|
||
[deps] | ||
|
||
source_file="res://audio/hello_en.wav" | ||
dest_files=["res://.godot/imported/hello_en.wav-2eea592f221b07e3c37c5477c1da8173.sample"] | ||
|
||
[params] | ||
|
||
force/8_bit=false | ||
force/mono=false | ||
force/max_rate=false | ||
force/max_rate_hz=44100 | ||
edit/trim=false | ||
edit/normalize=false | ||
edit/loop_mode=0 | ||
edit/loop_begin=0 | ||
edit/loop_end=-1 | ||
compress/mode=0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[remap] | ||
|
||
importer="wav" | ||
type="AudioStreamWAV" | ||
uid="uid://dd4xk00uh27hj" | ||
path="res://.godot/imported/hello_es.wav-0b3ee7fc19ef7ac4822f3f3dc177c570.sample" | ||
|
||
[deps] | ||
|
||
source_file="res://audio/hello_es.wav" | ||
dest_files=["res://.godot/imported/hello_es.wav-0b3ee7fc19ef7ac4822f3f3dc177c570.sample"] | ||
|
||
[params] | ||
|
||
force/8_bit=false | ||
force/mono=false | ||
force/max_rate=false | ||
force/max_rate_hz=44100 | ||
edit/trim=false | ||
edit/normalize=false | ||
edit/loop_mode=0 | ||
edit/loop_begin=0 | ||
edit/loop_end=-1 | ||
compress/mode=0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[remap] | ||
|
||
importer="wav" | ||
type="AudioStreamWAV" | ||
uid="uid://3tnymbrsqo0w" | ||
path="res://.godot/imported/hello_jp.wav-c7c916ef924fa85620d3858f227d094f.sample" | ||
|
||
[deps] | ||
|
||
source_file="res://audio/hello_jp.wav" | ||
dest_files=["res://.godot/imported/hello_jp.wav-c7c916ef924fa85620d3858f227d094f.sample"] | ||
|
||
[params] | ||
|
||
force/8_bit=false | ||
force/mono=false | ||
force/max_rate=false | ||
force/max_rate_hz=44100 | ||
edit/trim=false | ||
edit/normalize=false | ||
edit/loop_mode=0 | ||
edit/loop_begin=0 | ||
edit/loop_end=-1 | ||
compress/mode=0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[remap] | ||
|
||
importer="wav" | ||
type="AudioStreamWAV" | ||
uid="uid://dkuqg8u4fid5m" | ||
path="res://.godot/imported/hello_ru.wav-490e2b267af12af16807f2bf3de6d995.sample" | ||
|
||
[deps] | ||
|
||
source_file="res://audio/hello_ru.wav" | ||
dest_files=["res://.godot/imported/hello_ru.wav-490e2b267af12af16807f2bf3de6d995.sample"] | ||
|
||
[params] | ||
|
||
force/8_bit=false | ||
force/mono=false | ||
force/max_rate=false | ||
force/max_rate_hz=44100 | ||
edit/trim=false | ||
edit/normalize=false | ||
edit/loop_mode=0 | ||
edit/loop_begin=0 | ||
edit/loop_end=-1 | ||
compress/mode=0 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.