Refactor Localization Service

- Updated LocalizationService interface to load localization data from a Path instead of InputStream.
- Enhanced LocalizationServiceImpl to handle loading and saving of localization data from directories.
- Introduced LocalizationLanguage and LocalizationMetadata classes to encapsulate language entries and metadata.
- Refactored Localizations class to manage language files and metadata more effectively.
- Added unit tests for loading localizations from directory and verifying language translations.
- Created YAML files for English and German languages along with a metadata file for localization information.
This commit is contained in:
extio-de
2026-05-15 16:32:18 +02:00
parent 99cbee4515
commit f54e07b984
14 changed files with 470 additions and 313 deletions

13
data/i18n/de.yaml Normal file
View File

@@ -0,0 +1,13 @@
---
shortName: "de"
entries:
test-1: "hallo"
test-2: "welt"
test-3: "Willkommen zu Exo's Spieleengine Demo!"
test-4: "Design auswählen"
test-5: "Dies ist eine Nachricht\\n123...\\nSchönen Tag noch!"
test-6: "Ok"
test-7: "Audio umschalten"
test-8: "ScrollArea Demo"
test-9: "Sprache auswählen"
test-10: "Aktuell: "

13
data/i18n/en.yaml Normal file
View File

@@ -0,0 +1,13 @@
---
shortName: "en"
entries:
test-1: "hello"
test-2: "world"
test-3: "Welcome to Exo's Game Engine Demo!"
test-4: "Select Theme"
test-5: "This is a message\\n123...\\nHave a nice day!"
test-6: "OK"
test-7: "Toggle Audio"
test-8: "ScrollArea Demo"
test-9: "Select Language"
test-10: "Current: "

View File

@@ -1,42 +0,0 @@
---
curId: 10
descriptions:
test-2: ""
test-1: "aaa"
test-8: ""
test-7: ""
test-6: ""
test-5: ""
test-4: ""
test-3: ""
languages:
en:
test-1: "hello"
test-2: "world"
test-3: "Welcome to Exo's Game Engine Demo!"
test-4: "Select Theme"
test-5: "This is a message\\n123...\\nHave a nice day!"
test-6: "OK"
test-7: "Toggle Audio"
test-8: "ScrollArea Demo"
test-9: "Select Language"
test-10: "Current: "
de:
test-1: "hallo"
test-2: "welt"
test-3: "Willkommen zu Exo's Spieleengine Demo!"
test-4: "Design auswählen"
test-5: "Dies ist eine Nachricht\\n123...\\nSchönen Tag noch!"
test-6: "Ok"
test-7: "Audio umschalten"
test-8: "ScrollArea Demo"
test-9: "Sprache auswählen"
test-10: "Aktuell: "
languagesInfo:
en:
name: "English"
shortName: "en"
de:
name: "Deutsch"
shortName: "de"
prefix: "test"

9
data/i18n/metadata.yaml Normal file
View File

@@ -0,0 +1,9 @@
---
languagesInfo:
en:
name: "English"
shortName: "en"
de:
name: "Deutsch"
shortName: "de"
prefix: "test"