diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | usr/lib/vdr/inc/commands-functions.sh | 14 | ||||
-rw-r--r-- | usr/lib/vdr/inc/language-functions.sh | 8 |
3 files changed, 27 insertions, 2 deletions
@@ -1,5 +1,12 @@ # ChangeLog for gentoo-vdr-scripts +*gentoo-vdr-scripts-0.2.2 (07 Jan 2006) + + 07 Jan 2006; Matthias Schwarzott <zzam@gentoo.org> + usr/lib/vdr/inc/commands-functions.sh, + +usr/lib/vdr/inc/language-functions.sh: + commands can now be localized + *gentoo-vdr-scripts-0.2.1 (06 Jan 2006) 06 Jan 2006; Matthias Schwarzott <zzam@gentoo.org> diff --git a/usr/lib/vdr/inc/commands-functions.sh b/usr/lib/vdr/inc/commands-functions.sh index fc1dcfe..c266121 100644 --- a/usr/lib/vdr/inc/commands-functions.sh +++ b/usr/lib/vdr/inc/commands-functions.sh @@ -1,4 +1,8 @@ +source /usr/lib/vdr/inc/language-functions.sh + merge_commands_conf() { + [[ -z ${VDR_LANGUAGE} ]] && read_vdr_language + local CONFIG="${CONFIG:-/etc/vdr}" local sdir="${1}" local destfile="${2}" @@ -23,10 +27,16 @@ merge_commands_conf() { EOT test -d "${sdir}" || return 1 SFILES=$(echo ${sdir}/*.conf) + local f + local inputf for f in ${SFILES}; do [[ -f "${f}" ]] || continue - echo "# source : ${f}" >> "${mergedfile}" - cat "${f}" >> "${mergedfile}" + inputf="${f}" + + [[ -f "${f}.${VDR_LANGUAGE}" ]] && inputf="${f}.${VDR_LANGUAGE}" + + echo "# source : ${inputf}" >> "${mergedfile}" + cat "${inputf}" >> "${mergedfile}" echo >> "${mergedfile}" done diff --git a/usr/lib/vdr/inc/language-functions.sh b/usr/lib/vdr/inc/language-functions.sh new file mode 100644 index 0000000..03165c0 --- /dev/null +++ b/usr/lib/vdr/inc/language-functions.sh @@ -0,0 +1,8 @@ +read_vdr_language() { + local OSDLANG + local LANG_TAB + OSDLANG=$(awk -F= '/^OSDLanguage/ { print $2 }' /etc/vdr/setup.conf) + LANG_TAB=("en" "de") + VDR_LANGUAGE=${LANG_TAB[OSDLANG]} +} + |