From e9a17934e71d8e101090ed8a53c63473076cb0e8 Mon Sep 17 00:00:00 2001 From: AleaJactaEst Date: Sat, 12 Feb 2022 20:45:44 +0100 Subject: [PATCH] #5 - adding menu language & quit --- UI/labels.tscn | 4 +- locales/en.po | 31 +++++++++++++ locales/fr.po | 31 +++++++++++++ locales/locale.sh | 27 ++++++++++++ locales/messages.mo | Bin 0 -> 3190 bytes locales/messages.pot | 21 +++++++++ main.tscn | 11 ----- player/player.gd | 8 ++-- project.godot | 12 ++++- scenes/hud/hud.gd | 27 ++++++++++++ scenes/hud/hud.tscn | 75 ++++++++++++++++++++++++++++++++ scenes/languages/languages.gd | 44 +++++++++++++++++++ scenes/languages/languages.tscn | 37 ++++++++++++++++ scenes/main/main.tscn | 14 ++++++ 14 files changed, 324 insertions(+), 18 deletions(-) create mode 100644 locales/en.po create mode 100644 locales/fr.po create mode 100755 locales/locale.sh create mode 100644 locales/messages.mo create mode 100644 locales/messages.pot delete mode 100644 main.tscn create mode 100644 scenes/hud/hud.gd create mode 100644 scenes/hud/hud.tscn create mode 100644 scenes/languages/languages.gd create mode 100644 scenes/languages/languages.tscn create mode 100644 scenes/main/main.tscn diff --git a/UI/labels.tscn b/UI/labels.tscn index 718df6a..943c7f9 100644 --- a/UI/labels.tscn +++ b/UI/labels.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=4 format=3] +[gd_scene load_steps=4 format=3 uid="uid://cfld6w0cve6gw"] -[ext_resource type="Texture2D" path="res://UI/textures/marker.png" id="1_2jmfe"] +[ext_resource type="Texture2D" uid="uid://buv7yoovo0sw" path="res://UI/textures/marker.png" id="1_2jmfe"] [ext_resource type="Script" path="res://UI/labels.gd" id="1_4t0l0"] [sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_4fvmj"] diff --git a/locales/en.po b/locales/en.po new file mode 100644 index 0000000..5885d1f --- /dev/null +++ b/locales/en.po @@ -0,0 +1,31 @@ +# Don't remove the two lines below, they're required for gettext to work correctly. +msgid "" +msgstr "" +"Project-Id-Version: khanat-client 1\n" +"PO-Revision-Date: 1\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Echap = Menu" +msgstr "Echap to show menu" + +msgid "Keys" +msgstr "Control" + +msgid "Languages" +msgstr "Languages" + +msgid "Language" +msgstr "Language" + +msgid "Select Language" +msgstr "Select your language" + +msgid "Quit" +msgstr "Exit" + diff --git a/locales/fr.po b/locales/fr.po new file mode 100644 index 0000000..de844ca --- /dev/null +++ b/locales/fr.po @@ -0,0 +1,31 @@ +# Don't remove the two lines below, they're required for gettext to work correctly. +msgid "" +msgstr "" +"Project-Id-Version: khanat-client 1\n" +"PO-Revision-Date: 1\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +msgid "Echap = Menu" +msgstr "Appuyer sur Echap pour faire appaître le menu" + +msgid "Keys" +msgstr "Contrôles" + +msgid "Languages" +msgstr "Langues" + +msgid "Language" +msgstr "Langue" + +msgid "Select language" +msgstr "Sélectionner votre langue" + +msgid "Quit" +msgstr "Sortir" + diff --git a/locales/locale.sh b/locales/locale.sh new file mode 100755 index 0000000..a73a9c5 --- /dev/null +++ b/locales/locale.sh @@ -0,0 +1,27 @@ +*#!/bin/bash +WORKDIR="$(dirname $(readlink -f $0))" + +function generate_locale() +{ + echo "--- Begin : $1" + if [ -f $1.po ] + then + msgmerge --update --backup=none $1.po messages.pot + else + msginit --no-translator --input=messages.pot --locale=$1 + fi + echo "--- Check : $1" + msgfmt $1.po --check + echo "--- End : $1" +} +ORIGIN=$PWD +cd $WORKDIR +####################### +# LIST LANGUAGE : START +####################### +generate_locale fr +generate_locale en +###################### +# LIST LANGUAGE : END +###################### +cd $ORIGIN diff --git a/locales/messages.mo b/locales/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..4108bf8564052540ba97b092090e1b3f45692f5a GIT binary patch literal 3190 zcmai#O>Epm6vqcBl%`Oi(DGHlrC&*5o2Gn~R6#hqv#E*K-mdL@6bZ}Oog}7SJNP4M zDue_V4t(5NBoL@bJ-`(tkPs3#!~tXG|+c%wM7*9iXLB79%F%5k6Cj4NW-^AEM;Kv}%e*-=UUIcFe{{aWUf5ENbz|D-^ z2JQrJ2lq&QMDjUlpOpG6cqjbk!F#|JIsZ1e1^WBocJKnY4g6B_TWS9hr1dU?cY}X} z6mJWXBmDvJF7OaY@t+6xf(}T2XXN}_a{fbb2kf7LkAmMx{sHcWzHKvNf``F9;3T*o zjHG@JRG@za(mKC@6p!6n*mr_d&u66WfR8|52C2U1z(MeHX}<^_gnk92bq=5?v|j^6 zO6*0+IdC)1&If5(tAfil!kHeMzALJI!JlUNc&45otr21 zWsu^oO8qsE{9gxYe{V{@EA3}N^8Wy&mOd|e0i^!;1f>4>8pKxE4YIDc@&7ItK%!dbl9@FG@xrjw>HK@%t3yV4>!D-H&I=d+lD* z)L{tSDH@MKh9Oit%143FptWhAPeSOP-Up$6+Yh+|Lb>*iy-<(}I|Lbmj6l}L5j@Zy zXgmR-y3lwSf^zf?+9TDe1fhFFwH$;{Z_|CD9-~2Lz7KK$axa9&;|22i(4C@tPJ_;c zl^a~Ood$RF2hB9x@^MoubGMpVNQ*->harImX$n|Bn0&)6NMt~yqCs;;ZE-Khqj(oDzd7%bB z7u@2utr-*jZXIJ@!nJ7qR#)d!Twg1%Om$tC3Edo5^=n2cj(`0iH3!YG{#3DdDmOLO z^?WL*)OA9+74#5VfBjH-jjxqz?$Al6T6{^Vg7BRdw`E z>s&Qkb#&drE#}4s@f+OIPO9VR{j2v@gumv?#iVOCG;Y``_4h_mw3FPen#M+HPHRTR zoOV@xTAj6AoSSXdHwYzNYwC<@2Wnc4ch?>{ba;KB4%CAz_JUG1irWcRUdq*E?8q^t zcpMuHmEB{?$k4F?R$h$!rchR+ELLK#DOlBylT-=4wqUf^;;Ae@&)qq-)l%A7;x`AA zAy%UYSw3ZuDl()*aS=3kDm?I;3T9wmtnOurVD-RT#Yv#XQI;?(%EFc+=I7~r=##JD z``?p9-Aj^{C~g(6oyh!@If;n#RQtZCNMJFF6J|~_9h(cWk~$Yo~5c51(@<%B4Xo6 zU&Mh(5=5EzvLIEOQ8@1};J{L}8LMVNkl>F&gsdSF|BN>mpk)g~0Th