Localization concept added
This commit is contained in:
11
scripts/LocalizationManager.gd
Normal file
11
scripts/LocalizationManager.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Node
|
||||
|
||||
func _ready():
|
||||
# Set default locale if not already set
|
||||
if TranslationServer.get_locale() == "":
|
||||
TranslationServer.set_locale("en")
|
||||
|
||||
func change_language(locale: String):
|
||||
TranslationServer.set_locale(locale)
|
||||
# Signal to update UI elements
|
||||
get_tree().call_group("localizable", "update_text")
|
||||
Reference in New Issue
Block a user