aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession/ProvinceOverviewPanel.gd
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-08-01 00:17:32 +0200
committer hop311 <hop3114@gmail.com>2024-08-02 22:54:08 +0200
commit06b76612b28183f0a047dac3a4127120d2af1b39 (patch)
tree9e7af8634eafc8461bd02697dd48ae36ca924858 /game/src/Game/GameSession/ProvinceOverviewPanel.gd
parent8431914a6971cbacfb20bba13a4113d9ac4d5153 (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/Game/GameSession/ProvinceOverviewPanel.gd')
-rw-r--r--game/src/Game/GameSession/ProvinceOverviewPanel.gd12
1 files changed, 7 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)