diff --git a/gui/translation/hello_en.wav b/gui/translation/Audio/hello_en.wav similarity index 100% rename from gui/translation/hello_en.wav rename to gui/translation/Audio/hello_en.wav diff --git a/gui/translation/Audio/hello_en.wav.import b/gui/translation/Audio/hello_en.wav.import new file mode 100644 index 00000000000..7d48a8a3a47 --- /dev/null +++ b/gui/translation/Audio/hello_en.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/hello_en.wav-383ebf8063db95d8d582a92eed30c0c7.sample" + +[deps] + +source_file="res://Audio/hello_en.wav" +dest_files=[ "res://.import/hello_en.wav-383ebf8063db95d8d582a92eed30c0c7.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=false +compress/mode=0 diff --git a/gui/translation/hello_es.wav b/gui/translation/Audio/hello_es.wav similarity index 100% rename from gui/translation/hello_es.wav rename to gui/translation/Audio/hello_es.wav diff --git a/gui/translation/Audio/hello_es.wav.import b/gui/translation/Audio/hello_es.wav.import new file mode 100644 index 00000000000..33d2a732611 --- /dev/null +++ b/gui/translation/Audio/hello_es.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/hello_es.wav-2d90075d2f3209df2412fb6f17bc2cad.sample" + +[deps] + +source_file="res://Audio/hello_es.wav" +dest_files=[ "res://.import/hello_es.wav-2d90075d2f3209df2412fb6f17bc2cad.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=false +compress/mode=0 diff --git a/gui/translation/hello_jp.wav b/gui/translation/Audio/hello_jp.wav similarity index 100% rename from gui/translation/hello_jp.wav rename to gui/translation/Audio/hello_jp.wav diff --git a/gui/translation/Audio/hello_jp.wav.import b/gui/translation/Audio/hello_jp.wav.import new file mode 100644 index 00000000000..0bdfb85ab3d --- /dev/null +++ b/gui/translation/Audio/hello_jp.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/hello_jp.wav-8d7362e27f181d8a936838f55027cc98.sample" + +[deps] + +source_file="res://Audio/hello_jp.wav" +dest_files=[ "res://.import/hello_jp.wav-8d7362e27f181d8a936838f55027cc98.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=false +compress/mode=0 diff --git a/gui/translation/Audio/hello_ru.wav b/gui/translation/Audio/hello_ru.wav new file mode 100644 index 00000000000..26a9839d867 Binary files /dev/null and b/gui/translation/Audio/hello_ru.wav differ diff --git a/gui/translation/Audio/hello_ru.wav.import b/gui/translation/Audio/hello_ru.wav.import new file mode 100644 index 00000000000..e2ba3eb791b --- /dev/null +++ b/gui/translation/Audio/hello_ru.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/hello_ru.wav-9ed07b9c8ac41a662cdd556c54dfa569.sample" + +[deps] + +source_file="res://Audio/hello_ru.wav" +dest_files=[ "res://.import/hello_ru.wav-9ed07b9c8ac41a662cdd556c54dfa569.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=false +compress/mode=0 diff --git a/gui/translation/font/DroidSans.ttf b/gui/translation/Fonts/DroidSans.ttf similarity index 100% rename from gui/translation/font/DroidSans.ttf rename to gui/translation/Fonts/DroidSans.ttf diff --git a/gui/translation/font/DroidSansArabic.ttf b/gui/translation/Fonts/DroidSansArabic.ttf similarity index 100% rename from gui/translation/font/DroidSansArabic.ttf rename to gui/translation/Fonts/DroidSansArabic.ttf diff --git a/gui/translation/font/DroidSansFallback.ttf b/gui/translation/Fonts/DroidSansFallback.ttf similarity index 100% rename from gui/translation/font/DroidSansFallback.ttf rename to gui/translation/Fonts/DroidSansFallback.ttf diff --git a/gui/translation/font/DroidSansHebrew.ttf b/gui/translation/Fonts/DroidSansHebrew.ttf similarity index 100% rename from gui/translation/font/DroidSansHebrew.ttf rename to gui/translation/Fonts/DroidSansHebrew.ttf diff --git a/gui/translation/font/DroidSansJapanese.ttf b/gui/translation/Fonts/DroidSansJapanese.ttf similarity index 100% rename from gui/translation/font/DroidSansJapanese.ttf rename to gui/translation/Fonts/DroidSansJapanese.ttf diff --git a/gui/translation/font/DroidSansThai.ttf b/gui/translation/Fonts/DroidSansThai.ttf similarity index 100% rename from gui/translation/font/DroidSansThai.ttf rename to gui/translation/Fonts/DroidSansThai.ttf diff --git a/gui/translation/Fonts/droid_sans.tres b/gui/translation/Fonts/droid_sans.tres new file mode 100644 index 00000000000..b2e1e332c42 --- /dev/null +++ b/gui/translation/Fonts/droid_sans.tres @@ -0,0 +1,23 @@ +[gd_resource type="DynamicFont" load_steps=7 format=2] + +[ext_resource path="res://Fonts/DroidSansArabic.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://Fonts/DroidSansFallback.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://Fonts/DroidSansHebrew.ttf" type="DynamicFontData" id=3] +[ext_resource path="res://Fonts/DroidSansJapanese.ttf" type="DynamicFontData" id=4] +[ext_resource path="res://Fonts/DroidSansThai.ttf" type="DynamicFontData" id=5] +[ext_resource path="res://Fonts/DroidSans.ttf" type="DynamicFontData" id=6] + + +[resource] + +size = 16 +use_mipmaps = false +use_filter = false +font_data = ExtResource( 6 ) +fallback/0 = ExtResource( 1 ) +fallback/1 = ExtResource( 2 ) +fallback/2 = ExtResource( 3 ) +fallback/3 = ExtResource( 4 ) +fallback/4 = ExtResource( 5 ) +_sections_unfolded = [ "Font", "Font/fallback" ] + diff --git a/gui/translation/Images/flag_japan.png b/gui/translation/Images/flag_japan.png new file mode 100644 index 00000000000..c9a5f21571d Binary files /dev/null and b/gui/translation/Images/flag_japan.png differ diff --git a/gui/translation/Images/flag_japan.png.import b/gui/translation/Images/flag_japan.png.import new file mode 100644 index 00000000000..9c3f693faa9 --- /dev/null +++ b/gui/translation/Images/flag_japan.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +path="res://.import/flag_japan.png-c592397591720d06179b5f17d55e57ba.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images/flag_japan.png" +dest_files=[ "res://.import/flag_japan.png-c592397591720d06179b5f17d55e57ba.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/invert_color=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/gui/translation/Images/flag_russia.png b/gui/translation/Images/flag_russia.png new file mode 100644 index 00000000000..becf4c1b974 Binary files /dev/null and b/gui/translation/Images/flag_russia.png differ diff --git a/gui/translation/Images/flag_russia.png.import b/gui/translation/Images/flag_russia.png.import new file mode 100644 index 00000000000..25f50066dd6 --- /dev/null +++ b/gui/translation/Images/flag_russia.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +path="res://.import/flag_russia.png-db862a3e8ae20d7b3763d8c62a913962.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images/flag_russia.png" +dest_files=[ "res://.import/flag_russia.png-db862a3e8ae20d7b3763d8c62a913962.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/invert_color=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/gui/translation/flag_spain.png b/gui/translation/Images/flag_spain.png similarity index 97% rename from gui/translation/flag_spain.png rename to gui/translation/Images/flag_spain.png index 447acc8823a..342be81dafb 100644 Binary files a/gui/translation/flag_spain.png and b/gui/translation/Images/flag_spain.png differ diff --git a/gui/translation/Images/flag_spain.png.import b/gui/translation/Images/flag_spain.png.import new file mode 100644 index 00000000000..fdf6b1c205b --- /dev/null +++ b/gui/translation/Images/flag_spain.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +path="res://.import/flag_spain.png-3a4e246f2ff1e9ce06420c12869d3d76.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images/flag_spain.png" +dest_files=[ "res://.import/flag_spain.png-3a4e246f2ff1e9ce06420c12869d3d76.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/invert_color=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/gui/translation/flag_uk.png b/gui/translation/Images/flag_uk.png similarity index 95% rename from gui/translation/flag_uk.png rename to gui/translation/Images/flag_uk.png index cb96806b8d4..ebc8ad9de5b 100644 Binary files a/gui/translation/flag_uk.png and b/gui/translation/Images/flag_uk.png differ diff --git a/gui/translation/Images/flag_uk.png.import b/gui/translation/Images/flag_uk.png.import new file mode 100644 index 00000000000..3b094cc6676 --- /dev/null +++ b/gui/translation/Images/flag_uk.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +path="res://.import/flag_uk.png-e848f7a2ca4ecb26caaf648f34528feb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images/flag_uk.png" +dest_files=[ "res://.import/flag_uk.png-e848f7a2ca4ecb26caaf648f34528feb.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/invert_color=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/gui/translation/Images/icon.png b/gui/translation/Images/icon.png new file mode 100644 index 00000000000..c98fbb601c8 Binary files /dev/null and b/gui/translation/Images/icon.png differ diff --git a/gui/translation/Images/icon.png.import b/gui/translation/Images/icon.png.import new file mode 100644 index 00000000000..64920354899 --- /dev/null +++ b/gui/translation/Images/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +path="res://.import/icon.png-5c54608cdf98940b04ad240121483c81.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images/icon.png" +dest_files=[ "res://.import/icon.png-5c54608cdf98940b04ad240121483c81.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/invert_color=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/gui/translation/speaker.png b/gui/translation/Images/speaker.png similarity index 56% rename from gui/translation/speaker.png rename to gui/translation/Images/speaker.png index 02bd0a876eb..69fb5072ee6 100644 Binary files a/gui/translation/speaker.png and b/gui/translation/Images/speaker.png differ diff --git a/gui/translation/Images/speaker.png.import b/gui/translation/Images/speaker.png.import new file mode 100644 index 00000000000..d949d3eb4f9 --- /dev/null +++ b/gui/translation/Images/speaker.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +path="res://.import/speaker.png-93d8393c7bb602e281e4f3f01416d945.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Images/speaker.png" +dest_files=[ "res://.import/speaker.png-93d8393c7bb602e281e4f3f01416d945.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/invert_color=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/gui/translation/README.md b/gui/translation/README.md index da3f934c97f..c40a52bb1b8 100644 --- a/gui/translation/README.md +++ b/gui/translation/README.md @@ -5,8 +5,8 @@ the use of localized resources and texts. Language: GDScript -Renderer: GLES 2 +Renderer: Vulkan ## Screenshots -![Screenshot](screenshots/translation.png) +![Screenshot](translation.png) diff --git a/gui/translation/Scripts/translation_csv.gd b/gui/translation/Scripts/translation_csv.gd new file mode 100644 index 00000000000..3cacdb17b09 --- /dev/null +++ b/gui/translation/Scripts/translation_csv.gd @@ -0,0 +1,43 @@ +# For more information on localization, +# search Godot's online documentation "Internationalization", or visit +# https://docs.godotengine.org/en/latest/tutorials/i18n/index.html + +extends Panel + +func _ready(): + _print_intro() + +func _on_english_pressed(): + TranslationServer.set_locale("en") + _print_intro() + + +func _on_spanish_pressed(): + TranslationServer.set_locale("es") + _print_intro() + + +func _on_japanese_pressed(): + TranslationServer.set_locale("ja") + _print_intro() + + +func _on_russian_pressed(): + TranslationServer.set_locale("ru") + _print_intro() + + +func _on_play_pressed(): + $Audio.play() + + +func _print_intro(): + # In CSV translation, use the appropriate key in the Object.tr() function to fetch + # the corresponding translation. + # This is the same for scene nodes containing user-facing texts to be translated. + print(tr("KEY_INTRO")) + + # CSV plural translation example. + var days_passed = randi() % 100 + print(tr_n(days_passed, "KEY_DAYS") % days_passed) + diff --git a/gui/translation/Scripts/translation_po.gd b/gui/translation/Scripts/translation_po.gd new file mode 100644 index 00000000000..b1f60469a30 --- /dev/null +++ b/gui/translation/Scripts/translation_po.gd @@ -0,0 +1,38 @@ +# For more information on translation using PO files, +# search Godot's online documentation "Localization using gettext", or visit +# https://docs.godotengine.org/en/latest/tutorials/i18n/localization_using_gettext.html + +extends Panel + +func _ready(): + _print_intro() + +func _on_english_pressed(): + TranslationServer.set_locale("en") + _print_intro() + + +func _on_spanish_pressed(): + TranslationServer.set_locale("es") + _print_intro() + + +func _on_japanese_pressed(): + TranslationServer.set_locale("ja") + _print_intro() + + +func _on_play_pressed(): + $Audio.play() + + +func _print_intro(): + # In PO translation, you would use source string as the 'key' for the Object.tr() function. + # This is the same for scene nodes containing user-facing texts to be translated. + print(tr("Hello, this is a translation demo project.")) + + # PO plural translation example. + # The difference with CSV is that you must add the "plural_message" argument, because PO files + # expect the data (else undefine behaviour might occur). + var days_passed = randi() % 100 + print(tr_n(days_passed, "One day ago.", "%d days ago.") % days_passed) diff --git a/gui/translation/TranslationFiles/CSV/text.csv b/gui/translation/TranslationFiles/CSV/text.csv new file mode 100644 index 00000000000..da42aa5f9f8 --- /dev/null +++ b/gui/translation/TranslationFiles/CSV/text.csv @@ -0,0 +1,7 @@ +,en,es,ja,ru +KEY_HELLO,Hello!,Hola!,こんにちは!,Привет! +KEY_PUSH,Push Me!,Aprétame!,押す!,Толкни меня! +KEY_INTRO,"Hello, this is a translation demo project.","Hola, este es un proyecto de demostración de traducción.","こんにちは、これは翻訳デモプロジェクトです.","Здравствуйте, это демонстрационный проект перевода." +KEY_DAYS[0],One day ago,Hace un dia,%d日前,%d день назад +KEY_DAYS[1],%d days ago,Hach %d dias,,%d дня назад +KEY_DAYS[2],,,,%d дней наз diff --git a/gui/translation/TranslationFiles/CSV/text.csv.import b/gui/translation/TranslationFiles/CSV/text.csv.import new file mode 100644 index 00000000000..9d0139ebb0a --- /dev/null +++ b/gui/translation/TranslationFiles/CSV/text.csv.import @@ -0,0 +1,16 @@ +[remap] + +importer="csv_translation" +type="Translation" + +[deps] + +files=[ "res://TranslationFiles/CSV/text.en.translation", "res://TranslationFiles/CSV/text.es.translation", "res://TranslationFiles/CSV/text.ja.translation", "res://TranslationFiles/CSV/text.ru.translation" ] + +source_file="res://TranslationFiles/CSV/text.csv" +dest_files=[ "res://TranslationFiles/CSV/text.en.translation", "res://TranslationFiles/CSV/text.es.translation", "res://TranslationFiles/CSV/text.ja.translation", "res://TranslationFiles/CSV/text.ru.translation" ] + +[params] + +compress=true +delimiter=0 diff --git a/gui/translation/TranslationFiles/PO/translation_demo.pot b/gui/translation/TranslationFiles/PO/translation_demo.pot new file mode 100644 index 00000000000..680f21081ca --- /dev/null +++ b/gui/translation/TranslationFiles/PO/translation_demo.pot @@ -0,0 +1,57 @@ +# LANGUAGE translation for Translation Demo for the following files: +# res://translation_po.gd +# res://translation_demo_po.tscn +# +# +# FIRST AUTHOR < EMAIL @ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Translation Demo\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: translation_demo_po.tscn +msgid "Hello, this is a translation demo project." +msgstr "" + +#: translation_demo_po.tscn +msgid "One day ago." +msgid_plural "%d days ago." +msgstr[0] "" +msgstr[1] "" + +#: translation_demo_po.tscn +msgid "Use English" +msgstr "" + +#: translation_demo_po.tscn +msgid "Use Spanish" +msgstr "" + +#: translation_demo_po.tscn +msgid "Use Japanese" +msgstr "" + +#: translation_demo_po.tscn +msgid "This second demo shows translation using PO files. " +"" +"The resouce remapping process 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 "TranslationFiles/PO" folder " +"and "TranslationFiles/CSV" folder to see the files involved in translation." +"" +"To find out more about PO files, search Godot's online documentation "Localization using gettext"" +msgstr "" + +#: translation_demo_po.tscn +msgid "Hello!" +msgstr "" + +#: translation_demo_po.tscn +msgid "Push Me!" +msgstr "" + diff --git a/gui/translation/TranslationFiles/PO/translation_demo_es.mo b/gui/translation/TranslationFiles/PO/translation_demo_es.mo new file mode 100644 index 00000000000..f6ab096d56c Binary files /dev/null and b/gui/translation/TranslationFiles/PO/translation_demo_es.mo differ diff --git a/gui/translation/TranslationFiles/PO/translation_demo_es.po b/gui/translation/TranslationFiles/PO/translation_demo_es.po new file mode 100644 index 00000000000..a279652bb48 --- /dev/null +++ b/gui/translation/TranslationFiles/PO/translation_demo_es.po @@ -0,0 +1,62 @@ +# LANGUAGE translation for Translation Demo for the following files: +# res://translation_po.gd +# res://translation_demo_po.tscn +# +# +# FIRST AUTHOR < EMAIL @ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Translation Demo\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: translation_demo_po.tscn +msgid "Hello, this is a translation demo project." +msgstr "Hola, este es un proyecto de demostración de traducción." + +#: translation_demo_po.tscn +msgid "One day ago." +msgid_plural "%d days ago." +msgstr[0] "Hace un dia." +msgstr[1] "Hach %d dias." + +#: translation_demo_po.tscn +msgid "Use English" +msgstr "" + +#: translation_demo_po.tscn +msgid "Use Spanish" +msgstr "" + +#: translation_demo_po.tscn +msgid "Use Japanese" +msgstr "" + +#: translation_demo_po.tscn +msgid "" +"This second demo shows translation using PO files. The resouce remapping " +"process 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 \"TranslationFiles/PO\" folder and " +"\"TranslationFiles/CSV\" folder to see the files involved in translation.To " +"find out more about PO files, search Godot's online documentation " +"\"Localization using gettext\"" +msgstr "" + +#: translation_demo_po.tscn +msgid "Hello!" +msgstr "Hola!" + +#: translation_demo_po.tscn +msgid "Push Me!" +msgstr "Aprétame!" diff --git a/gui/translation/TranslationFiles/PO/translation_demo_ja.mo b/gui/translation/TranslationFiles/PO/translation_demo_ja.mo new file mode 100644 index 00000000000..2bfcca705ed Binary files /dev/null and b/gui/translation/TranslationFiles/PO/translation_demo_ja.mo differ diff --git a/gui/translation/TranslationFiles/PO/translation_demo_ja.po b/gui/translation/TranslationFiles/PO/translation_demo_ja.po new file mode 100644 index 00000000000..37919ec37b9 --- /dev/null +++ b/gui/translation/TranslationFiles/PO/translation_demo_ja.po @@ -0,0 +1,61 @@ +# LANGUAGE translation for Translation Demo for the following files: +# res://translation_po.gd +# res://translation_demo_po.tscn +# +# +# FIRST AUTHOR < EMAIL @ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Translation Demo\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: translation_demo_po.tscn +msgid "Hello, this is a translation demo project." +msgstr "こんにちは、これは翻訳デモプロジェクトです." + +#: translation_demo_po.tscn +msgid "One day ago." +msgid_plural "%d days ago." +msgstr[0] "%d日前." + +#: translation_demo_po.tscn +msgid "Use English" +msgstr "" + +#: translation_demo_po.tscn +msgid "Use Spanish" +msgstr "" + +#: translation_demo_po.tscn +msgid "Use Japanese" +msgstr "" + +#: translation_demo_po.tscn +msgid "" +"This second demo shows translation using PO files. The resouce remapping " +"process 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 \"TranslationFiles/PO\" folder and " +"\"TranslationFiles/CSV\" folder to see the files involved in translation.To " +"find out more about PO files, search Godot's online documentation " +"\"Localization using gettext\"" +msgstr "" + +#: translation_demo_po.tscn +msgid "Hello!" +msgstr "こんにちは!" + +#: translation_demo_po.tscn +msgid "Push Me!" +msgstr "押す!" diff --git a/gui/translation/default_env.tres b/gui/translation/default_env.tres new file mode 100644 index 00000000000..ddf6bb74341 --- /dev/null +++ b/gui/translation/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="Sky" id=1] + +[resource] +background_mode = 2 +sky = SubResource( 1 ) diff --git a/gui/translation/flag_japan.png b/gui/translation/flag_japan.png deleted file mode 100644 index 920a44ca41d..00000000000 Binary files a/gui/translation/flag_japan.png and /dev/null differ diff --git a/gui/translation/flag_japan.png.import b/gui/translation/flag_japan.png.import deleted file mode 100644 index b0a17f8e529..00000000000 --- a/gui/translation/flag_japan.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/flag_japan.png-e7284e6af3de26ab9c66cac9c4062038.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://flag_japan.png" -dest_files=[ "res://.import/flag_japan.png-e7284e6af3de26ab9c66cac9c4062038.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/gui/translation/flag_spain.png.import b/gui/translation/flag_spain.png.import deleted file mode 100644 index a154813d943..00000000000 --- a/gui/translation/flag_spain.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/flag_spain.png-fd2012b4e19487cfc4923df0c268553f.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://flag_spain.png" -dest_files=[ "res://.import/flag_spain.png-fd2012b4e19487cfc4923df0c268553f.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/gui/translation/flag_uk.png.import b/gui/translation/flag_uk.png.import deleted file mode 100644 index da63b1fa253..00000000000 --- a/gui/translation/flag_uk.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/flag_uk.png-eb8a2b26ac36f4d0cf0d7345e577ec2c.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://flag_uk.png" -dest_files=[ "res://.import/flag_uk.png-eb8a2b26ac36f4d0cf0d7345e577ec2c.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/gui/translation/font/droid_sans.tres b/gui/translation/font/droid_sans.tres deleted file mode 100644 index 40cbd2079d9..00000000000 --- a/gui/translation/font/droid_sans.tres +++ /dev/null @@ -1,22 +0,0 @@ -[gd_resource type="DynamicFont" load_steps=7 format=2] - -[ext_resource path="res://font/DroidSansArabic.ttf" type="DynamicFontData" id=1] -[ext_resource path="res://font/DroidSansFallback.ttf" type="DynamicFontData" id=2] -[ext_resource path="res://font/DroidSansHebrew.ttf" type="DynamicFontData" id=3] -[ext_resource path="res://font/DroidSansJapanese.ttf" type="DynamicFontData" id=4] -[ext_resource path="res://font/DroidSansThai.ttf" type="DynamicFontData" id=5] -[ext_resource path="res://font/DroidSans.ttf" type="DynamicFontData" id=6] - -[resource] - -size = 16 -use_mipmaps = false -use_filter = false -font_data = ExtResource( 6 ) -fallback/0 = ExtResource( 1 ) -fallback/1 = ExtResource( 2 ) -fallback/2 = ExtResource( 3 ) -fallback/3 = ExtResource( 4 ) -fallback/4 = ExtResource( 5 ) -_sections_unfolded = [ "Font", "Font/fallback" ] - diff --git a/gui/translation/hello_en.wav.import b/gui/translation/hello_en.wav.import deleted file mode 100644 index 32d590818a6..00000000000 --- a/gui/translation/hello_en.wav.import +++ /dev/null @@ -1,21 +0,0 @@ -[remap] - -importer="wav" -type="AudioStreamSample" -path="res://.import/hello_en.wav-27ed59f2d75c1ba813ab0abd069b6758.sample" - -[deps] - -source_file="res://hello_en.wav" -dest_files=[ "res://.import/hello_en.wav-27ed59f2d75c1ba813ab0abd069b6758.sample" ] - -[params] - -force/8_bit=false -force/mono=false -force/max_rate=false -force/max_rate_hz=44100 -edit/trim=true -edit/normalize=true -edit/loop=false -compress/mode=0 diff --git a/gui/translation/hello_es.wav.import b/gui/translation/hello_es.wav.import deleted file mode 100644 index 2d1236b8b91..00000000000 --- a/gui/translation/hello_es.wav.import +++ /dev/null @@ -1,21 +0,0 @@ -[remap] - -importer="wav" -type="AudioStreamSample" -path="res://.import/hello_es.wav-64fe245556f8642a1881ae257bd123f2.sample" - -[deps] - -source_file="res://hello_es.wav" -dest_files=[ "res://.import/hello_es.wav-64fe245556f8642a1881ae257bd123f2.sample" ] - -[params] - -force/8_bit=false -force/mono=false -force/max_rate=false -force/max_rate_hz=44100 -edit/trim=true -edit/normalize=true -edit/loop=false -compress/mode=0 diff --git a/gui/translation/hello_jp.wav.import b/gui/translation/hello_jp.wav.import deleted file mode 100644 index 50dd285e201..00000000000 --- a/gui/translation/hello_jp.wav.import +++ /dev/null @@ -1,21 +0,0 @@ -[remap] - -importer="wav" -type="AudioStreamSample" -path="res://.import/hello_jp.wav-c31fbd7870b4b969789cb01f208809ac.sample" - -[deps] - -source_file="res://hello_jp.wav" -dest_files=[ "res://.import/hello_jp.wav-c31fbd7870b4b969789cb01f208809ac.sample" ] - -[params] - -force/8_bit=false -force/mono=false -force/max_rate=false -force/max_rate_hz=44100 -edit/trim=true -edit/normalize=true -edit/loop=false -compress/mode=0 diff --git a/gui/translation/icon.png b/gui/translation/icon.png deleted file mode 100644 index eb6fd7a7074..00000000000 Binary files a/gui/translation/icon.png and /dev/null differ diff --git a/gui/translation/icon.png.import b/gui/translation/icon.png.import deleted file mode 100644 index 96cbf4629a5..00000000000 --- a/gui/translation/icon.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://icon.png" -dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/gui/translation/project.godot b/gui/translation/project.godot index f4f9ea8c257..9ba8c954a90 100644 --- a/gui/translation/project.godot +++ b/gui/translation/project.godot @@ -16,33 +16,18 @@ _global_script_class_icons={ [application] config/name="Translation Demo" -config/description="A demo showing how Godot seamlessly enables -the use of localized resources and texts." -run/main_scene="res://translation_demo.tscn" -config/icon="res://icon.png" - -[display] - -window/stretch/mode="2d" -window/stretch/aspect="expand" - -[gdnative] - -singletons=[ ] +run/main_scene="res://translation_demo_csv.tscn" +config/icon="res://Images/icon.png" [locale] +translations=PackedStringArray( "res://TranslationFiles/CSV/text.en.translation", "res://TranslationFiles/CSV/text.es.translation", "res://TranslationFiles/CSV/text.ja.translation", "res://TranslationFiles/CSV/text.ru.translation", "res://TranslationFiles/PO/translation_demo_es.po", "res://TranslationFiles/PO/translation_demo_ja.po" ) translation_remaps={ -"res://flag_uk.png": [ "res://flag_spain.png:es", "res://flag_japan.png:ja" ], -"res://hello_en.wav": PoolStringArray( "res://hello_es.wav:es", "res://hello_jp.wav:ja" ) +"res://Audio/hello_en.wav": PackedStringArray( "res://Audio/hello_es.wav:es", "res://Audio/hello_jp.wav:ja", "res://Audio/hello_ru.wav:ru" ), +"res://Images/flag_uk.png": PackedStringArray( "res://Images/flag_spain.png:es", "res://Images/flag_japan.png:ja", "res://Images/flag_russia.png:ru" ) } -translations=PoolStringArray( "res://text.en.translation", "res://text.es.translation", "res://text.ja.translation" ) - -[memory] - -multithread/thread_rid_pool_prealloc=60 +translations_pot_files=PackedStringArray( "res://translation_po.gd", "res://translation_demo_po.tscn" ) [rendering] -quality/driver/driver_name="GLES2" -environment/default_clear_color=Color( 0.145098, 0.145098, 0.164706, 1 ) +environment/default_environment="res://default_env.tres" diff --git a/gui/translation/screenshots/.gdignore b/gui/translation/screenshots/.gdignore deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/gui/translation/screenshots/translation.png b/gui/translation/screenshots/translation.png deleted file mode 100644 index 5f27d9e7d93..00000000000 Binary files a/gui/translation/screenshots/translation.png and /dev/null differ diff --git a/gui/translation/speaker.png.import b/gui/translation/speaker.png.import deleted file mode 100644 index c1199579658..00000000000 --- a/gui/translation/speaker.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/speaker.png-045bf6684b83b55b088824f14e175d16.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://speaker.png" -dest_files=[ "res://.import/speaker.png-045bf6684b83b55b088824f14e175d16.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/gui/translation/text.csv b/gui/translation/text.csv deleted file mode 100644 index 0e6ca1ed8a9..00000000000 --- a/gui/translation/text.csv +++ /dev/null @@ -1,3 +0,0 @@ -,en,es,ja -KEY_HELLO,Hello!,Hola!,こんにちは -KEY_PUSH,Push Me!,Aprétame!,押す diff --git a/gui/translation/text.csv.import b/gui/translation/text.csv.import deleted file mode 100644 index c925c70de0e..00000000000 --- a/gui/translation/text.csv.import +++ /dev/null @@ -1,16 +0,0 @@ -[remap] - -importer="csv_translation" -type="Translation" - -[deps] - -files=[ "res://text.en.translation", "res://text.es.translation", "res://text.ja.translation" ] - -source_file="res://text.csv" -dest_files=[ "res://text.en.translation", "res://text.es.translation", "res://text.ja.translation" ] - -[params] - -compress=true -delimiter=0 diff --git a/gui/translation/translation.png b/gui/translation/translation.png new file mode 100644 index 00000000000..d4613d61859 Binary files /dev/null and b/gui/translation/translation.png differ diff --git a/gui/translation/translation.png.import b/gui/translation/translation.png.import new file mode 100644 index 00000000000..4dada4f3483 --- /dev/null +++ b/gui/translation/translation.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +path="res://.import/translation.png-2fa137479ae68330d35190d4c2a9a373.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://translation.png" +dest_files=[ "res://.import/translation.png-2fa137479ae68330d35190d4c2a9a373.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/invert_color=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/gui/translation/translation_demo.gd b/gui/translation/translation_demo.gd deleted file mode 100644 index 98bb16d3d9e..00000000000 --- a/gui/translation/translation_demo.gd +++ /dev/null @@ -1,16 +0,0 @@ -extends Panel - -func _on_english_pressed(): - TranslationServer.set_locale("en") - - -func _on_spanish_pressed(): - TranslationServer.set_locale("es") - - -func _on_japanese_pressed(): - TranslationServer.set_locale("ja") - - -func _on_play_pressed(): - $Audio.play() diff --git a/gui/translation/translation_demo.tscn b/gui/translation/translation_demo_csv.tscn similarity index 51% rename from gui/translation/translation_demo.tscn rename to gui/translation/translation_demo_csv.tscn index c99d0c5f586..f5bb7ca964c 100644 --- a/gui/translation/translation_demo.tscn +++ b/gui/translation/translation_demo_csv.tscn @@ -1,12 +1,17 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=8 format=2] -[ext_resource path="res://translation_demo.gd" type="Script" id=1] -[ext_resource path="res://font/droid_sans.tres" type="DynamicFont" id=2] -[ext_resource path="res://speaker.png" type="Texture" id=3] -[ext_resource path="res://flag_uk.png" type="Texture" id=4] -[ext_resource path="res://hello_en.wav" type="AudioStream" id=5] +[ext_resource path="res://Images/speaker.png" type="Texture2D" id=1] +[ext_resource path="res://Audio/hello_en.wav" type="AudioStream" id=2] +[ext_resource path="res://Images/flag_uk.png" type="Texture2D" id=3] +[ext_resource path="res://Fonts/droid_sans.tres" type="DynamicFont" id=4] +[ext_resource path="res://Scripts/translation_csv.gd" type="Script" id=5] +[ext_resource path="res://Fonts/DroidSans.ttf" type="DynamicFontData" id=6] -[node name="TranslationDemo" type="Panel"] +[sub_resource type="DynamicFont" id=1] +size = 24 +font_data = ExtResource( 6 ) + +[node name="TranslationDemoCSV" type="Panel"] anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 @@ -17,47 +22,82 @@ margin_right = 512.0 margin_bottom = 300.0 size_flags_horizontal = 2 size_flags_vertical = 2 -script = ExtResource( 1 ) +script = ExtResource( 5 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Title" type="Label" parent="."] +margin_left = 422.0 +margin_right = 602.0 +margin_bottom = 29.0 +custom_fonts/font = SubResource( 1 ) +text = "CSV Example" +script = null __meta__ = { -"__editor_plugin_screen__": "2D", "_edit_use_anchors_": false } [node name="English" type="Button" parent="."] margin_left = 32.0 -margin_top = 64.0 +margin_top = 81.9594 margin_right = 192.0 -margin_bottom = 88.0 +margin_bottom = 105.959 size_flags_horizontal = 2 size_flags_vertical = 2 text = "Use English" +script = null +__meta__ = { +"_edit_use_anchors_": false +} [node name="Spanish" type="Button" parent="."] margin_left = 32.0 -margin_top = 112.0 +margin_top = 129.959 margin_right = 192.0 -margin_bottom = 136.0 +margin_bottom = 153.959 size_flags_horizontal = 2 size_flags_vertical = 2 text = "Use Spanish" +script = null +__meta__ = { +"_edit_use_anchors_": false +} [node name="Japanese" type="Button" parent="."] margin_left = 32.0 -margin_top = 160.0 +margin_top = 177.959 margin_right = 192.0 -margin_bottom = 184.0 +margin_bottom = 201.959 size_flags_horizontal = 2 size_flags_vertical = 2 text = "Use Japanese" +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Russian" type="Button" parent="."] +margin_left = 32.0 +margin_top = 225.959 +margin_right = 192.0 +margin_bottom = 249.959 +size_flags_horizontal = 2 +size_flags_vertical = 2 +text = "Use Russian" +script = null +__meta__ = { +"_edit_use_anchors_": false +} [node name="Description" type="Label" parent="."] margin_left = 243.0 -margin_top = 42.0 +margin_top = 59.9594 margin_right = 804.0 -margin_bottom = 312.0 +margin_bottom = 329.959 size_flags_horizontal = 2 size_flags_vertical = 0 -custom_fonts/font = ExtResource( 2 ) +custom_fonts/font = ExtResource( 4 ) text = "This is a demo of how a game can be internationalized. Translations are created in a CSV file and then imported into Godot. @@ -67,12 +107,20 @@ in the font/ folder that you can use for your games. Godot allows internationalized text to change automatically when the locale is modified. Resources can also be set internationalized alternatives and replaced automatically on locale change." +script = null +__meta__ = { +"_edit_use_anchors_": false +} [node name="HSeparator" type="HSeparator" parent="."] margin_left = 33.0 margin_top = 330.0 margin_right = 1001.0 margin_bottom = 370.0 +script = null +__meta__ = { +"_edit_use_anchors_": false +} [node name="HelloText" type="Label" parent="."] margin_left = 246.0 @@ -80,28 +128,43 @@ margin_top = 381.0 margin_right = 324.0 margin_bottom = 400.0 size_flags_vertical = 0 -custom_fonts/font = ExtResource( 2 ) +custom_fonts/font = ExtResource( 4 ) text = "KEY_HELLO" +script = null +__meta__ = { +"_edit_use_anchors_": false +} [node name="PlayAudio" type="Button" parent="."] margin_left = 243.0 margin_top = 442.0 margin_right = 475.0 -margin_bottom = 467.0 -custom_fonts/font = ExtResource( 2 ) +margin_bottom = 468.0 +custom_fonts/font = ExtResource( 4 ) text = "KEY_PUSH" -icon = ExtResource( 3 ) +icon = ExtResource( 1 ) +script = null +__meta__ = { +"_edit_use_anchors_": false +} [node name="Flag" type="TextureRect" parent="."] margin_left = 85.0 margin_top = 382.0 margin_right = 213.0 margin_bottom = 467.0 -texture = ExtResource( 4 ) +texture = ExtResource( 3 ) +script = null +__meta__ = { +"_edit_use_anchors_": false +} -[node name="Audio" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 5 ) +[node name="Audio" type="AudioStreamPlayer2D" parent="."] +skew = 4.37114e-08 +stream = ExtResource( 2 ) +script = null [connection signal="pressed" from="English" to="." method="_on_english_pressed"] [connection signal="pressed" from="Spanish" to="." method="_on_spanish_pressed"] [connection signal="pressed" from="Japanese" to="." method="_on_japanese_pressed"] +[connection signal="pressed" from="Russian" to="." method="_on_russian_pressed"] [connection signal="pressed" from="PlayAudio" to="." method="_on_play_pressed"] diff --git a/gui/translation/translation_demo_po.tscn b/gui/translation/translation_demo_po.tscn new file mode 100644 index 00000000000..8fc72a789ea --- /dev/null +++ b/gui/translation/translation_demo_po.tscn @@ -0,0 +1,157 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://Images/speaker.png" type="Texture2D" id=1] +[ext_resource path="res://Audio/hello_en.wav" type="AudioStream" id=2] +[ext_resource path="res://Images/flag_uk.png" type="Texture2D" id=3] +[ext_resource path="res://Fonts/droid_sans.tres" type="DynamicFont" id=4] +[ext_resource path="res://Scripts/translation_po.gd" type="Script" id=5] +[ext_resource path="res://Fonts/DroidSans.ttf" type="DynamicFontData" id=6] + +[sub_resource type="DynamicFont" id=1] +size = 24 +font_data = ExtResource( 6 ) + +[node name="TranslationDemoPO" type="Panel"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -512.0 +margin_top = -300.0 +margin_right = 512.0 +margin_bottom = 300.0 +size_flags_horizontal = 2 +size_flags_vertical = 2 +script = ExtResource( 5 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Title" type="Label" parent="."] +margin_left = 422.0 +margin_right = 602.0 +margin_bottom = 38.0 +custom_fonts/font = SubResource( 1 ) +text = "PO Example" +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="English" type="Button" parent="."] +margin_left = 32.0 +margin_top = 78.592 +margin_right = 192.0 +margin_bottom = 102.592 +size_flags_horizontal = 2 +size_flags_vertical = 2 +text = "Use English" +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Spanish" type="Button" parent="."] +margin_left = 32.0 +margin_top = 126.592 +margin_right = 192.0 +margin_bottom = 150.592 +size_flags_horizontal = 2 +size_flags_vertical = 2 +text = "Use Spanish" +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Japanese" type="Button" parent="."] +margin_left = 32.0 +margin_top = 174.592 +margin_right = 192.0 +margin_bottom = 198.592 +size_flags_horizontal = 2 +size_flags_vertical = 2 +text = "Use Japanese" +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Description" type="Label" parent="."] +margin_left = 243.0 +margin_top = 56.592 +margin_right = 929.0 +margin_bottom = 326.592 +size_flags_horizontal = 2 +size_flags_vertical = 0 +custom_fonts/font = ExtResource( 4 ) +text = "This second demo shows translation using PO files. + +The resouce remapping process 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 \"TranslationFiles/PO\" folder +and \"TranslationFiles/CSV\" folder to see the files involved in translation. + +To find out more about PO files, search Godot's online documentation \"Localization using gettext\"" +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HSeparator" type="HSeparator" parent="."] +margin_left = 33.0 +margin_top = 330.0 +margin_right = 1001.0 +margin_bottom = 370.0 +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HelloText" type="Label" parent="."] +margin_left = 246.0 +margin_top = 381.0 +margin_right = 325.0 +margin_bottom = 400.0 +size_flags_vertical = 0 +custom_fonts/font = ExtResource( 4 ) +text = "Hello!" +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="PlayAudio" type="Button" parent="."] +margin_left = 243.0 +margin_top = 442.0 +margin_right = 475.0 +margin_bottom = 468.0 +custom_fonts/font = ExtResource( 4 ) +text = "Push Me!" +icon = ExtResource( 1 ) +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Flag" type="TextureRect" parent="."] +margin_left = 85.0 +margin_top = 382.0 +margin_right = 213.0 +margin_bottom = 467.0 +texture = ExtResource( 3 ) +script = null +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Audio" type="AudioStreamPlayer2D" parent="."] +skew = 4.37114e-08 +stream = ExtResource( 2 ) +script = null +[connection signal="pressed" from="English" to="." method="_on_english_pressed"] +[connection signal="pressed" from="Spanish" to="." method="_on_spanish_pressed"] +[connection signal="pressed" from="Japanese" to="." method="_on_japanese_pressed"] +[connection signal="pressed" from="PlayAudio" to="." method="_on_play_pressed"]