From 1abb9a85f7fcf81916558bbb0f13d5ebee650673 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Sat, 24 May 2025 23:07:50 -0500 Subject: [PATCH] Locale testing --- locale/en_AU.mo | Bin 0 -> 712 bytes locale/en_AU.po | 58 ++++++++++++++++++++++++++++++++++ locale/en_US.mo | Bin 0 -> 707 bytes locale/en_US.po | 58 ++++++++++++++++++++++++++++++++++ locale/messages.pot | 54 +++++++++++++++++++++++++++++++ project.godot | 5 +++ scenes/Singletons/Recipe.tscn | 3 +- scenes/UI/DebugMenu.tscn | 26 +++++++-------- scripts/Cooking/Recipe.gd | 3 +- scripts/UI/DebugMenu.gd | 5 +++ 10 files changed, 193 insertions(+), 19 deletions(-) create mode 100644 locale/en_AU.mo create mode 100644 locale/en_AU.po create mode 100644 locale/en_US.mo create mode 100644 locale/en_US.po create mode 100644 locale/messages.pot diff --git a/locale/en_AU.mo b/locale/en_AU.mo new file mode 100644 index 0000000000000000000000000000000000000000..0f52aa1e245a8369e16f652f62815ccfa8b68fa7 GIT binary patch literal 712 zcmYk2y>8S%6om%}5G)~3gb)SAv=m-Iq=*(MyxzfB_-A8}7pN?=o@`80olcng#l3AqBk2d{!3!E4~B-v8Y9UwVG+`K>?y z0V0ZQLtBt7n`bj@U4ra4*=$>vA-qCJp2n=qc@`!?$ulp>BagEwDZ+BfCPh$AJkBFF z^nRMY!0d)m@Z4t!%Lj|iS;9B^FtJ9Oy>lFHFjqCBkl{&4ib@s%_}BIfJ_kw&~T_fOiYk&o%(u+p6{PYeFc-5ciYbq7Mb zOfFR2$mN*sy=jc|$_<1R`u`p?CF;h|N2A@*u0!}?(@{Ju38FB6PGkIgGO3Jd1@V0 literal 0 HcmV?d00001 diff --git a/locale/en_AU.po b/locale/en_AU.po new file mode 100644 index 0000000..041e71f --- /dev/null +++ b/locale/en_AU.po @@ -0,0 +1,58 @@ +# LANGUAGE translation for Dawn Godot for the following files: +# res://scenes/UI/DebugMenu.tscn +# +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Dawn Godot\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: en_AU\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.4.4\n" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_MAIN_MENU" +msgstr "Main Menu" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_OVERWORLD" +msgstr "Overworld" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_QUESTS" +msgstr "Quests" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_INVENTORY" +msgstr "Inventory" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_EVENTS" +msgstr "Events" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_CUTSCENES" +msgstr "Cutscenes" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_COOKING" +msgstr "Cooking" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_BATTLE" +msgstr "Battle" + +#: scenes/Singletons/Recipe.tscn +msgid "Ash-Baked Sweet Potato" +msgstr "" + +#: scripts/UI/DebugMenu.gd +msgid "SOME_STRING_TRANSLATED" +msgstr "This is ENGLISH MATE" diff --git a/locale/en_US.mo b/locale/en_US.mo new file mode 100644 index 0000000000000000000000000000000000000000..15b5906b1ccf3990efb22ca81b009255007b1412 GIT binary patch literal 707 zcmYk1zi-qq6vqt|S|TA(2h@QfD}xUZ9jb#4cR6#4$d7B{956-Z^0*5GyRv;(y0CR* ztk{^Dnfr$@@i)MKz%y9NJ>{#9-q-Ja?flx`xg=Nt>H(@l-9cTUT>VDfNBu$FMeSW9 zxsQB^bpCVSC!V#Z_U9MKpE!5vdwHFZTiAa_?jkRcw~=4G|JC>3JimMX@aI=Z zj3Rre9h57V=Q3Q~K)HW%*{*J)aD|XEPgz~^BF?5YFGg9Jj5wQ+Dy}DNTutloi1UQ? zeU#@fadyk7cp0&bmA%F0EaO{!oH-*e-t;5sD9-AXWmRwGb5^{{i)8EalZurXG}G!m zEG&&1ItOi9C5PceoXK#i8fAl7P7Bzy&ZiS$VHgI9FqU#Hr0IlJ`ky10Yq12%L44fm zhat$iDuXmmS)cx7@HmK+v>-9&{1hWCe6o*DJJHH#;bJAU0ef8W7xbu~bJx8CO_^M% zrj^TKc=Wcl!D~7N3Htv#W(u0thEE5FgTsLERck{0KrXx1tjJhc+X0D``hfc+T3fTg jT|?LgUt&ls9hE*ODLy1jL9R)@0ez-)*N~Gn7##WwKn, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Dawn Godot\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.4.4\n" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_MAIN_MENU" +msgstr "Main Menu" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_OVERWORLD" +msgstr "Overworld" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_QUESTS" +msgstr "Quests" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_INVENTORY" +msgstr "Inventory" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_EVENTS" +msgstr "Events" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_CUTSCENES" +msgstr "Cutscenes" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_COOKING" +msgstr "Cooking" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_BATTLE" +msgstr "Battle" + +#: scenes/Singletons/Recipe.tscn +msgid "Ash-Baked Sweet Potato" +msgstr "" + +#: scripts/UI/DebugMenu.gd +msgid "SOME_STRING_TRANSLATED" +msgstr "This is english" diff --git a/locale/messages.pot b/locale/messages.pot new file mode 100644 index 0000000..1f2cf0f --- /dev/null +++ b/locale/messages.pot @@ -0,0 +1,54 @@ +# LANGUAGE translation for Dawn Godot for the following files: +# res://scenes/UI/DebugMenu.tscn +# res://scenes/Singletons/Recipe.tscn +# res://scripts/UI/DebugMenu.gd +# +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Dawn Godot\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_MAIN_MENU" +msgstr "" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_OVERWORLD" +msgstr "" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_QUESTS" +msgstr "" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_INVENTORY" +msgstr "" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_EVENTS" +msgstr "" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_CUTSCENES" +msgstr "" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_COOKING" +msgstr "" + +#: scenes/UI/DebugMenu.tscn +msgid "UI_DEBUG_BATTLE" +msgstr "" + +#: scenes/Singletons/Recipe.tscn +msgid "Ash-Baked Sweet Potato" +msgstr "" + +#: scripts/UI/DebugMenu.gd +msgid "SOME_STRING_TRANSLATED" +msgstr "" diff --git a/project.godot b/project.godot index f96ce89..4ad07cc 100644 --- a/project.godot +++ b/project.godot @@ -108,6 +108,11 @@ run={ ] } +[internationalization] + +locale/translations=PackedStringArray("res://locale/en_US.mo", "res://locale/en_AU.mo") +locale/translations_pot_files=PackedStringArray("res://scenes/UI/DebugMenu.tscn", "res://scenes/Singletons/Recipe.tscn", "res://scripts/UI/DebugMenu.gd") + [layer_names] 3d_physics/layer_2="Overworld Entities" diff --git a/scenes/Singletons/Recipe.tscn b/scenes/Singletons/Recipe.tscn index 878ec96..5f17cd5 100644 --- a/scenes/Singletons/Recipe.tscn +++ b/scenes/Singletons/Recipe.tscn @@ -22,8 +22,7 @@ metadata/_custom_type_script = "uid://j87s6jrx8unn" [node name="Ash-Baked Sweet Potato" type="Node" parent="."] script = ExtResource("2_f5akq") -recipeName = "Ash-Baked Sweet Potato" -recipeDescription = "Tender, warm, and sweet meal, made by baking a sweet potato in campfire embers. Comforting, simple, and gently filling." +recipe_text = "Ash-Baked Sweet Potato" ingredients = Array[ExtResource("3_b8y03")]([SubResource("Resource_3dxl6")]) outputs = Array[ExtResource("3_b8y03")]([SubResource("Resource_b8y03")]) metadata/_custom_type_script = "uid://dipvg4uwjv6p2" diff --git a/scenes/UI/DebugMenu.tscn b/scenes/UI/DebugMenu.tscn index 8607db2..7293a7a 100644 --- a/scenes/UI/DebugMenu.tscn +++ b/scenes/UI/DebugMenu.tscn @@ -3,15 +3,16 @@ [ext_resource type="Script" uid="uid://bn2kdjf586e5p" path="res://scripts/UI/DebugMenu.gd" id="1_pcsq6"] [node name="DebugMenu" type="VBoxContainer"] -anchors_preset = 9 +anchors_preset = 15 +anchor_right = 1.0 anchor_bottom = 1.0 -offset_right = 171.0 +grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_pcsq6") [node name="MainMenu" type="Button" parent="."] layout_mode = 2 -text = "Prototype Main Menu" +text = "UI_DEBUG_MAIN_MENU" [node name="OverworldOption" type="HBoxContainer" parent="."] layout_mode = 2 @@ -19,7 +20,7 @@ size_flags_vertical = 0 [node name="Overworld" type="Button" parent="OverworldOption"] layout_mode = 2 -text = "Prototype Overworld" +text = "UI_DEBUG_OVERWORLD" [node name="MapDropdown" type="OptionButton" parent="OverworldOption"] layout_mode = 2 @@ -27,30 +28,25 @@ size_flags_horizontal = 3 [node name="Quests" type="Button" parent="."] layout_mode = 2 -text = "Prototype Quests -" +text = "UI_DEBUG_QUESTS" [node name="Inventory" type="Button" parent="."] layout_mode = 2 -text = "Player Inventory" +text = "UI_DEBUG_INVENTORY" [node name="Event" type="Button" parent="."] layout_mode = 2 -text = "Event Flags" +text = "UI_DEBUG_EVENTS" [node name="Cutscene" type="Button" parent="."] layout_mode = 2 -disabled = true -text = "Prototype Cutscene" +text = "UI_DEBUG_CUTSCENES" [node name="Cooking" type="Button" parent="."] layout_mode = 2 -disabled = true -text = "Prototype Cooking -" +text = "UI_DEBUG_COOKING" [node name="Battle" type="Button" parent="."] layout_mode = 2 disabled = true -text = "Prototype Battle -" +text = "UI_DEBUG_BATTLE" diff --git a/scripts/Cooking/Recipe.gd b/scripts/Cooking/Recipe.gd index 91489d7..fddb6cf 100644 --- a/scripts/Cooking/Recipe.gd +++ b/scripts/Cooking/Recipe.gd @@ -1,6 +1,6 @@ class_name Recipe extends Node -@export var recipeName:String = "" +@export var recipe_text:String = "" @export var ingredients:Array[ItemResource] = [] @export var outputs:Array[ItemResource] = [] @@ -26,5 +26,4 @@ func make(inventory:Inventory = null) -> void: for output in outputs: inventory.addItem(output.type, output.quantity) - timesMade += 1 \ No newline at end of file diff --git a/scripts/UI/DebugMenu.gd b/scripts/UI/DebugMenu.gd index 9845da3..7dc7b16 100644 --- a/scripts/UI/DebugMenu.gd +++ b/scripts/UI/DebugMenu.gd @@ -1,5 +1,7 @@ class_name DebugMenu extends VBoxContainer +var whatever:String = tr("SOME_STRING_TRANSLATED") + func _ready() -> void: show() @@ -53,9 +55,12 @@ func _on_Quests_pressed(): func _on_Custscene_pressed(): print("Cutscene pressed") + print(whatever) func _on_Cooking_pressed(): print("Cooking pressed") + TranslatssionServer.change + TranslationServer.set_locale("en_US") func _on_Battle_pressed(): print("Battle pressed")