aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Autoload/Events/Localisation.gd
diff options
context:
space:
mode:
Diffstat (limited to 'game/src/Game/Autoload/Events/Localisation.gd')
-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))