Compare commits

..
1 Commits
Author SHA1 Message Date
ARIA 6a15334b9d 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:46:48 +02:00
3 changed files with 3 additions and 6 deletions
-2
View File
@@ -9,8 +9,6 @@ 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
JDAutoConfig=$(find ~ -type f -name "JDAutoConfig" 2>/dev/null) config=$(find ~ -type f -name "JDAutoConfig" 2>/dev/null)
log=$(grep "log=" "$JDAutoConfig" | sed 's/.*=//g') log=$(grep "log=" "$config" | sed 's/.*=//g')
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$JDAutoConfig" source "$config"
# shellcheck disable=SC1091 # shellcheck disable=SC1091
source "$(dirname "$0")/i18n.sh" source "$(dirname "$0")/i18n.sh"
-1
View File
@@ -14,7 +14,6 @@ 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"