diff options
author | Hop311 <Hop3114@gmail.com> | 2023-06-24 00:55:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-24 00:55:45 +0200 |
commit | 432000a3ab73980fc6421b3587de4b97af30d3ad (patch) | |
tree | 4b80d98261252f25011e34b22a8d49767525559f /game/src/Game/Autoload/Events/Localisation.gd | |
parent | 40cf0fa95e325f3bf875e42c11254da23192f506 (diff) | |
parent | 206cafc8bba310e4d4f35f4898ef3ac289abe81a (diff) |
Merge pull request #131 from OpenVicProject/ui-cleanup
Localisation and UI focus cleanup
Diffstat (limited to 'game/src/Game/Autoload/Events/Localisation.gd')
-rw-r--r-- | game/src/Game/Autoload/Events/Localisation.gd | 11 |
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 91f9ca0..37b550d 100644 --- a/game/src/Game/Autoload/Events/Localisation.gd +++ b/game/src/Game/Autoload/Events/Localisation.gd @@ -15,10 +15,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 @@ -29,3 +29,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)) |