diff --git a/localization/LocalizationKeys.gd b/localization/LocalizationKeys.gd new file mode 100644 index 0000000..3cf6e02 --- /dev/null +++ b/localization/LocalizationKeys.gd @@ -0,0 +1,28 @@ +# Keys for LocalizationManger to use in source code: MIT License +# @author Vladimir Petrenko +@tool +class_name LocalizationKeys + +const PLAY = "PLAY" +const MONEY = "MONEY" +const RESULT = "RESULT" +const UNDERSTOOD = "UNDERSTOOD" +const SUCCES = "SUCCES" +const FAILURE = "FAILURE" +const STORMWARNING = "STORMWARNING" +const INTRODUCTION = "INTRODUCTION" +const WARNING = "WARNING" +const HELP = "HELP" + +const KEYS = [ + "PLAY", + "MONEY", + "RESULT", + "UNDERSTOOD", + "SUCCES", + "FAILURE", + "STORMWARNING", + "INTRODUCTION", + "WARNING", + "HELP" +] \ No newline at end of file diff --git a/localization/LocalizationPlaceholders.gd b/localization/LocalizationPlaceholders.gd new file mode 100644 index 0000000..e9e3949 --- /dev/null +++ b/localization/LocalizationPlaceholders.gd @@ -0,0 +1,9 @@ +# Placeholders for LocalizationManger to use in source code: MIT License +# @author Vladimir Petrenko +@tool +class_name LocalizationPlaceholders + + +const PLACEHOLDERS = [ + +] \ No newline at end of file diff --git a/localization/LocalizationRemaps.gd b/localization/LocalizationRemaps.gd new file mode 100644 index 0000000..66ea6ba --- /dev/null +++ b/localization/LocalizationRemaps.gd @@ -0,0 +1,6 @@ +# Remapkeys for LocalizationManger to use in source code: MIT License +# @author Vladimir Petrenko +@tool +class_name LocalizationRemaps + +const DOLLAR_PNG = "DOLLAR_PNG" diff --git a/localization/Placeholders.tres b/localization/Placeholders.tres new file mode 100644 index 0000000..ba4e3f1 --- /dev/null +++ b/localization/Placeholders.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" script_class="LocalizationPlaceholdersData" load_steps=2 format=3 uid="uid://c8imk4d1wyrw4"] + +[ext_resource type="Script" path="res://addons/localization_editor/model/LocalizationPlaceholdersData.gd" id="1"] + +[resource] +script = ExtResource("1") +placeholders = {} diff --git a/translations/translations.csv b/localization/localizations.csv similarity index 100% rename from translations/translations.csv rename to localization/localizations.csv diff --git a/localization/localizations.csv.import b/localization/localizations.csv.import new file mode 100644 index 0000000..40af70c --- /dev/null +++ b/localization/localizations.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://cn1jc4oehudym" + +[deps] + +files=["res://localization/localizations.de.translation", "res://localization/localizations.en.translation"] + +source_file="res://localization/localizations.csv" +dest_files=["res://localization/localizations.de.translation", "res://localization/localizations.en.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/project.godot b/project.godot index 06c90ca..143aa7c 100644 --- a/project.godot +++ b/project.godot @@ -22,6 +22,7 @@ config/icon="res://icon.png" G="*res://scenes/GLOBAL.gd" DebugMenu="*res://addons/debug_menu/debug_menu.tscn" +LocalizationManager="*res://addons/localization_editor/LocalizationManager.gd" [display] @@ -38,7 +39,7 @@ version_control/autoload_on_startup=true [editor_plugins] -enabled=PackedStringArray("res://addons/debug_menu/plugin.cfg") +enabled=PackedStringArray("res://addons/debug_menu/plugin.cfg", "res://addons/gdLinter/plugin.cfg", "res://addons/localization_editor/plugin.cfg") [global_group] @@ -119,7 +120,7 @@ fullscreen={ locale/translation_remaps={ "res://Assets/Icons/Dollar.png": PackedStringArray("res://Assets/Icons/Dollar.png:en", "res://Assets/Icons/Euro.png:de_DE") } -locale/translations=PackedStringArray("res://translations/translations.de.translation", "res://translations/translations.en.translation") +locale/translations=PackedStringArray("res://localization/localizations.de.translation", "res://localization/localizations.en.translation") [layer_names] @@ -172,6 +173,11 @@ avoidance/layer_10="Entity" avoidance/layer_11="Player" avoidance/layer_12="Enemy" +[localization_editor] + +locales_path_to_file="res://localization/localizations.csv" +translations_save_auth=false + [physics] common/physics_jitter_fix=1.0 diff --git a/translations/.~lock.translations.csv# b/translations/.~lock.translations.csv# deleted file mode 100644 index 7e72196..0000000 --- a/translations/.~lock.translations.csv# +++ /dev/null @@ -1 +0,0 @@ -,exobyt,exobyt-endeavour,15.09.2024 02:07,file:///home/exobyt/.config/libreoffice/4; \ No newline at end of file diff --git a/translations/translations.csv.import b/translations/translations.csv.import deleted file mode 100644 index c051591..0000000 --- a/translations/translations.csv.import +++ /dev/null @@ -1,17 +0,0 @@ -[remap] - -importer="csv_translation" -type="Translation" -uid="uid://bmg2efydag08g" - -[deps] - -files=["res://translations/translations.de.translation", "res://translations/translations.en.translation"] - -source_file="res://translations/translations.csv" -dest_files=["res://translations/translations.de.translation", "res://translations/translations.en.translation"] - -[params] - -compress=true -delimiter=0