From 90591e098e1e996adb6e29ab0e65bc61ec78c778 Mon Sep 17 00:00:00 2001 From: VAILLANT Jeremy Date: Sun, 9 May 2021 23:28:45 +0200 Subject: [PATCH 1/3] Configure locales for main scene --- locales/en.mo | Bin 0 -> 322 bytes locales/en.po | 24 ++++++++++++++++++++++++ locales/fr.mo | Bin 0 -> 326 bytes locales/fr.po | 24 ++++++++++++++++++++++++ project.godot | 5 +++++ scenes/main.gd | 7 +++++++ scenes/main.tscn | 2 +- 7 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 locales/en.mo create mode 100644 locales/en.po create mode 100644 locales/fr.mo create mode 100644 locales/fr.po diff --git a/locales/en.mo b/locales/en.mo new file mode 100644 index 0000000000000000000000000000000000000000..4b38a20290fcdc4e221789f4ea011eb75fe1c2e2 GIT binary patch literal 322 zcmYL@u};H442BN`OC**KObo{i7bs$=0t^UBRf(zr1;mDq#0`g1Uvy^>eGs0Cci>t0 z(+>INPnIqFxBmt^KML9g2jCd&f=kdT2YcWF{DN1o5018!Lag_YdM#Xtk}fGmTa(Iz z|DaOLv@*{WqVt^TB%hl{`f^=mZmken_cn?tg5}s)@nPNJ`V$tWAiG38o6g3)$1puj zZafPy)>bVngudmZZLH%9UB258Nv@uXJ2UF%I{O6$Gv?A)j_XX1-kjj}=2E7KlNU1~ irm%S;_f$F2XX$x5Ow@JTHm08 literal 0 HcmV?d00001 diff --git a/locales/en.po b/locales/en.po new file mode 100644 index 0000000..ba95933 --- /dev/null +++ b/locales/en.po @@ -0,0 +1,24 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"X-Generator: Poedit 2.4.1\n" + +msgid "MAIN_BUTTON_NEW" +msgstr "Start game" + +msgid "MAIN_BUTTON_CONTINUE" +msgstr "Continue" + +msgid "MAIN_BUTTON_ABOUT" +msgstr "About" + +msgid "MAIN_BUTTON_QUIT" +msgstr "Exit" diff --git a/locales/fr.mo b/locales/fr.mo new file mode 100644 index 0000000000000000000000000000000000000000..762c1b0d0b9d5b13e408da4299d9d2a4c69c1431 GIT binary patch literal 326 zcmYL@u};H442BN`OC*+#h~bzR-~vSqRe%XfRjCyL1;mDq#0iJeyVIRP@F2VduffPW z^jY}R4*BIzmM#0YmxHZu0d0aka0Ir&1?ZH69dHN!z%$qdhZ{m5R(nXjY7-)-3yM)U zB=X?isAM&*)FXvxoXupC->Q51FkPjtH4|Dh9a$AY+t_M$Vb!tCJ1kT|dVzXAosWBu zVS18WIm=|R_T^#0^vTD*)yAI7@>PdOeECq^s8K)H+1C`**p{v`w#nq^#V~HKFJ-b0 o$&;FprLcY?cT^dcr|DTbOvLO!d*7N;Gai=|S^Dt%!zA~`KPH1$NB{r; literal 0 HcmV?d00001 diff --git a/locales/fr.po b/locales/fr.po new file mode 100644 index 0000000..c8b73cd --- /dev/null +++ b/locales/fr.po @@ -0,0 +1,24 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: fr\n" +"X-Generator: Poedit 2.4.1\n" + +msgid "MAIN_BUTTON_NEW" +msgstr "Commencer" + +msgid "MAIN_BUTTON_CONTINUE" +msgstr "Continue" + +msgid "MAIN_BUTTON_ABOUT" +msgstr "Credit" + +msgid "MAIN_BUTTON_QUIT" +msgstr "Quit" diff --git a/project.godot b/project.godot index 6d2e6fb..47493f8 100644 --- a/project.godot +++ b/project.godot @@ -33,6 +33,11 @@ ui_end={ ] } +[locale] + +translations=PoolStringArray( "res://locales/fr.po", "res://locales/en.po" ) +locale_filter=[ 0, [ "en_US", "fr_FR" ] ] + [physics] common/enable_pause_aware_picking=true diff --git a/scenes/main.gd b/scenes/main.gd index db3aa23..db48726 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -5,6 +5,13 @@ export (PackedScene) var scenes = load("res://scenes/UI/ChooseScene.tscn") var current_scene = null +func _ready(): + print(tr("MESSAGE_READY")) + $Grid/Menu/Action/New.text = tr("MAIN_BUTTON_NEW") + $Grid/Menu/Action/Continue.text = tr("MAIN_BUTTON_CONTINUE") + $Grid/Menu/Action/About.text = tr("MAIN_BUTTON_ABOUT") + $Grid/Menu/Action/Quit.text = tr("MAIN_BUTTON_QUIT") + # Quit the game func _on_Quit_pressed(): get_tree().quit(0) diff --git a/scenes/main.tscn b/scenes/main.tscn index fb451d0..ac0e000 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -82,7 +82,7 @@ margin_top = 30.0 margin_right = 130.0 margin_bottom = 64.0 custom_fonts/font = ExtResource( 3 ) -text = "Nouveau" +text = "new" __meta__ = { "_edit_use_anchors_": false } From 0de0aa262b15f0a3f9c10ca7671a70880f3ee1c5 Mon Sep 17 00:00:00 2001 From: VAILLANT Jeremy Date: Sun, 9 May 2021 23:32:43 +0200 Subject: [PATCH 2/3] Add translate for loading scene --- locales/en.po | 3 +++ locales/fr.po | 3 +++ scenes/UI/Loading.gd | 4 ++++ scenes/UI/Loading.tscn | 5 ++++- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 scenes/UI/Loading.gd diff --git a/locales/en.po b/locales/en.po index ba95933..c2b9af8 100644 --- a/locales/en.po +++ b/locales/en.po @@ -22,3 +22,6 @@ msgstr "About" msgid "MAIN_BUTTON_QUIT" msgstr "Exit" + +msgid "LOADING" +msgstr "Loading ..." diff --git a/locales/fr.po b/locales/fr.po index c8b73cd..0276b3c 100644 --- a/locales/fr.po +++ b/locales/fr.po @@ -22,3 +22,6 @@ msgstr "Credit" msgid "MAIN_BUTTON_QUIT" msgstr "Quit" + +msgid "LOADING" +msgstr "Chargement ..." diff --git a/scenes/UI/Loading.gd b/scenes/UI/Loading.gd new file mode 100644 index 0000000..ba215df --- /dev/null +++ b/scenes/UI/Loading.gd @@ -0,0 +1,4 @@ +extends Control + +func _ready(): + $ColorRect/CenterContainer/VBoxContainer/Label.text = tr("LOADING") diff --git a/scenes/UI/Loading.tscn b/scenes/UI/Loading.tscn index 57cf412..ce533df 100644 --- a/scenes/UI/Loading.tscn +++ b/scenes/UI/Loading.tscn @@ -1,8 +1,11 @@ -[gd_scene format=2] +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://scenes/UI/Loading.gd" type="Script" id=1] [node name="Control" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 +script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": false } From c70fbdbfd7d74fd4480724700185e277917dbc90 Mon Sep 17 00:00:00 2001 From: VAILLANT Jeremy Date: Sun, 9 May 2021 23:41:47 +0200 Subject: [PATCH 3/3] Translate about scene --- locales/en.po | 9 +++++++ locales/fr.po | 9 +++++++ scenes/UI/About.tscn | 62 ++++++++++++++++++++++++++++++-------------- 3 files changed, 61 insertions(+), 19 deletions(-) diff --git a/locales/en.po b/locales/en.po index c2b9af8..5a1980f 100644 --- a/locales/en.po +++ b/locales/en.po @@ -25,3 +25,12 @@ msgstr "Exit" msgid "LOADING" msgstr "Loading ..." + +msgid "ABOUT_LEAD_DEV" +msgstr "Lead Developer -- VAILLANT Jérémy" + +msgid "ABOUT_LEAD_ARTIST" +msgstr "Lead Artist -- VAILLANT Aurélien" + +msgid "ABOUT_SOURCE_GAME" +msgstr "Source code of game : https://dev.stilobique.com/Athena/game-source" diff --git a/locales/fr.po b/locales/fr.po index 0276b3c..aa4b8ce 100644 --- a/locales/fr.po +++ b/locales/fr.po @@ -25,3 +25,12 @@ msgstr "Quit" msgid "LOADING" msgstr "Chargement ..." + +msgid "ABOUT_LEAD_DEV" +msgstr "Lead Developer -- VAILLANT Jérémy" + +msgid "ABOUT_LEAD_ARTIST" +msgstr "Lead Artist -- VAILLANT Aurélien" + +msgid "ABOUT_SOURCE_GAME" +msgstr "Code source du jeux : https://dev.stilobique.com/Athena/game-source" diff --git a/scenes/UI/About.tscn b/scenes/UI/About.tscn index 3eab727..e308668 100644 --- a/scenes/UI/About.tscn +++ b/scenes/UI/About.tscn @@ -3,35 +3,59 @@ [sub_resource type="GDScript" id=1] script/source = "extends Node - -# Called when the node enters the scene tree for the first time. func _ready(): - pass # Replace with function body. - -func _on_Return_pressed(): - get_tree().change_scene(\"res://scenes/main.tscn\") + $CenterContainer/VBoxContainer/LeadDev.text = tr(\"ABOUT_LEAD_DEV\") + $CenterContainer/VBoxContainer/LeadArtist.text = tr(\"ABOUT_LEAD_ARTIST\") + $CenterContainer/VBoxContainer/Sources.text = tr(\"ABOUT_SOURCE_GAME\") " [node name="About" type="Node"] script = SubResource( 1 ) -[node name="GRem" type="Label" parent="."] -margin_left = 350.0 -margin_top = 150.0 -margin_right = 616.0 -margin_bottom = 181.0 -text = "Lead Develop : GRem -- VAILLANT Jérémy -" +[node name="CenterContainer" type="CenterContainer" parent="."] +margin_left = 150.0 +margin_right = 1024.0 +margin_bottom = 600.0 __meta__ = { "_edit_use_anchors_": false } -[node name="Stilobique" type="Label" parent="."] -margin_left = 500.0 -margin_top = 300.0 -margin_right = 783.0 -margin_bottom = 331.0 -text = "Lead Artist : Stilobique -- VAILLANT Aurelien" +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +margin_left = 210.0 +margin_top = 275.0 +margin_right = 663.0 +margin_bottom = 325.0 +alignment = 1 + +[node name="LeadDev" type="Label" parent="CenterContainer/VBoxContainer"] +anchor_top = -0.38 +anchor_bottom = -0.38 +margin_right = 453.0 +margin_bottom = 14.0 +text = "Lead Develop : GRem -- VAILLANT Jérémy" +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="LeadArtist" type="Label" parent="CenterContainer/VBoxContainer"] +margin_top = 18.0 +margin_right = 453.0 +margin_bottom = 32.0 +text = "Lead Artist : Stilobique -- VAILLANT Aurelien" +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Sources" type="Label" parent="CenterContainer/VBoxContainer"] +anchor_top = 0.32 +anchor_bottom = 0.32 +margin_top = 36.0 +margin_right = 453.0 +margin_bottom = 50.0 +text = "Source code of game : https://dev.stilobique.com/Athena/game-source" +align = 1 __meta__ = { "_edit_use_anchors_": false }