From 90591e098e1e996adb6e29ab0e65bc61ec78c778 Mon Sep 17 00:00:00 2001 From: VAILLANT Jeremy Date: Sun, 9 May 2021 23:28:45 +0200 Subject: [PATCH] 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 }