Update UI text labels for consistency and internationalization; refactor HUD text handling

This commit is contained in:
2025-05-25 14:49:49 +02:00
parent 85f33e4cbe
commit 25676db130
16 changed files with 109 additions and 40 deletions

View File

@@ -43,7 +43,7 @@ size_flags_vertical = 4
[node name="Audio" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "audio"
text = "AUDIO"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true
@@ -59,7 +59,7 @@ theme_override_constants/separation = 4
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer/Master volume"]
layout_mode = 2
text = "Master volume"
text = "MASTER_VOLUME"
horizontal_alignment = 1
[node name="HSlider" type="HSlider" parent="PanelContainer/MarginContainer/VBoxContainer/Master volume"]
@@ -73,7 +73,7 @@ theme_override_constants/separation = 4
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer/Music volume"]
layout_mode = 2
text = "Music volume"
text = "MUSIC_VOLUME"
horizontal_alignment = 1
[node name="HSlider" type="HSlider" parent="PanelContainer/MarginContainer/VBoxContainer/Music volume"]
@@ -87,7 +87,7 @@ theme_override_constants/separation = 4
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer/SFX volume"]
layout_mode = 2
text = "Sounds volume"
text = "SOUNDS_VOLUME"
horizontal_alignment = 1
[node name="HSlider" type="HSlider" parent="PanelContainer/MarginContainer/VBoxContainer/SFX volume"]

View File

@@ -38,7 +38,7 @@ theme_override_constants/separation = 32
[node name="Pause" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "CREDITS"
text = "CREDITS_TITLE"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true
@@ -46,12 +46,5 @@ uppercase = true
[node name="RichTextLabel" type="RichTextLabel" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Game was created by Gabriel Kaszewski.
Main character was drawn by my girlfriend <3
I would like to thank all of my friends that encouraged my during development of this game.
For now this is it, enjoy the game!
"
text = "CREDITS"
fit_content = true

View File

@@ -41,7 +41,7 @@ theme_override_constants/separation = 16
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "game over"
text = "GAME_OVER"
horizontal_alignment = 1
uppercase = true
@@ -51,10 +51,10 @@ layout_mode = 2
[node name="RestartLevelButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "RESTART LEVEL"
text = "RESTART_LEVEL_BUTTON"
flat = true
[node name="MenuButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "GO TO MENU"
text = "GO_TO_MENU_BUTTON"
flat = true

View File

@@ -51,7 +51,7 @@ theme_override_constants/separation = 8
[node name="Health Label" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
text = "Health"
text = "HEALTH"
label_settings = ExtResource("1_4dsh5")
uppercase = true
@@ -68,12 +68,12 @@ show_percentage = false
[node name="Lives" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
text = "Lives 3"
text = "LIVES"
label_settings = ExtResource("1_4dsh5")
uppercase = true
[node name="Coins label" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
text = "Coins 33"
text = "COINS"
label_settings = ExtResource("1_4dsh5")
uppercase = true

View File

@@ -38,7 +38,7 @@ layout_mode = 2
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "input"
text = "INPUT"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true
@@ -72,5 +72,5 @@ layout_mode = 2
[node name="Reset to default Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "RESET TO DEFAULT"
text = "RESET_TO_DEFAULT_BUTTON"
flat = true

View File

@@ -43,7 +43,7 @@ theme_override_constants/separation = 16
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "MR. BRICK ADVENTURES"
text = "GAME_TITLE"
horizontal_alignment = 1
uppercase = true
@@ -54,27 +54,27 @@ size_flags_vertical = 3
[node name="ContinueButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "CONTINUE"
text = "CONTINUE_BUTTON"
flat = true
[node name="NewGameButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "NEW GAME"
text = "NEW_GAME_BUTTON"
flat = true
[node name="SettingsButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "SETTINGS"
text = "SETTINGS_BUTTON"
flat = true
[node name="CreditsButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "CREDITS"
text = "CREDITS_BUTTON"
flat = true
[node name="QuitButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "QUIT GAME"
text = "QUIT_BUTTON"
flat = true
[node name="version" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]

View File

@@ -49,7 +49,7 @@ theme_override_constants/separation = 32
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "marketplace"
text = "MARKETPLACE"
horizontal_alignment = 1
vertical_alignment = 1
justification_flags = 162

View File

@@ -46,7 +46,7 @@ size_flags_vertical = 4
[node name="Pause" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Pause"
text = "PAUSE"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true
@@ -58,20 +58,20 @@ size_flags_vertical = 3
[node name="Resume Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "RESUME"
text = "RESUME_BUTTON"
flat = true
[node name="Settings Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "SETTINGS"
text = "SETTINGS_BUTTON"
flat = true
[node name="Exit to menu Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "EXIT TO MENU"
text = "EXIT_TO_MENU_BUTTON"
flat = true
[node name="Quit game Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "QUIT GAME"
text = "QUIT_BUTTON"
flat = true

View File

@@ -42,7 +42,7 @@ theme_override_constants/separation = 16
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "settings"
text = "SETTINGS"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true
@@ -53,22 +53,22 @@ size_flags_vertical = 3
[node name="Input Settings Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "INPUT"
text = "INPUT_BUTTON"
flat = true
[node name="Display Settings Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "DISPLAY"
text = "DISPLAY_BUTTON"
flat = true
[node name="Audio Settings Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "AUDIO"
text = "AUDIO_BUTTON"
flat = true
[node name="Gameplay Settings Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "GAMEPLAY"
text = "GAMEPLAY_BUTTON"
flat = true
[node name="Spacer2" type="Control" parent="PanelContainer/MarginContainer/VBoxContainer"]

View File

@@ -155,6 +155,10 @@ switch_movement={
]
}
[internationalization]
locale/translations=PackedStringArray("res://translations.en.translation", "res://translations.pl.translation")
[layer_names]
2d_physics/layer_1="Terrain"

View File

@@ -33,14 +33,14 @@ func set_coins_label() -> void:
return
#todo: set internationalized text
coins_label.text = "Coins:" + str(game_manager.get_coins())
coins_label.text = tr("COINS") + ": " + str(game_manager.get_coins())
func set_lives_label() -> void:
if not game_manager:
return
lives_label.text = "Lives:" + str(game_manager.get_lives())
lives_label.text = tr("LIVES") + ": " + str(game_manager.get_lives())
func set_health_progressbar() -> void:

55
translations.csv Normal file
View File

@@ -0,0 +1,55 @@
key,en,pl
GAME_TITLE,Mr. Brick Adventures,Przygody Pana Cegły
CONTINUE_BUTTON,CONTINUE,KONTYNUUJ
NEW_GAME_BUTTON,NEW GAME,NOWA GRA
SETTINGS_BUTTON,SETTINGS,USTAWIENIA
CREDITS_BUTTON,CREDITS,AUTORZY
QUIT_BUTTON,QUIT GAME,WYJDŹ Z GRY
SETTINGS_TITLE,SETTINGS,USTAWIENIA
INPUT_BUTTON,INPUT,KLAWISZE
DISPLAY_BUTTON,DISPLAY,OBRAZ
AUDIO_BUTTON,AUDIO,AUDIO
GAMEPLAY_BUTTON,GAMEPLAY,GRA
INPUT_TITLE,INPUT,KLAWISZE
AUDIO_TITLE,AUDIO,AUDIO
MASTER_VOLUME,MASTER VOLUME,OGÓLNA
MUSIC VOLUME,MUSIC VOLUME,MUZYKA
SOUNDS VOLUME,SOUNDS VOLUME,EFEKTY DŹWIĘKOWE
CREDITS_TITLE,CREDITS,AUTORZY
CREDITS,"Game was created by Gabriel Kaszewski.
Main character was drawn by my girlfriend <3
I would like to thank all of my friends that encouraged my during development of this game.
For now this is it, enjoy the game!
","Przygody Pana Cegły zostały zrobione przeze mnie, Gabriela Kaszewskiego.
Główna postać, Pan Cegła został narysowany przez moją dziewczynę, która chciała pozostać anonimowa.
Z tego miejsca chciałbym podziękować wszystkim moim znajomym I przyjaciołom, którzy wspierali mnie przy tworzeniu tej gry.
Liczę, że będziesz dobrze się bawić!
Pozdrawiam."
HEALTH_LABEL,HEALTH,ZDROWIE
LIVES_LABEL,LIVES,ŻYCIA
COINS_LABEL,COINS,MONETY
LEVEL_1_NAME,VILLAGE 1,WIOSKA 1
LEVEL_2_NAME,VILLAGE 2,WIOSKA 2
LEVEL_3_NAME,VILLAGE 3,WIOSKA 3
LEVEL_4_NAME,VILLAGE 4,WIOSKA 4
LEVEL_5_NAME,VILLAGE 5,WIOSKA 5
MARKETPLACE,MARKETPLACE,SKLEP
GAME_OVER,GAME OVER,KONIEC GRY
RESTART_LEVEL_BUTTON,RESTART LEVEL,POTWÓRZ POZIOM
GO_TO_MENU_BUTTON,GO TO MENU,WRÓĆ DO MENU
BRICK_POWER,Brick power,Ceglana siła
EXPLOSIVE_BRICK,Explosive brick,Wybuchowa cegła
FIRE_BRICK,Fire brick,Ognista cegła
ICE_BRICK,Ice brick,Lodowa cegła
MAGNETIC,Magnetic power,Moc magnesu
PAUSE,PAUSE,PAUZA
RESUME_BUTTON,RESUME,WZNÓW
EXIT_TO_MENU_BUTTON,EXIT TO MENU,WYJDŹ DO MENU
RESET_TO_DEFAULT_BUTTON,RESET TO DEFAULT BUTTON,PRZYWRÓĆ DOMYŚLNE USTAWIENIA
1 key en pl
2 GAME_TITLE Mr. Brick Adventures Przygody Pana Cegły
3 CONTINUE_BUTTON CONTINUE KONTYNUUJ
4 NEW_GAME_BUTTON NEW GAME NOWA GRA
5 SETTINGS_BUTTON SETTINGS USTAWIENIA
6 CREDITS_BUTTON CREDITS AUTORZY
7 QUIT_BUTTON QUIT GAME WYJDŹ Z GRY
8 SETTINGS_TITLE SETTINGS USTAWIENIA
9 INPUT_BUTTON INPUT KLAWISZE
10 DISPLAY_BUTTON DISPLAY OBRAZ
11 AUDIO_BUTTON AUDIO AUDIO
12 GAMEPLAY_BUTTON GAMEPLAY GRA
13 INPUT_TITLE INPUT KLAWISZE
14 AUDIO_TITLE AUDIO AUDIO
15 MASTER_VOLUME MASTER VOLUME OGÓLNA
16 MUSIC VOLUME MUSIC VOLUME MUZYKA
17 SOUNDS VOLUME SOUNDS VOLUME EFEKTY DŹWIĘKOWE
18 CREDITS_TITLE CREDITS AUTORZY
19 CREDITS Game was created by Gabriel Kaszewski. Main character was drawn by my girlfriend <3 I would like to thank all of my friends that encouraged my during development of this game. For now this is it, enjoy the game! Przygody Pana Cegły zostały zrobione przeze mnie, Gabriela Kaszewskiego. Główna postać, Pan Cegła został narysowany przez moją dziewczynę, która chciała pozostać anonimowa. Z tego miejsca chciałbym podziękować wszystkim moim znajomym I przyjaciołom, którzy wspierali mnie przy tworzeniu tej gry. Liczę, że będziesz dobrze się bawić! Pozdrawiam.
20 HEALTH_LABEL HEALTH ZDROWIE
21 LIVES_LABEL LIVES ŻYCIA
22 COINS_LABEL COINS MONETY
23 LEVEL_1_NAME VILLAGE – 1 WIOSKA – 1
24 LEVEL_2_NAME VILLAGE – 2 WIOSKA – 2
25 LEVEL_3_NAME VILLAGE – 3 WIOSKA – 3
26 LEVEL_4_NAME VILLAGE – 4 WIOSKA – 4
27 LEVEL_5_NAME VILLAGE – 5 WIOSKA – 5
28 MARKETPLACE MARKETPLACE SKLEP
29 GAME_OVER GAME OVER KONIEC GRY
30 RESTART_LEVEL_BUTTON RESTART LEVEL POTWÓRZ POZIOM
31 GO_TO_MENU_BUTTON GO TO MENU WRÓĆ DO MENU
32 BRICK_POWER Brick power Ceglana siła
33 EXPLOSIVE_BRICK Explosive brick Wybuchowa cegła
34 FIRE_BRICK Fire brick Ognista cegła
35 ICE_BRICK Ice brick Lodowa cegła
36 MAGNETIC Magnetic power Moc magnesu
37 PAUSE PAUSE PAUZA
38 RESUME_BUTTON RESUME WZNÓW
39 EXIT_TO_MENU_BUTTON EXIT TO MENU WYJDŹ DO MENU
40 RESET_TO_DEFAULT_BUTTON RESET TO DEFAULT BUTTON PRZYWRÓĆ DOMYŚLNE USTAWIENIA

17
translations.csv.import Normal file
View File

@@ -0,0 +1,17 @@
[remap]
importer="csv_translation"
type="Translation"
uid="uid://csnsssxkbmkoy"
[deps]
files=["res://translations.en.translation", "res://translations.pl.translation"]
source_file="res://translations.csv"
dest_files=["res://translations.en.translation", "res://translations.pl.translation"]
[params]
compress=true
delimiter=0

BIN
translations.en.translation Normal file

Binary file not shown.

BIN
translations.ods Normal file

Binary file not shown.

BIN
translations.pl.translation Normal file

Binary file not shown.