aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/LocaleButton.gd
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-12-24 19:23:18 +0100
committer GitHub <noreply@github.com>2023-12-24 19:23:18 +0100
commitd26c990d9a5596a3ef3b32ba1cb0f99950cd6d34 (patch)
tree1b99c935438692bb2ebadeac412b990c82089b65 /game/src/Game/LocaleButton.gd
parent50b0b935b0bf0724f40b5140aca85d1830a8b1b3 (diff)
parentb6413251a866c76538869b84ed1c9b9852f7c507 (diff)
Merge pull request #178 from Spartan322/add-menu-type-hints
Diffstat (limited to 'game/src/Game/LocaleButton.gd')
-rw-r--r--game/src/Game/LocaleButton.gd10
1 files changed, 5 insertions, 5 deletions
diff --git a/game/src/Game/LocaleButton.gd b/game/src/Game/LocaleButton.gd
index 30a2dab..e315330 100644
--- a/game/src/Game/LocaleButton.gd
+++ b/game/src/Game/LocaleButton.gd
@@ -5,15 +5,15 @@ const setting_name : String = "locale"
var _default_locale_index : int
-func _ready():
+func _ready() -> void:
var locales_country_rename : Dictionary = ProjectSettings.get_setting("internationalization/locale/country_short_name", {})
- var locales_list = TranslationServer.get_loaded_locales()
+ var locales_list := TranslationServer.get_loaded_locales()
var default_locale := Localisation.get_default_locale()
if default_locale not in locales_list:
locales_list.push_back(default_locale)
- for locale in locales_list:
+ for locale : String in locales_list:
# locale_name consists of a compulsory language name and optional script
# and country names, in the format: "<language>[ (script)][, country]"
var locale_name := TranslationServer.get_locale_name(locale)
@@ -33,7 +33,7 @@ func _ready():
Events.Options.load_settings.connect(load_setting)
Events.Options.save_settings.connect(save_setting)
-func _notification(what : int):
+func _notification(what : int) -> void:
match what:
NOTIFICATION_TRANSLATION_CHANGED:
_select_locale_by_string(TranslationServer.get_locale())
@@ -43,7 +43,7 @@ func _valid_index(index : int) -> bool:
func load_setting(file : ConfigFile) -> void:
if file == null: return
- var load_value = file.get_value(section_name, setting_name, Localisation.get_default_locale())
+ var load_value : Variant = file.get_value(section_name, setting_name, Localisation.get_default_locale())
match typeof(load_value):
TYPE_STRING, TYPE_STRING_NAME:
if _select_locale_by_string(load_value as String):