aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Autoload/Events
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-06-10 21:48:17 +0200
committer Hop311 <hop3114@gmail.com>2023-06-23 22:33:15 +0200
commit206cafc8bba310e4d4f35f4898ef3ac289abe81a (patch)
treea662b03f0f3af03b0892e2c9987c4ae128e5790f /game/src/Game/Autoload/Events
parent6e26b948ea2a7632bcb7b795fe78f7169477eb6a (diff)
Localisation and UI focus cleanup
Updated Russian localisation Resolution, window_mode, monitor refactor Locale based number formatting
Diffstat (limited to 'game/src/Game/Autoload/Events')
-rw-r--r--game/src/Game/Autoload/Events/Localisation.gd11
1 files changed, 7 insertions, 4 deletions
diff --git a/game/src/Game/Autoload/Events/Localisation.gd b/game/src/Game/Autoload/Events/Localisation.gd
index eda7e51..9048b7a 100644
--- a/game/src/Game/Autoload/Events/Localisation.gd
+++ b/game/src/Game/Autoload/Events/Localisation.gd
@@ -14,10 +14,10 @@ func get_default_locale() -> String:
return ProjectSettings.get_setting("internationalization/locale/fallback", "en_GB")
func load_localisation(dir_path : String) -> void:
- if LoadLocalisation.load_localisation_dir(dir_path) == OK:
- print("loaded locales: ", TranslationServer.get_loaded_locales())
- else:
- push_error("Failed to load localisation directory: ", dir_path)
+ if LoadLocalisation.load_localisation_dir(dir_path) != OK:
+ push_error("Error loading localisation directory: ", dir_path)
+ var loaded_locales : PackedStringArray = TranslationServer.get_loaded_locales()
+ print("Loaded ", loaded_locales.size(), " locales: ", loaded_locales)
# REQUIREMENTS
# * SS-57
@@ -28,3 +28,6 @@ func _init():
push_error("Missing localisation_path setting!")
else:
load_localisation(localisation_dir_path)
+
+func tr_number(num) -> String:
+ return TextServerManager.get_primary_interface().format_number(str(num))