diff options
author | hop311 <hop3114@gmail.com> | 2024-08-01 00:17:32 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-08-02 22:54:08 +0200 |
commit | 06b76612b28183f0a047dac3a4127120d2af1b39 (patch) | |
tree | 9e7af8634eafc8461bd02697dd48ae36ca924858 /game/src | |
parent | 8431914a6971cbacfb20bba13a4113d9ac4d5153 (diff) |
Use UTF8 encoding and simplify godot string conversionutf8-fix
Fixes #180: Province names do not convert non-ascii characters to Unicode
Diffstat (limited to 'game/src')
-rw-r--r-- | game/src/Game/GameSession/ProvinceOverviewPanel.gd | 12 | ||||
-rw-r--r-- | game/src/Game/GameSession/SearchPanel.gd | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/game/src/Game/GameSession/ProvinceOverviewPanel.gd b/game/src/Game/GameSession/ProvinceOverviewPanel.gd index f162370..864c0e5 100644 --- a/game/src/Game/GameSession/ProvinceOverviewPanel.gd +++ b/game/src/Game/GameSession/ProvinceOverviewPanel.gd @@ -2,7 +2,7 @@ extends GUINode # Header var _province_name_label : Label -var _region_name_label : Label +var _state_name_label : Label var _slave_status_icon : TextureRect var _colony_status_button : Button var _colony_status_button_texture : GFXSpriteTexture @@ -137,7 +137,10 @@ func _ready() -> void: # Header _province_name_label = get_label_from_nodepath(^"./province_view/province_view_header/province_name") - _region_name_label = get_label_from_nodepath(^"./province_view/province_view_header/state_name") + _state_name_label = get_label_from_nodepath(^"./province_view/province_view_header/state_name") + if _state_name_label: + # State names are already translated in the MenuSingleton + _state_name_label.auto_translate = false _slave_status_icon = get_texture_rect_from_nodepath(^"./province_view/province_view_header/slave_state_icon") var slave_status_icon_texture : GFXSpriteTexture = get_gfx_sprite_texture_from_nodepath(^"./province_view/province_view_header/slave_state_icon") if slave_status_icon_texture: @@ -257,9 +260,8 @@ func _update_info() -> void: if _province_name_label: _province_name_label.text = GUINode.format_province_name(_province_info.get(_province_info_province_key, _missing_suffix)) - if _region_name_label: - _region_name_label.text = _province_info.get(_province_info_state_key, - _province_info_state_key + _missing_suffix) + if _state_name_label: + _state_name_label.text = _province_info.get(_province_info_state_key, tr(_province_info_state_key + _missing_suffix)) if _slave_status_icon: _slave_status_icon.visible = _province_info.get(_province_info_slave_status_key, false) diff --git a/game/src/Game/GameSession/SearchPanel.gd b/game/src/Game/GameSession/SearchPanel.gd index 5554226..c41660f 100644 --- a/game/src/Game/GameSession/SearchPanel.gd +++ b/game/src/Game/GameSession/SearchPanel.gd @@ -103,6 +103,8 @@ func _add_result_button() -> bool: return false button.pressed.connect(_result_selected.bind(_result_buttons.size())) + # Country/State/Province display names are already translated in the MenuSingleton + button.auto_translate = false _results_list_box.add_child(child) _result_buttons.push_back(button) |