diff --git a/kalulu_localization.csv b/kalulu_localization.csv new file mode 100644 index 00000000..03b40a17 --- /dev/null +++ b/kalulu_localization.csv @@ -0,0 +1,31 @@ +keys;fr;es +LOGGED_AS;Connecté en tant que;Conectado como : +BUILD_VERSION;Numéro de version;Número de versión : +DEVICE_ID;Numéro d'appareil; +LANGUAGE;Langue; +SIGN_IN_TEACHER;Connexion enseignant; +SIGN_IN_PARENT;Connexion parent; +CREATE_ACCOUNT;Création de compte; +LOGIN;Identifiants; +EMAIL;Adresse mail; +PASSWORD;Mot de passe; +LOG_IN;Se connecter; +INVALID_EMAIL_OR_PASSWORD;Adresse mail ou mot de passe invalide; +DEVICE_NUMBER;Appareil n° {number}; +SETTINGS;Paramètres; +ADULT_CHECK_PROMPT;"Veuillez confirmer que vous êtes un adulte ! +Appuyez sur les touches {1}, {2} et {3}"; +STAR;Étoile; +BAR;Barre; +CIRCLE;Cercle; +PLUS;Plus; +SQUARE;Carré; +TRIANGLE;Triangle; +DOWNLOADING_DATA;Téléchargement des données...; +BACK;Précédent; +NEXT;Suivant; +CANCEL;Annuler; +ACCOUNT_TYPE_PROMPT;Veuillez sélectionner le type de compte que vous souhaitez créer; +ACCOUNT_TYPE;Type de compte; +TEACHER;Enseignant; +PARENT;Parent; \ No newline at end of file diff --git a/kalulu_localization.csv.import b/kalulu_localization.csv.import new file mode 100644 index 00000000..11f87b96 --- /dev/null +++ b/kalulu_localization.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://ccpq4mu4yjj71" + +[deps] + +files=["res://kalulu_localization.fr.translation", "res://kalulu_localization.es.translation"] + +source_file="res://kalulu_localization.csv" +dest_files=["res://kalulu_localization.fr.translation", "res://kalulu_localization.es.translation"] + +[params] + +compress=true +delimiter=1 diff --git a/kalulu_localization.es.translation b/kalulu_localization.es.translation new file mode 100644 index 00000000..16cd0b2f Binary files /dev/null and b/kalulu_localization.es.translation differ diff --git a/kalulu_localization.fr.translation b/kalulu_localization.fr.translation new file mode 100644 index 00000000..4bcc8ead Binary files /dev/null and b/kalulu_localization.fr.translation differ diff --git a/kalulu_localization.numbers b/kalulu_localization.numbers new file mode 100755 index 00000000..fe1c29f1 Binary files /dev/null and b/kalulu_localization.numbers differ diff --git a/project.godot b/project.godot index a3fa7f69..a0869fa9 100644 --- a/project.godot +++ b/project.godot @@ -73,6 +73,7 @@ right_click={ [internationalization] locale/translation_remaps={} +locale/translations=PackedStringArray("res://kalulu_localization.es.translation", "res://kalulu_localization.fr.translation") [rendering] diff --git a/resources/device_settings.gd b/resources/device_settings.gd index 3e417bd1..f2288dbe 100644 --- a/resources/device_settings.gd +++ b/resources/device_settings.gd @@ -11,6 +11,7 @@ const supported_locales: Array[String] = [ language = value Database.language = value TranslationServer.set_locale(value) + print(TranslationServer.get_locale()) @export var teacher : String @export var device_id : int diff --git a/sources/menus/adult_check/adult_check.gd b/sources/menus/adult_check/adult_check.gd index d30f9e96..7528083c 100644 --- a/sources/menus/adult_check/adult_check.gd +++ b/sources/menus/adult_check/adult_check.gd @@ -3,22 +3,20 @@ extends Control const main_menu_scene_path: = "res://sources/menus/main/main_menu.tscn" const register_scene_path := "res://sources/menus/register/register.tscn" const symbols_names = { - "1" : "star", - "2" : "bar", - "3" : "circle", - "4" : "plus", - "5" : "square", - "6" : "triangle", + "1" : "STAR", + "2" : "BAR", + "3" : "CIRCLE", + "4" : "PLUS", + "5" : "SQUARE", + "6" : "TRIANGLE", } @onready var code_keyboard : CodeKeyboard = %CodeKeyboard @onready var password_label : Label = %PasswordLabel -var base_password_label_text : String var password : String = "" func _ready() -> void: - base_password_label_text = password_label.text _reset_password() OpeningCurtain.open() @@ -27,7 +25,13 @@ func _ready() -> void: func _reset_password() -> void: password = TeacherSettings.available_codes.pick_random() var password_array: = password.split("") - password_label.text = base_password_label_text % [symbols_names[password_array[0]], symbols_names[password[1]], symbols_names[password[2]]] + password_label.text = tr("ADULT_CHECK_PROMPT").format( + { + "1" : tr(symbols_names[password_array[0]]), + "2" : tr(symbols_names[password_array[1]]), + "3" : tr(symbols_names[password_array[2]]) + } + ) func _on_back_button_pressed() -> void: diff --git a/sources/menus/adult_check/adult_check.tscn b/sources/menus/adult_check/adult_check.tscn index 40c87e9b..94d1aee0 100644 --- a/sources/menus/adult_check/adult_check.tscn +++ b/sources/menus/adult_check/adult_check.tscn @@ -46,8 +46,6 @@ custom_minimum_size = Vector2(1500, 500) layout_mode = 2 size_flags_vertical = 1 theme_override_font_sizes/font_size = 70 -text = "Please confirm you are an adult ! -Press the %s, %s and %s" horizontal_alignment = 1 vertical_alignment = 1 autowrap_mode = 2 diff --git a/sources/menus/language_selection/local_package_downloader.tscn b/sources/menus/language_selection/local_package_downloader.tscn index b5e7e9c4..824a713f 100644 --- a/sources/menus/language_selection/local_package_downloader.tscn +++ b/sources/menus/language_selection/local_package_downloader.tscn @@ -46,7 +46,7 @@ layout_mode = 2 layout_mode = 2 size_flags_vertical = 3 theme_override_font_sizes/font_size = 90 -text = "Téléchargement des données..." +text = "DOWNLOADING_DATA" horizontal_alignment = 1 vertical_alignment = 1 diff --git a/sources/menus/login/login.gd b/sources/menus/login/login.gd index a35bcf7e..c82903a9 100644 --- a/sources/menus/login/login.gd +++ b/sources/menus/login/login.gd @@ -28,7 +28,7 @@ func _ready(): if UserDataManager.teacher_settings and UserDataManager.teacher_settings.account_type == TeacherSettings.AccountType.Teacher: device_number_label.show() - device_number_label.text += str(UserDataManager.get_device_settings().device_id) + device_number_label.text = tr("DEVICE_NUMBER").format({"number" : UserDataManager.get_device_settings().device_id}) await OpeningCurtain.open() diff --git a/sources/menus/login/login.tscn b/sources/menus/login/login.tscn index 1a740b90..02b91d78 100644 --- a/sources/menus/login/login.tscn +++ b/sources/menus/login/login.tscn @@ -41,7 +41,6 @@ offset_right = 158.5 offset_bottom = 176.0 grow_horizontal = 2 theme_override_font_sizes/font_size = 70 -text = "DEVICE n°" [node name="CodeKeyboard" parent="." instance=ExtResource("5_xwrca")] layout_mode = 1 @@ -96,7 +95,7 @@ theme_override_constants/margin_bottom = 50 layout_mode = 2 size_flags_vertical = 8 theme_override_font_sizes/font_size = 70 -text = "Teacher" +text = "SETTINGS" [node name="TeacherTimer" type="Timer" parent="InterfaceRight/TeacherButton"] wait_time = 5.0 diff --git a/sources/menus/main/main_menu.tscn b/sources/menus/main/main_menu.tscn index 0552658e..78a688a8 100644 --- a/sources/menus/main/main_menu.tscn +++ b/sources/menus/main/main_menu.tscn @@ -200,7 +200,7 @@ theme_override_constants/separation = 0 [node name="LanguageLabel" type="Label" parent="UserSelection/Form/LanguageContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 70 -text = "Language" +text = "LANGUAGE" [node name="LanguageField" type="OptionButton" parent="UserSelection/Form/LanguageContainer"] unique_name_in_owner = true @@ -212,21 +212,19 @@ script = ExtResource("13_rs3hd") [node name="SignInTeacher" type="Button" parent="UserSelection/Form"] layout_mode = 2 theme_override_font_sizes/font_size = 70 -text = "Sign-in teacher account -" +text = "SIGN_IN_TEACHER" metadata/_edit_use_anchors_ = true [node name="SignInParent" type="Button" parent="UserSelection/Form"] layout_mode = 2 theme_override_font_sizes/font_size = 70 -text = "Sign-in parent account -" +text = "SIGN_IN_PARENT" metadata/_edit_use_anchors_ = true [node name="Register" type="Button" parent="UserSelection/Form"] layout_mode = 2 theme_override_font_sizes/font_size = 70 -text = "Create an account" +text = "CREATE_ACCOUNT" metadata/_edit_use_anchors_ = true [node name="LoginForm" type="Control" parent="."] @@ -249,7 +247,7 @@ offset_top = 168.0 offset_bottom = 286.0 grow_horizontal = 2 theme_override_font_sizes/font_size = 90 -text = "Teacher login" +text = "SIGN_IN_TEACHER" horizontal_alignment = 1 vertical_alignment = 1 @@ -263,7 +261,7 @@ offset_top = 168.0 offset_bottom = 286.0 grow_horizontal = 2 theme_override_font_sizes/font_size = 90 -text = "Parent login" +text = "SIGN_IN_PARENT" horizontal_alignment = 1 vertical_alignment = 1 @@ -302,7 +300,7 @@ theme_override_constants/separation = 0 [node name="DeviceIDLabel" type="Label" parent="LoginForm/LoginFormValidator/FormContainer/DeviceIDContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 70 -text = "Device number" +text = "DEVICE_ID" [node name="DeviceIDField" type="SpinBox" parent="LoginForm/LoginFormValidator/FormContainer/DeviceIDContainer"] unique_name_in_owner = true @@ -330,14 +328,14 @@ theme_override_constants/separation = 0 layout_mode = 2 theme = ExtResource("15_pcmnw") theme_override_font_sizes/font_size = 70 -text = "Login" +text = "LOGIN" [node name="EmailField" type="LineEdit" parent="LoginForm/LoginFormValidator/FormContainer/EmailContainer"] unique_name_in_owner = true layout_mode = 2 theme_type_variation = &"1" theme_override_font_sizes/font_size = 70 -placeholder_text = "Email" +placeholder_text = "EMAIL" [node name="EmailValidator" type="Node" parent="LoginForm/LoginFormValidator/FormContainer/EmailContainer/EmailField"] script = ExtResource("18_iunlb") @@ -355,7 +353,7 @@ theme_override_constants/separation = 0 unique_name_in_owner = true layout_mode = 2 theme_override_font_sizes/font_size = 70 -placeholder_text = "Password" +placeholder_text = "PASSWORD" secret = true [node name="PasswordValidator" type="Node" parent="LoginForm/LoginFormValidator/FormContainer/PasswordContainer/PasswordField"] @@ -370,13 +368,13 @@ layout_mode = 2 layout_mode = 2 size_flags_vertical = 8 theme_override_font_sizes/font_size = 70 -text = "Log in" +text = "LOG_IN" [node name="LoginError" type="Label" parent="LoginForm/LoginFormValidator/FormContainer"] unique_name_in_owner = true visible = false layout_mode = 2 -text = "Invalid username or password" +text = "INVALID_EMAIL_OR_PASSWORD" [node name="InterfaceLeft" type="MarginContainer" parent="."] unique_name_in_owner = true @@ -417,7 +415,7 @@ offset_left = 10.0 offset_right = 261.0 offset_bottom = 56.0 theme_override_font_sizes/font_size = 30 -text = "Build Version :" +text = "BUILD_VERSION" vertical_alignment = 1 [node name="BuildVersionValue" type="Label" parent="Informations"] @@ -436,7 +434,7 @@ offset_top = 56.0 offset_right = 261.0 offset_bottom = 112.0 theme_override_font_sizes/font_size = 30 -text = "Logged as :" +text = "LOGGED_AS" vertical_alignment = 1 [node name="TeacherValue" type="Label" parent="Informations"] @@ -456,7 +454,7 @@ offset_top = 112.0 offset_right = 261.0 offset_bottom = 168.0 theme_override_font_sizes/font_size = 30 -text = "Device Id :" +text = "DEVICE_ID" vertical_alignment = 1 [node name="DeviceIDValue" type="Label" parent="Informations"] diff --git a/sources/menus/register/steps/account_type_step.gd b/sources/menus/register/steps/account_type_step.gd index bb6d0afb..1560731f 100644 --- a/sources/menus/register/steps/account_type_step.gd +++ b/sources/menus/register/steps/account_type_step.gd @@ -1,5 +1,12 @@ extends Step +@onready var type: = %TypeSelect + +func _ready() -> void: + type.add_item(tr("TEACHER")) + type.add_item(tr("PARENT")) + + func _on_next() -> bool: var register_data = data as TeacherSettings if register_data: diff --git a/sources/menus/register/steps/account_type_step.tscn b/sources/menus/register/steps/account_type_step.tscn index 514514d8..a1a58aa9 100644 --- a/sources/menus/register/steps/account_type_step.tscn +++ b/sources/menus/register/steps/account_type_step.tscn @@ -22,36 +22,32 @@ rules = Array[Resource("res://addons/godot-form-validator/rules/validator_rule.g [node name="AccountTypeStep" instance=ExtResource("1_g51ml")] script = ExtResource("2_k6524") step_name = "type" -question = "Choose the type of account" +question = "ACCOUNT_TYPE_PROMPT" [node name="BackButton" parent="LeftMargin/LeftContainer" index="0"] -text = "Cancel" - -[node name="QuestionLabel" parent="PanelContainer/QuestionContainer" index="0"] -text = "Choose the type of account" +text = "CANCEL" [node name="TypeContainer" type="HBoxContainer" parent="Background/FormMargin/FormValidator/FormBinder/FormContainer" index="0"] layout_mode = 2 +theme_override_constants/separation = 20 [node name="TypeSelectLabel" type="Label" parent="Background/FormMargin/FormValidator/FormBinder/FormContainer/TypeContainer" index="0"] custom_minimum_size = Vector2(350, 0) layout_mode = 2 size_flags_vertical = 1 theme_override_font_sizes/font_size = 70 -text = "Type :" +text = "ACCOUNT_TYPE" [node name="VBoxContainer" type="VBoxContainer" parent="Background/FormMargin/FormValidator/FormBinder/FormContainer/TypeContainer" index="1"] layout_mode = 2 size_flags_horizontal = 3 [node name="TypeSelect" type="ItemList" parent="Background/FormMargin/FormValidator/FormBinder/FormContainer/TypeContainer/VBoxContainer" index="0"] +unique_name_in_owner = true layout_mode = 2 theme_override_font_sizes/font_size = 70 allow_search = false auto_height = true -item_count = 2 -item_0/text = "Teacher" -item_1/text = "Parent" [node name="ControlValidator" type="Node" parent="Background/FormMargin/FormValidator/FormBinder/FormContainer/TypeContainer/VBoxContainer/TypeSelect" index="1"] script = ExtResource("2_hidu6") diff --git a/sources/menus/register/steps/base_step.tscn b/sources/menus/register/steps/base_step.tscn index 3f7f8d33..eaa87e63 100644 --- a/sources/menus/register/steps/base_step.tscn +++ b/sources/menus/register/steps/base_step.tscn @@ -15,7 +15,6 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_02ocl") -infos = null [node name="LeftMargin" type="MarginContainer" parent="."] custom_minimum_size = Vector2(450, 2.08165e-12) @@ -40,7 +39,7 @@ alignment = 2 [node name="BackButton" type="Button" parent="LeftMargin/LeftContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 70 -text = "Back" +text = "BACK" icon = ExtResource("2_41tvo") [node name="RightMargin" type="MarginContainer" parent="."] @@ -69,7 +68,7 @@ alignment = 2 [node name="ValidateButton" type="Button" parent="RightMargin/RightContainer"] layout_mode = 2 theme_override_font_sizes/font_size = 70 -text = "Next" +text = "NEXT" icon = ExtResource("3_17uns") icon_alignment = 2