diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-07 12:17:59 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-07 12:17:59 +0200 |
commit | 5b602bee672c469e7b8f27d956c7b10c2321b08f (patch) | |
tree | b8af77acc22e4b977eece4fd75580f667d7bffbe | |
parent | 50113d09271aeb9c3be56be0bba729a91f4496a6 (diff) | |
download | hurrycurry-5b602bee672c469e7b8f27d956c7b10c2321b08f.tar hurrycurry-5b602bee672c469e7b8f27d956c7b10c2321b08f.tar.bz2 hurrycurry-5b602bee672c469e7b8f27d956c7b10c2321b08f.tar.zst |
fallback language
-rw-r--r-- | client/makefile | 2 | ||||
-rw-r--r-- | client/map/map.gd | 2 | ||||
-rw-r--r-- | client/menu/ingame.tscn | 14 | ||||
-rw-r--r-- | client/menu/lobby.tscn | 6 | ||||
-rw-r--r-- | client/menu/overlay.tscn | 18 | ||||
-rw-r--r-- | client/player/player.gd | 7 | ||||
-rw-r--r-- | locale/en.ini | 10 | ||||
-rw-r--r-- | locale/tools/src/main.rs | 12 |
8 files changed, 41 insertions, 30 deletions
diff --git a/client/makefile b/client/makefile index 71a4fb38..085ed748 100644 --- a/client/makefile +++ b/client/makefile @@ -37,4 +37,4 @@ po/locales.csv: $(LT) po/%.po: ../locale/%.ini $(LT) @mkdir -p po - $(LT) export-po $< $@ + $(LT) export-po $< $@ --fallback ../locale/en.ini diff --git a/client/map/map.gd b/client/map/map.gd index fc3bd1bb..f6258cc6 100644 --- a/client/map/map.gd +++ b/client/map/map.gd @@ -63,7 +63,7 @@ func apply_gi_setting(state): func gi_bake(): - if not Global.get_setting("graphics.gi") == 2: return + if Global.get_setting("graphics.gi") != "voxelgi": return print("Map: Rebaking VoxelGI") currently_baked = true gi_bake_blocking() diff --git a/client/menu/ingame.tscn b/client/menu/ingame.tscn index ce42bbdd..55678847 100644 --- a/client/menu/ingame.tscn +++ b/client/menu/ingame.tscn @@ -94,22 +94,22 @@ layout_mode = 2 [node name="Resume" type="Button" parent="Side/Margin/Options"] layout_mode = 2 -text = "Resume" +text = "c.menu.ingame.resume" alignment = 0 [node name="Leave" type="Button" parent="Side/Margin/Options"] layout_mode = 2 -text = "Join Game" +text = "c.menu.ingame.join" alignment = 0 [node name="Lobby" type="Button" parent="Side/Margin/Options"] layout_mode = 2 -text = "Cancel game" +text = "c.menu.ingame.cancel" alignment = 0 [node name="Reconnect" type="Button" parent="Side/Margin/Options"] layout_mode = 2 -text = "Reconnect" +text = "c.menu.ingame.reconnect" alignment = 0 [node name="Spacer2" type="Control" parent="Side/Margin/Options"] @@ -118,7 +118,7 @@ layout_mode = 2 [node name="Settings" type="Button" parent="Side/Margin/Options"] layout_mode = 2 -text = "Settings" +text = "c.menu.settings" alignment = 0 [node name="Spacer3" type="Control" parent="Side/Margin/Options"] @@ -127,12 +127,12 @@ layout_mode = 2 [node name="MainMenu" type="Button" parent="Side/Margin/Options"] layout_mode = 2 -text = "Main menu" +text = "c.menu.ingame.main_menu" alignment = 0 [node name="Quit" type="Button" parent="Side/Margin/Options"] layout_mode = 2 -text = "Quit game" +text = "c.menu.quit" alignment = 0 [connection signal="pressed" from="Side/Margin/Options/Resume" to="." method="_on_resume_pressed"] diff --git a/client/menu/lobby.tscn b/client/menu/lobby.tscn index 05b6507c..d1fe2233 100644 --- a/client/menu/lobby.tscn +++ b/client/menu/lobby.tscn @@ -124,7 +124,7 @@ layout_mode = 2 [node name="EnableBots" type="CheckButton" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots"] layout_mode = 2 -text = "Enable bots" +text = "c.menu.lobby.enable_bots" [node name="ScrollContainerCustom" type="ScrollContainer" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer/Bots"] visible = false @@ -145,7 +145,7 @@ alignment = 1 [node name="JoinSpectate" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer/VBoxContainer" instance=ExtResource("7_t6mox")] custom_minimum_size = Vector2(148, 0) layout_mode = 2 -text = "Spectate" +text = "c.menu.ingame.spectate" expand_icon = true controller_texture = ExtResource("11_5uugf") press_action = "join_spectate" @@ -153,7 +153,7 @@ press_action = "join_spectate" [node name="Start" parent="HBoxContainer/Bottom/MarginContainer/VBoxContainer/VBoxContainer" instance=ExtResource("7_t6mox")] custom_minimum_size = Vector2(148, 0) layout_mode = 2 -text = "Start game" +text = "c.menu.lobby.start_game" expand_icon = true controller_texture = ExtResource("9_q14bw") press_action = "start_game" diff --git a/client/menu/overlay.tscn b/client/menu/overlay.tscn index e28013db..0947e308 100644 --- a/client/menu/overlay.tscn +++ b/client/menu/overlay.tscn @@ -67,16 +67,16 @@ layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 25 -text = "Completed" +text = "c.score.completed" [node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line1"] layout_mode = 2 size_flags_horizontal = 3 [node name="Completed" type="Label" parent="Score/Paper/Margin/Lines/Line1"] +auto_translate_mode = 2 custom_minimum_size = Vector2(100, 0) layout_mode = 2 -auto_translate = false theme_override_colors/font_color = Color(0, 0.278431, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 35 @@ -91,16 +91,16 @@ layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 25 -text = "Failed" +text = "c.score.failed" [node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line2"] layout_mode = 2 size_flags_horizontal = 3 [node name="Failed" type="Label" parent="Score/Paper/Margin/Lines/Line2"] +auto_translate_mode = 2 custom_minimum_size = Vector2(100, 0) layout_mode = 2 -auto_translate = false theme_override_colors/font_color = Color(0.505882, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 35 @@ -115,16 +115,16 @@ layout_mode = 2 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 35 -text = "Points" +text = "c.score.points" [node name="Spacer" type="Control" parent="Score/Paper/Margin/Lines/Line3"] layout_mode = 2 size_flags_horizontal = 3 [node name="Points" type="Label" parent="Score/Paper/Margin/Lines/Line3"] +auto_translate_mode = 2 custom_minimum_size = Vector2(100, 0) layout_mode = 2 -auto_translate = false theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 45 @@ -156,9 +156,9 @@ texture = ExtResource("3_oum5g") layout_mode = 0 [node name="Seconds" type="Label" parent="Time/Paper/Line"] +auto_translate_mode = 2 custom_minimum_size = Vector2(100, 0) layout_mode = 2 -auto_translate = false theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 45 @@ -166,8 +166,8 @@ text = "300" horizontal_alignment = 2 [node name="Point" type="Label" parent="Time/Paper/Line"] +auto_translate_mode = 2 layout_mode = 2 -auto_translate = false theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 45 @@ -175,8 +175,8 @@ text = "." horizontal_alignment = 1 [node name="Decimals" type="Label" parent="Time/Paper/Line"] +auto_translate_mode = 2 layout_mode = 2 -auto_translate = false theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("3_u54fv") theme_override_font_sizes/font_size = 45 diff --git a/client/player/player.gd b/client/player/player.gd index bc978209..f034f14d 100644 --- a/client/player/player.gd +++ b/client/player/player.gd @@ -77,18 +77,17 @@ func _ready(): character.select_hairstyle(character_idx) clear_timer.timeout.connect(clear_message) - update_username_tag() - Global.settings_changed.connect(update_username_tag) + Settings.hook_changed_init("gameplay.usernames", update_username_tag) func update_position(new_position: Vector2, new_rotation: float, new_boosting: bool): position_ = new_position rotation_ = new_rotation boosting = new_boosting -func update_username_tag(): +func update_username_tag(state): var tag: Label3D = character.username_tag tag.text = username - tag.visible = Global.get_setting("graphics.usernames") + tag.visible = state func set_item(i: Item): i.owned_by = hand_base diff --git a/locale/en.ini b/locale/en.ini index 0db72e87..509cfd34 100644 --- a/locale/en.ini +++ b/locale/en.ini @@ -18,10 +18,6 @@ c.hint.movement=Use %s to move c.hint.reset_camera=Press %s to reset the camera view c.hint.zoom_camera=Use %s to zoom in/out c.hint=Hint -c.lobby.botenable=Enable bots -c.lobby.mapname=Map name -c.lobby.players=Players -c.lobby.start=Start game c.map.difficulty.0=Easy c.map.difficulty.1=Hard c.map.difficulty.2=Moderate @@ -37,11 +33,15 @@ c.menu.ingame.join2=Join Game c.menu.ingame.leave=Leave game c.menu.ingame.leave2=Leave Game c.menu.ingame.main_menu=Main menu -c.menu.ingame.mainmenu=Main Menu +c.menu.ingame.main_menu2=Main Menu c.menu.ingame.quit=Quit game c.menu.ingame.reconnect=Reconnect c.menu.ingame.resume=Resume c.menu.ingame.spectate=Spectate +c.menu.lobby.enable_bots=Enable bots +c.menu.lobby.mapname=Map name +c.menu.lobby.players=Players +c.menu.lobby.start=Start game c.menu.my_chef=My Chef c.menu.play.connect=Connect c.menu.play.quick_connect=Quick Connect diff --git a/locale/tools/src/main.rs b/locale/tools/src/main.rs index 1082581e..68805b99 100644 --- a/locale/tools/src/main.rs +++ b/locale/tools/src/main.rs @@ -26,6 +26,8 @@ enum Args { ExportPo { #[arg(long)] remap_ids: Option<PathBuf>, + #[arg(long)] + fallback: Option<PathBuf>, input: PathBuf, output: PathBuf, }, @@ -55,9 +57,19 @@ fn main() -> Result<()> { remap_ids: id_map, input, output, + fallback, } => { let mut ini = load_ini(&input)?; let id_map = id_map.map(|path| load_ini(&path)).transpose()?; + if let Some(fallback) = fallback { + let f = load_ini(&fallback)?; + for (k, v) in f { + if !ini.contains_key(&k) { + eprintln!("fallback: key {k:?} is missing"); + ini.insert(k, v); + } + } + } for &(code, name) in NATIVE_LANGUAGE_NAMES { ini.insert(format!("c.settings.ui.language.{code}"), name.to_owned()); |