X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F10_translations.sh;h=5067677ac4db48107ee0d433ca93d9970f475a56;hb=116a9fbba5874eec7efb4f2253844e8158fffde9;hp=4b3464031aced41bae5581ea40728d2caf6a4e31;hpb=074d96bf4e9305c0c12925eeac5f9fc63404d325;p=shellwiki diff --git a/handlers/10_translations.sh b/handlers/10_translations.sh index 4b34640..5067677 100755 --- a/handlers/10_translations.sh +++ b/handlers/10_translations.sh @@ -1,5 +1,7 @@ #!/bin/sh +_(){ printf %s\\n "$*"; } + # Set LANGUAGE_DEFAULT to enable Plugin [ ! "$LANGUAGE_DEFAULT" ] && return 1 @@ -28,7 +30,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