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 0f9c939..0000000 Binary files a/godot/addons/i18n/messages.mo and /dev/null differ 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 0000000..0990611 Binary files /dev/null and b/i18n/messages.mo differ 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