From 86b29e4ac23bbbbf44b1410e2886b2453a4bdd8f Mon Sep 17 00:00:00 2001 From: myin Date: Mon, 31 Jul 2023 17:25:13 +0200 Subject: [PATCH] move i18n folder out --- godot/addons/i18n/de.po | 40 ------------------- godot/addons/i18n/menu/LanguageSelect.gd | 34 ---------------- godot/addons/i18n/menu/LanguageSelect.tscn | 6 --- godot/addons/i18n/messages.mo | Bin 477 -> 0 bytes {godot/addons/i18n => i18n}/README.md | 0 {godot/addons/i18n => i18n}/babelrc | 0 {godot/addons/i18n => i18n}/en.po | 26 +++++------- i18n/messages.mo | Bin 0 -> 620 bytes {godot/addons/i18n => i18n}/messages.pot | 10 +---- {godot/addons/i18n => i18n}/requirements.txt | 0 scripts/translations.sh | 6 +-- 11 files changed, 15 insertions(+), 107 deletions(-) delete mode 100644 godot/addons/i18n/de.po delete mode 100644 godot/addons/i18n/menu/LanguageSelect.gd delete mode 100644 godot/addons/i18n/menu/LanguageSelect.tscn delete mode 100644 godot/addons/i18n/messages.mo rename {godot/addons/i18n => i18n}/README.md (100%) rename {godot/addons/i18n => i18n}/babelrc (100%) rename {godot/addons/i18n => i18n}/en.po (64%) create mode 100644 i18n/messages.mo rename {godot/addons/i18n => i18n}/messages.pot (83%) rename {godot/addons/i18n => i18n}/requirements.txt (100%) diff --git a/godot/addons/i18n/de.po b/godot/addons/i18n/de.po deleted file mode 100644 index d2ef679..0000000 --- a/godot/addons/i18n/de.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translations template for PROJECT. -# Copyright (C) 2022 ORGANIZATION -# This file is distributed under the same license as the PROJECT project. -# Automatically generated, 2022. -# -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-01-22 09:53+0100\n" -"PO-Revision-Date: 2022-07-20 19:18+0200\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.10.3\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -msgid "Master" -msgstr "" - -msgid "Press any key..." -msgstr "" - -msgid "Resume" -msgstr "" - -msgid "Options" -msgstr "" - -msgid "Back to Menu" -msgstr "" - -msgid "LANG_EN" -msgstr "Englisch" - -msgid "LANG_DE" -msgstr "Deutsch" diff --git a/godot/addons/i18n/menu/LanguageSelect.gd b/godot/addons/i18n/menu/LanguageSelect.gd deleted file mode 100644 index 45fc39d..0000000 --- a/godot/addons/i18n/menu/LanguageSelect.gd +++ /dev/null @@ -1,34 +0,0 @@ -class_name LanguageSelect -extends OptionButton - -const LANG_PREFIX = "LANG_" - - -func _ready(): - connect("item_selected", self._on_item_selected) - - var current_locale = TranslationServer.get_locale() - var idx = _find_locale_index(current_locale) - if idx == -1 and "_" in current_locale: - var locale_without_country = current_locale.split("_")[0] - idx = _find_locale_index(locale_without_country) - - if idx != -1: - select(idx) - - -func _find_locale_index(locale: String) -> int: - var locale_text = LANG_PREFIX + locale.to_upper() - for i in range(0, get_item_count()): - var item = get_item_text(i) - - if item == locale_text: - return i - - return -1 - - -func _on_item_selected(idx: int): - var lang = get_item_text(idx) - var locale = lang.substr(LANG_PREFIX.length()) - TranslationServer.set_locale(locale.to_lower()) diff --git a/godot/addons/i18n/menu/LanguageSelect.tscn b/godot/addons/i18n/menu/LanguageSelect.tscn deleted file mode 100644 index 00e651d..0000000 --- a/godot/addons/i18n/menu/LanguageSelect.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://dgx504m7uhs0y"] - -[ext_resource type="Script" path="res://addons/i18n/menu/LanguageSelect.gd" id="2"] - -[node name="LanguageSelect" type="OptionButton"] -script = ExtResource("2") diff --git a/godot/addons/i18n/messages.mo b/godot/addons/i18n/messages.mo deleted file mode 100644 index 0f9c939192aefdf16ebbcde0e64c61f480a7a1f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 477 zcmYLD%TB{E5DYJYa^%dx+(5`B2}l%Im1rA-iuzI-IB)@zEWs$Xi|ru#A^a6b&U_1- z@)~(Ov#a%bKDXE3Jj5Du2YHO#Kn{>K?vR^E@uL#;X2tWKf9iMiTj)Pf@hq{5cfD_k zL1%Pv8*^`|eB@1xeuB)=eon8!Sg92wlVp6!dnvi*$+SNn`3cOmadc=4nbU4nSej}^ z_^{I-oOR+j;nS%<8Pfz_WW9jK!T}>u5JfaNp;17>Qx-N4f+z_5fv}FIMkrefrwt>W z%ITSKG81LFAO$Ee_&mo!RaBw?nu3@yqO^j)9wRyU!~T%}XAT>I-_y#0!u5+e{_o(` z9nMQ3Rf}Yg!dP(atMr^U|L5u$4`3))na-su7-`;1=U@DWpxp%{U2zX3i5g+hIPxcD pWkgBOwV7EAHD8vt9ks}}ZSN_v+a}?D%lBfaoXs9Ru8LCD<_in(fGGd~ diff --git a/godot/addons/i18n/README.md b/i18n/README.md similarity index 100% rename from godot/addons/i18n/README.md rename to i18n/README.md diff --git a/godot/addons/i18n/babelrc b/i18n/babelrc similarity index 100% rename from godot/addons/i18n/babelrc rename to i18n/babelrc diff --git a/godot/addons/i18n/en.po b/i18n/en.po similarity index 64% rename from godot/addons/i18n/en.po rename to i18n/en.po index b61d0a5..05a01ce 100644 --- a/godot/addons/i18n/en.po +++ b/i18n/en.po @@ -1,40 +1,34 @@ # Translations template for PROJECT. -# Copyright (C) 2022 ORGANIZATION +# Copyright (C) 2023 ORGANIZATION # This file is distributed under the same license as the PROJECT project. -# Automatically generated, 2022. +# Automatically generated, 2023. # msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-01-22 09:53+0100\n" -"PO-Revision-Date: 2022-07-20 19:18+0200\n" +"POT-Creation-Date: 2023-07-31 17:23+0200\n" +"PO-Revision-Date: 2023-07-31 17:23+0200\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" -"Generated-By: Babel 2.10.3\n" +"Generated-By: Babel 2.12.1\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "Master" -msgstr "" +msgstr "Master" msgid "Press any key..." -msgstr "" +msgstr "Press any key..." msgid "Resume" -msgstr "" +msgstr "Resume" msgid "Options" -msgstr "" +msgstr "Options" msgid "Back to Menu" -msgstr "" - -msgid "LANG_EN" -msgstr "English" - -msgid "LANG_DE" -msgstr "German" +msgstr "Back to Menu" diff --git a/i18n/messages.mo b/i18n/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..0990611696cad0e4039a0df5c00a780d49d20008 GIT binary patch literal 620 zcmbV}!EVz)6h#MGKr$>4YZi|ks2XECi$)VgB57O{6qCp?U9g)v4`b@gSTp0QmiUeS zL-_%AEcpd?@GZO{gzmYTqc^^~e!h}_JvqE)r2E8EVnIA4J`-Ly#3SMh;WJ-}2gEnx zG4Y-7{tx2)9mamr^!ef4ouAV5`2|g%FaG*Slj7`vxJMikd-;8PQEaEFEHA)m$WV1G zlh&bO%huIeS++80ElAbF1@>VWvK(!vgbN@*FQ~zktuALjg&Y40v?R2QkFQA{iV- zNfZSOs>KT-dA>5OdnsWw|nrP@D_cASi0cO5@h@N5k6i&4P-=Xd-D1Rk9A literal 0 HcmV?d00001 diff --git a/godot/addons/i18n/messages.pot b/i18n/messages.pot similarity index 83% rename from godot/addons/i18n/messages.pot rename to i18n/messages.pot index bdb3cd6..33e8c1b 100644 --- a/godot/addons/i18n/messages.pot +++ b/i18n/messages.pot @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-01-22 09:56+0100\n" +"POT-Creation-Date: 2023-07-31 17:23+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.10.3\n" +"Generated-By: Babel 2.12.1\n" msgid "Master" msgstr "" @@ -32,9 +32,3 @@ msgstr "" msgid "Back to Menu" msgstr "" -msgid "LANG_EN" -msgstr "" - -msgid "LANG_DE" -msgstr "" - diff --git a/godot/addons/i18n/requirements.txt b/i18n/requirements.txt similarity index 100% rename from godot/addons/i18n/requirements.txt rename to i18n/requirements.txt diff --git a/scripts/translations.sh b/scripts/translations.sh index e822cfc..feff475 100644 --- a/scripts/translations.sh +++ b/scripts/translations.sh @@ -1,13 +1,13 @@ #!/bin/sh -DIR="godot/addons/i18n" +DIR="i18n" pybabel extract -F "$DIR/babelrc" -k text -k LineEdit/placeholder_text -k tr -k items --no-location -o "$DIR/messages.pot" \ - src "$DIR/menu" + godot/src cd $DIR -LANGS=(en de) +LANGS=(en) for LANG in "${LANGS[@]}"; do if [[ ! -f $LANG.po ]]; then