Locale testing

This commit is contained in:
2025-05-24 23:07:50 -05:00
parent 1bce56231c
commit 1abb9a85f7
10 changed files with 193 additions and 19 deletions

BIN
locale/en_AU.mo Normal file

Binary file not shown.

58
locale/en_AU.po Normal file
View File

@@ -0,0 +1,58 @@
# LANGUAGE translation for Dawn Godot for the following files:
# res://scenes/UI/DebugMenu.tscn
#
# FIRST AUTHOR <EMAIL@ADDRESS>, 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"

BIN
locale/en_US.mo Normal file

Binary file not shown.

58
locale/en_US.po Normal file
View File

@@ -0,0 +1,58 @@
# LANGUAGE translation for Dawn Godot for the following files:
# res://scenes/UI/DebugMenu.tscn
#
# FIRST AUTHOR <EMAIL@ADDRESS>, 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"

54
locale/messages.pot Normal file
View File

@@ -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 <EMAIL@ADDRESS>, 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 ""

View File

@@ -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] [layer_names]
3d_physics/layer_2="Overworld Entities" 3d_physics/layer_2="Overworld Entities"

View File

@@ -22,8 +22,7 @@ metadata/_custom_type_script = "uid://j87s6jrx8unn"
[node name="Ash-Baked Sweet Potato" type="Node" parent="."] [node name="Ash-Baked Sweet Potato" type="Node" parent="."]
script = ExtResource("2_f5akq") script = ExtResource("2_f5akq")
recipeName = "Ash-Baked Sweet Potato" recipe_text = "Ash-Baked Sweet Potato"
recipeDescription = "Tender, warm, and sweet meal, made by baking a sweet potato in campfire embers. Comforting, simple, and gently filling."
ingredients = Array[ExtResource("3_b8y03")]([SubResource("Resource_3dxl6")]) ingredients = Array[ExtResource("3_b8y03")]([SubResource("Resource_3dxl6")])
outputs = Array[ExtResource("3_b8y03")]([SubResource("Resource_b8y03")]) outputs = Array[ExtResource("3_b8y03")]([SubResource("Resource_b8y03")])
metadata/_custom_type_script = "uid://dipvg4uwjv6p2" metadata/_custom_type_script = "uid://dipvg4uwjv6p2"

View File

@@ -3,15 +3,16 @@
[ext_resource type="Script" uid="uid://bn2kdjf586e5p" path="res://scripts/UI/DebugMenu.gd" id="1_pcsq6"] [ext_resource type="Script" uid="uid://bn2kdjf586e5p" path="res://scripts/UI/DebugMenu.gd" id="1_pcsq6"]
[node name="DebugMenu" type="VBoxContainer"] [node name="DebugMenu" type="VBoxContainer"]
anchors_preset = 9 anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_right = 171.0 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_pcsq6") script = ExtResource("1_pcsq6")
[node name="MainMenu" type="Button" parent="."] [node name="MainMenu" type="Button" parent="."]
layout_mode = 2 layout_mode = 2
text = "Prototype Main Menu" text = "UI_DEBUG_MAIN_MENU"
[node name="OverworldOption" type="HBoxContainer" parent="."] [node name="OverworldOption" type="HBoxContainer" parent="."]
layout_mode = 2 layout_mode = 2
@@ -19,7 +20,7 @@ size_flags_vertical = 0
[node name="Overworld" type="Button" parent="OverworldOption"] [node name="Overworld" type="Button" parent="OverworldOption"]
layout_mode = 2 layout_mode = 2
text = "Prototype Overworld" text = "UI_DEBUG_OVERWORLD"
[node name="MapDropdown" type="OptionButton" parent="OverworldOption"] [node name="MapDropdown" type="OptionButton" parent="OverworldOption"]
layout_mode = 2 layout_mode = 2
@@ -27,30 +28,25 @@ size_flags_horizontal = 3
[node name="Quests" type="Button" parent="."] [node name="Quests" type="Button" parent="."]
layout_mode = 2 layout_mode = 2
text = "Prototype Quests text = "UI_DEBUG_QUESTS"
"
[node name="Inventory" type="Button" parent="."] [node name="Inventory" type="Button" parent="."]
layout_mode = 2 layout_mode = 2
text = "Player Inventory" text = "UI_DEBUG_INVENTORY"
[node name="Event" type="Button" parent="."] [node name="Event" type="Button" parent="."]
layout_mode = 2 layout_mode = 2
text = "Event Flags" text = "UI_DEBUG_EVENTS"
[node name="Cutscene" type="Button" parent="."] [node name="Cutscene" type="Button" parent="."]
layout_mode = 2 layout_mode = 2
disabled = true text = "UI_DEBUG_CUTSCENES"
text = "Prototype Cutscene"
[node name="Cooking" type="Button" parent="."] [node name="Cooking" type="Button" parent="."]
layout_mode = 2 layout_mode = 2
disabled = true text = "UI_DEBUG_COOKING"
text = "Prototype Cooking
"
[node name="Battle" type="Button" parent="."] [node name="Battle" type="Button" parent="."]
layout_mode = 2 layout_mode = 2
disabled = true disabled = true
text = "Prototype Battle text = "UI_DEBUG_BATTLE"
"

View File

@@ -1,6 +1,6 @@
class_name Recipe extends Node class_name Recipe extends Node
@export var recipeName:String = "" @export var recipe_text:String = ""
@export var ingredients:Array[ItemResource] = [] @export var ingredients:Array[ItemResource] = []
@export var outputs:Array[ItemResource] = [] @export var outputs:Array[ItemResource] = []
@@ -26,5 +26,4 @@ func make(inventory:Inventory = null) -> void:
for output in outputs: for output in outputs:
inventory.addItem(output.type, output.quantity) inventory.addItem(output.type, output.quantity)
timesMade += 1 timesMade += 1

View File

@@ -1,5 +1,7 @@
class_name DebugMenu extends VBoxContainer class_name DebugMenu extends VBoxContainer
var whatever:String = tr("SOME_STRING_TRANSLATED")
func _ready() -> void: func _ready() -> void:
show() show()
@@ -53,9 +55,12 @@ func _on_Quests_pressed():
func _on_Custscene_pressed(): func _on_Custscene_pressed():
print("Cutscene pressed") print("Cutscene pressed")
print(whatever)
func _on_Cooking_pressed(): func _on_Cooking_pressed():
print("Cooking pressed") print("Cooking pressed")
TranslatssionServer.change
TranslationServer.set_locale("en_US")
func _on_Battle_pressed(): func _on_Battle_pressed():
print("Battle pressed") print("Battle pressed")