Compare commits

..
2 Commits
Author SHA1 Message Date
Pakobbix 0ca3e19117 Merge pull request 'refactor: replace numeric translation keys with named keys' (#6) from refactor/i18n-named-keys into main
Reviewed-on: #6
2026-08-12 03:58:29 +00:00
ARIA 4b2e40c59f refactor: replace numeric translation keys with named keys
- Extract shared i18n.sh library with tr() function (replaces 5 duplicated text_lang functions)
- Replace numeric IDs (001, 002, ...) with human-readable keys (already_started, delete, etc.)
- Update all language files (en_US, en_GB, de_DE) to use named key format
- Update all scripts (jdautoenc, rename, addrename, removerename, config) to use tr() from i18n.sh
2026-08-12 05:57:20 +02:00
3 changed files with 6 additions and 3 deletions
+2
View File
@@ -9,6 +9,8 @@ source "$(dirname "$0")/i18n.sh"
# Funktion für später, um z.B. zenity statt whiptail zu nutzen. # Funktion für später, um z.B. zenity statt whiptail zu nutzen.
possiblelangfolder=$(find ~ -type f -wholename "*lang/$language/config.lang" 2>/dev/null | sed 's/en_US\/config.lang//g')
if ! [ -f "$language_folder"/"$language"/config.lang ]; then if ! [ -f "$language_folder"/"$language"/config.lang ]; then
real_language_Folder=$(whiptail --title "Could not find language folder" --inputbox "WARNING!! Language folder could not be found. Please type the Path to the language folder or else, the script will try to get the language from Github (could be buggy)\nPossible Path: $possiblelangfolder" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g") real_language_Folder=$(whiptail --title "Could not find language folder" --inputbox "WARNING!! Language folder could not be found. Please type the Path to the language folder or else, the script will try to get the language from Github (could be buggy)\nPossible Path: $possiblelangfolder" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
sed -i "s/language_folder=.*/language_folder=$real_language_Folder/g" "$JDAutoConfig" sed -i "s/language_folder=.*/language_folder=$real_language_Folder/g" "$JDAutoConfig"
+3 -3
View File
@@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
config=$(find ~ -type f -name "JDAutoConfig" 2>/dev/null) JDAutoConfig=$(find ~ -type f -name "JDAutoConfig" 2>/dev/null)
log=$(grep "log=" "$config" | sed 's/.*=//g') log=$(grep "log=" "$JDAutoConfig" | sed 's/.*=//g')
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$config" source "$JDAutoConfig"
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source "$(dirname "$0")/i18n.sh" source "$(dirname "$0")/i18n.sh"
+1
View File
@@ -14,6 +14,7 @@ count=$(($3 + 1))
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$config" source "$config"
JDAutoConfig="$config"
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source "$(dirname "$0")/i18n.sh" source "$(dirname "$0")/i18n.sh"