Added Localization #8

Merged
EvgeniySugonyako merged 3 commits from develop into production 2024-05-12 16:18:43 +00:00
6 changed files with 71 additions and 17 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,12 @@ 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')
InfoText.visible = GATEWAY.debug
#--------------------------------------------------------------------------------------------------#
# Signals
@ -36,17 +41,17 @@ func _on_login_btn_button_down():
LoginBtn.disabled = true
LoginInput.editable = false
PasswordInput.editable = false
$MainBox/LoginBox/LoginPanelBox/RegistrationButton.disabled = true
InfoText.text = "Try connected to %s on port %s...wait please..." % [GATEWAY.settings.Ip, GATEWAY.settings.Port]
var response = await GATEWAY.connect_to_server()
if response != Error.OK:
InfoText.text = "Error connect to %s on port %s. ERROR: %s" % [GATEWAY.settings.Ip, GATEWAY.settings.Port, error_string(response)]
else:
GATEWAY.rpc_id(1, 'authorization', LoginInput.text, PasswordInput.text.md5_text())
func _on_connected_ok():
InfoText.text = "Connected to %s on port %s" % [GATEWAY.settings.Ip, GATEWAY.settings.Port]
await get_tree().create_timer(5).timeout
GATEWAY.rpc_id(1, 'authorization', LoginInput.text, PasswordInput.text.md5_text())
func _on_server_disconnected():
@ -61,6 +66,7 @@ func _on_connected_fail():
LoginBtn.disabled = false
LoginInput.editable = true
PasswordInput.editable = true
$MainBox/LoginBox/LoginPanelBox/RegistrationButton.disabled = false
func _on_authorization_fail():

View File

@ -101,20 +101,20 @@ theme_override_constants/separation = 10
[node name="LoginLabel" type="Label" parent="MainBox/LoginBox/LoginPanelBox"]
layout_mode = 2
size_flags_vertical = 2
text = "Enter to Cashflow World"
text = "$Enter_to_Cashflow_World"
label_settings = SubResource("LabelSettings_iy7sm")
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"]
layout_mode = 2
size_flags_vertical = 2
placeholder_text = "password"
placeholder_text = "$Password"
alignment = 1
secret = true
@ -126,16 +126,16 @@ theme_override_constants/separation = 10
[node name="LoginBtn" type="Button" parent="MainBox/LoginBox/LoginPanelBox/LoginButtonsBox"]
layout_mode = 2
size_flags_horizontal = 2
text = "Enter"
text = "$Enter"
[node name="ExitBtn" type="Button" parent="MainBox/LoginBox/LoginPanelBox/LoginButtonsBox"]
layout_mode = 2
size_flags_horizontal = 10
text = "Exit"
text = "$Exit"
[node name="RegistrationButton" type="Button" parent="MainBox/LoginBox/LoginPanelBox"]
layout_mode = 2
text = "Registration"
text = "$Registration"
flat = true
[node name="RegistrationPanelBox" type="VBoxContainer" parent="MainBox/LoginBox"]
@ -147,33 +147,33 @@ theme_override_constants/separation = 10
[node name="RegistrationLabel" type="Label" parent="MainBox/LoginBox/RegistrationPanelBox"]
layout_mode = 2
size_flags_vertical = 2
text = "Registrate on Cashflow World"
text = "$Registrate_on_Cashflow_World"
label_settings = SubResource("LabelSettings_iy7sm")
horizontal_alignment = 1
[node name="LoginInput" type="LineEdit" parent="MainBox/LoginBox/RegistrationPanelBox"]
layout_mode = 2
size_flags_vertical = 2
placeholder_text = "login"
placeholder_text = "$Login"
alignment = 1
[node name="NameInput" type="LineEdit" parent="MainBox/LoginBox/RegistrationPanelBox"]
layout_mode = 2
size_flags_vertical = 2
placeholder_text = "nikname"
placeholder_text = "Nikname"
alignment = 1
[node name="PasswordInput" type="LineEdit" parent="MainBox/LoginBox/RegistrationPanelBox"]
layout_mode = 2
size_flags_vertical = 2
placeholder_text = "password"
placeholder_text = "$Password"
alignment = 1
secret = true
[node name="PasswordInput_2" type="LineEdit" parent="MainBox/LoginBox/RegistrationPanelBox"]
layout_mode = 2
size_flags_vertical = 2
placeholder_text = "password repeat"
placeholder_text = "$Password_repeat"
alignment = 1
secret = true
@ -185,12 +185,12 @@ theme_override_constants/separation = 10
[node name="RegistrationBtn" type="Button" parent="MainBox/LoginBox/RegistrationPanelBox/RegistrationButtonsBox"]
layout_mode = 2
size_flags_horizontal = 2
text = "Registrate"
text = "$Registration"
[node name="BackBtn" type="Button" parent="MainBox/LoginBox/RegistrationPanelBox/RegistrationButtonsBox"]
layout_mode = 2
size_flags_horizontal = 10
text = "Back"
text = "$Back"
[node name="InfoBob" type="MarginContainer" parent="MainBox"]
layout_mode = 2

View File

@ -0,0 +1,21 @@
KEYS,en,uk,ru
$Login,Login,Логін,Логин
$Password,Password,Пароль,Пароль
$Registration,Registration, Реєстрація, Регистрация
$Back,Back,Назад,Назад
$Password_repeat,Password repeat,Повтор паролю,Повтор пароля
$Settings,Settings,Налаштування,Настройки
$Enter,Enter,Вхід,Вход
$Exit,Exit,Вихід,Выход
$Language:,Language,Мова,Язык
$Save,Save,Зберегти,Сохранить
$Close,Close,Закрити,Закрыть
$Monday,Monday,Понеділок,Понедельник
$Tuesday,Tuesday,Вівторок,Вторник
$Wednesday,Wednesday,Середа,Среда
$Thursday,Thursday,Четверг,Четверг
$Friday,Friday,П'ятниця,Пятница
$Saturday,Saturday,Субота,Суббота
$Sunday,Sunday,Неділя,Воскресение
$Enter_to_Cashflow_World,Enter to Cashflow World,Увійти у CashFlow всесвіт,Войти в мир CashFlow
$Registrate_on_Cashflow_World,Registrate on Cashflow World,Реєстрація у всесвіті CashFlow,Регистрация в мире CashFlow
1 KEYS en uk ru
2 $Login Login Логін Логин
3 $Password Password Пароль Пароль
4 $Registration Registration Реєстрація Регистрация
5 $Back Back Назад Назад
6 $Password_repeat Password repeat Повтор паролю Повтор пароля
7 $Settings Settings Налаштування Настройки
8 $Enter Enter Вхід Вход
9 $Exit Exit Вихід Выход
10 $Language: Language Мова Язык
11 $Save Save Зберегти Сохранить
12 $Close Close Закрити Закрыть
13 $Monday Monday Понеділок Понедельник
14 $Tuesday Tuesday Вівторок Вторник
15 $Wednesday Wednesday Середа Среда
16 $Thursday Thursday Четверг Четверг
17 $Friday Friday П'ятниця Пятница
18 $Saturday Saturday Субота Суббота
19 $Sunday Sunday Неділя Воскресение
20 $Enter_to_Cashflow_World Enter to Cashflow World Увійти у CashFlow всесвіт Войти в мир CashFlow
21 $Registrate_on_Cashflow_World Registrate on Cashflow World Реєстрація у всесвіті CashFlow Регистрация в мире CashFlow

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