diff --git a/data/scenes/Lobbies.tscn b/data/scenes/Lobbies.tscn index 80a9c17..57d54dc 100644 --- a/data/scenes/Lobbies.tscn +++ b/data/scenes/Lobbies.tscn @@ -2,7 +2,16 @@ [node name="Lobbies" type="Node"] -[node name="Background" type="ColorRect" parent="."] +[node name="LobbieUI" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Background" type="ColorRect" parent="LobbieUI"] +layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 diff --git a/data/scenes/main_menu/main_menu.gd b/data/scenes/main_menu/main_menu.gd index 9559ea0..6e22fad 100644 --- a/data/scenes/main_menu/main_menu.gd +++ b/data/scenes/main_menu/main_menu.gd @@ -24,7 +24,11 @@ func _ready(): GATEWAY.authorizated.connect(_on_authorization_ok) GATEWAY.unregistrated.connect(_on_registration_fail) GATEWAY.registrated.connect(_on_registration_ok) - + var languages : Array = ['en', 'uk', 'ru'] + if OS.get_locale_language() in languages: + TranslationServer.set_locale(OS.get_locale_language()) + else: + TranslationServer.set_locale('en') #--------------------------------------------------------------------------------------------------# # Signals diff --git a/data/scenes/main_menu/main_menu.tscn b/data/scenes/main_menu/main_menu.tscn index 92dc474..f0ff1c8 100644 --- a/data/scenes/main_menu/main_menu.tscn +++ b/data/scenes/main_menu/main_menu.tscn @@ -108,7 +108,7 @@ horizontal_alignment = 1 [node name="LoginInput" type="LineEdit" parent="MainBox/LoginBox/LoginPanelBox"] layout_mode = 2 size_flags_vertical = 2 -placeholder_text = "login" +placeholder_text = "$Login" alignment = 1 [node name="PasswordInput" type="LineEdit" parent="MainBox/LoginBox/LoginPanelBox"] diff --git a/data/styles/locale/localization.csv b/data/styles/locale/localization.csv new file mode 100644 index 0000000..672da3c --- /dev/null +++ b/data/styles/locale/localization.csv @@ -0,0 +1,14 @@ +KEYS,en,uk,ru +$Login,Login,Логін,Логин +$Settings,Settings,Налаштування,Настройки +$Exit,Exit,Вихід,Выход +$Language:,Language,Мова,Язык +$Save,Save,Зберегти,Сохранить +$Close,Close,Закрити,Закрыть +$Monday,Monday,Понеділок,Понедельник +$Tuesday,Tuesday,Вівторок,Вторник +$Wednesday,Wednesday,Середа,Среда +$Thursday,Thursday,Четверг,Четверг +$Friday,Friday,П'ятниця,Пятница +$Saturday,Saturday,Субота,Суббота +$Sunday,Sunday,Неділя,Воскресение diff --git a/data/styles/locale/localization.csv.import b/data/styles/locale/localization.csv.import new file mode 100644 index 0000000..dc46e90 --- /dev/null +++ b/data/styles/locale/localization.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://vf5kjlmmdtfx" + +[deps] + +files=["res://data/styles/locale/localization.en.translation", "res://data/styles/locale/localization.uk.translation", "res://data/styles/locale/localization.ru.translation"] + +source_file="res://data/styles/locale/localization.csv" +dest_files=["res://data/styles/locale/localization.en.translation", "res://data/styles/locale/localization.uk.translation", "res://data/styles/locale/localization.ru.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/project.godot b/project.godot index 475104a..99287b2 100644 --- a/project.godot +++ b/project.godot @@ -56,6 +56,7 @@ theme/default_font_hinting=2 [internationalization] rendering/root_node_layout_direction=1 +locale/translations=PackedStringArray("res://data/styles/locale/localization.en.translation", "res://data/styles/locale/localization.ru.translation", "res://data/styles/locale/localization.uk.translation") locale/test="ru" rendering/text_driver="ICU / HarfBuzz / Graphite (Built-in)" locale/language_filter=["en", "ru", "uk"]