feat: added localization

pull/8/head
Евгений Сугоняко 2024-05-12 18:56:32 +03:00
parent dbf774baef
commit 37ec8170d2
6 changed files with 48 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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"]

View File

@ -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,Неділя,Воскресение
1 KEYS en uk ru
2 $Login Login Логін Логин
3 $Settings Settings Налаштування Настройки
4 $Exit Exit Вихід Выход
5 $Language: Language Мова Язык
6 $Save Save Зберегти Сохранить
7 $Close Close Закрити Закрыть
8 $Monday Monday Понеділок Понедельник
9 $Tuesday Tuesday Вівторок Вторник
10 $Wednesday Wednesday Середа Среда
11 $Thursday Thursday Четверг Четверг
12 $Friday Friday П'ятниця Пятница
13 $Saturday Saturday Субота Суббота
14 $Sunday Sunday Неділя Воскресение

View File

@ -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

View File

@ -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"]