From 206cafc8bba310e4d4f35f4898ef3ac289abe81a Mon Sep 17 00:00:00 2001 From: Hop311 Date: Sat, 10 Jun 2023 20:48:17 +0100 Subject: Localisation and UI focus cleanup Updated Russian localisation Resolution, window_mode, monitor refactor Locale based number formatting --- game/src/Game/Autoload/Events/Localisation.gd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'game/src/Game/Autoload/Events/Localisation.gd') 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)) -- cgit v1.2.3-56-ga3b1