X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F10_translations.sh;h=642d9c382030137b1b49fb680b363a0ef5c1a887;hb=65676ea8331f60d882e3baec99c101382e9fad57;hp=da67f8947cb6f1b0bb99ac32762fbb1adb4f8c50;hpb=713a39f5e2b8f99d824273d49e64edb977333f69;p=shellwiki diff --git a/handlers/10_translations.sh b/handlers/10_translations.sh index da67f89..642d9c3 100755 --- a/handlers/10_translations.sh +++ b/handlers/10_translations.sh @@ -28,7 +28,13 @@ case ${PATH_INFO} in PATH_INFO="${PATH_INFO%:?*/\[attachment\]}[attachment]" ;; */:?*/\[*\]) - :;; # Default handler, considered valid in most cases + LANGUAGE="${PATH_INFO#*/:}" + LANGUAGE="${LANGUAGE%%/*}" + ;; + */:?*/:?*) + # Accidental double language link, last one stays valid! + REDIRECT "${_BASE}${PATH_INFO%/:?*/:?*}/:${PATH_INFO##*/:}" + ;; */:?*/?*) :;; # Default attachment handler */:?*/) # Faulty URL build @@ -63,4 +69,7 @@ case ${PATH_INFO} in ;; esac +_(){ printf %s\\n "$*"; } +[ -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh" + return 1