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##*/:}"
;;
esac
+_(){ printf %s\\n "$*"; }
[ -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh"
return 1
#!/bin/sh
+_(){
+case $* in
+ 'Page names containing newline character are not allowed') printf 'Seitennamen mit Zeilenumbruch sind nicht erlaubt';;
+ 'Page names starting with "#" are not allowed') printf 'Seitennamen dürfen nicht mit "#" anfangen';;
+ 'Formdata invalid') printf 'Formulardaten ungültig';;
+ 'Page name required') printf 'Seitenname erforderlich';;
+ 'Page exists already') printf 'Seite existiert schon';;
+ "You don't have permission to write to this page") printf 'Keine Berechtigung auf diese Seite zu schreiben';;
+ 'Unable to lock page for editing') printf 'Kann Seite nicht zum bearbeiten sperren';;
+ 'TRANSLATION NOT FOUND') printf 'Übersetzung nicht gefunden';;
+ 'The presented URL schema cannot be handled') printf 'Das angegeben URL Schema kann nicht verarbeitet werden';;
+ 'missing') printf 'fehlt';;
+ 'outdated') printf 'veraltet';;
+ 'current') printf 'aktuell';;
+ 'View') printf 'Anzeigen';;
+ 'Edit') printf 'Bearbeiten';;
+ 'Attachments') printf 'Anhänge';;
+ 'Revisions') printf 'Revisionen';;
+ 'Rename') printf 'Umbenennen';;
+ 'Move') printf 'Verschieben';;
+ 'Delete') printf 'Löschen';;
+ 'Update') printf 'Aktualisieren';;
+ 'Cancel') printf 'Abbrechen';;
+ 'Editor') printf 'Editor';;
+ 'Syntax') printf 'Syntax';;
+ 'page name') printf 'Seitenname';;
+ 'Upload') printf 'Hochladen';;
+ 'Move To:') printf 'Verschieben nach:';;
+ 'Latest changes to the original language page') printf 'Letzte Änderungen der originalsprachlichen Seite';;
+ 'GIT is not available to handle revisioning.') printf 'GIT steht nicht zur Verfügung um Revisionierung zu handhaben';;
+ '(never edited)') printf '(nie bearbeitet)';;
+ *) printf %s\\n "$*";;
+esac
+}
+
user_register_email() { # TRANSLATION
"$SENDMAIL" -t -f "$MAILFROM" <<-EOF
From: ${MAILFROM}
[form #user_login .login method=POST
[input name=uname placeholder="Benutzername oder Email-Adresse" autocomplete=off]
[input type=password name=pw placeholder="Passwort"]
- [submit "action" "user_login" Einloggen]
+ [submit "action" "user_login" Anmelden]
]
EOF
}
cat <<-EOF
[form #user_login .logout method=POST
[p Logged in as [span . $(HTML ${USER_NAME})]]
- [submit "action" "user_logout" Ausloggen]
+ [submit "action" "user_logout" Abmelden]
]
EOF
}
. "$_EXEC/tools.sh"
. "$_EXEC/acl.sh"
+_(){ printf %s\\n "$*"; }
+[ "${LANGUAGE}" -a -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh"
+
LANGUAGES='' glob="/" depth=-1
while [ $# -gt 0 ]; do case $1 in
--system) glob_system_pages=true; shift 1;;
read ostamp odate <<-EOF
$([ "$REV_PAGES" = true ] \
&& git -C "$_DATA" log --pretty="format:%at %ai" -- "pages${page_abs}#page.md" \
- || stat -c "%Y %y" -- "$_DATA/pages${page_abs}#page.md"
+ || stat -c "%Y %y" -- "$_DATA/pages${page_abs}#page.md" 2>&- \
+ || printf "0 %s\n" "$(_ "(never edited)")"
)
EOF
row="<td><a href=\"$(HTML "$page")\">$(HTML "$page")</a><span class=\"date\">${odate%%[+.]*}</span></td>"
)
EOF
if [ $lstamp -lt $ostamp ] 2>&-; then
- row="${row}<td class=\"outdated\"><a href=\"$(HTML "${page}:${l}")\">outdated</a><span class=\"date\">${ldate%%[+.]*}</span></td>"
+ row="${row}<td class=\"outdated\"><a href=\"$(HTML "${page}:${l}")\">$(_ outdated)</a><span class=\"date\">${ldate%%[+.]*}</span></td>"
[ "$rowstate" = "${rowstate%*outdated*}" ] && rowstate="${rowstate}${rowstate:+ }outdated"
else
- row="${row}<td class=\"current\" ><a href=\"$(HTML "${page}:${l}")\">current</a ><span class=\"date\">${ldate%%[+.]*}</span></td>"
+ row="${row}<td class=\"current\" ><a href=\"$(HTML "${page}:${l}")\">$(_ current)</a ><span class=\"date\">${ldate%%[+.]*}</span></td>"
[ "$rowstate" = "${rowstate%*current*}" ] && rowstate="${rowstate}${rowstate:+ }current"
fi
else
- row="${row}<td class=\"missing\"><a href=\"$(HTML "${page}:${l}")\">missing</a></td>"
+ row="${row}<td class=\"missing\"><a href=\"$(HTML "${page}:${l}")\">$(_ missing)</a></td>"
[ "$rowstate" = "${rowstate%*missing*}" ] && rowstate="${rowstate}${rowstate:+ }missing"
fi
done
. "$_EXEC/cgilite/cgilite.sh"
+_(){ printf %s\\n "$*"; }
+[ "${LANGUAGE}" -a -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh"
+
if [ "$1" -o "$ERROR_MSG" ]; then
- printf '<p class="error">%s</p>' "$(HTML "${1:-${ERROR_MSG}}")"
+ printf '<p class="error">%s</p>' "$(HTML "$(_ ${1:-${ERROR_MSG}})")"
fi
. "$_EXEC/tools.sh"
. "$_EXEC/acl.sh"
+_(){ printf %s\\n "$*"; }
+[ "${LANGUAGE}" -a -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh"
+
LIST=true DIFF=
while [ $# -gt 0 ]; do case $1 in
--list)
printf '<div class="macro revisions">\n'
if [ "$REV_PAGES" != true ]; then
- printf '<div class="error">GIT is not available to handle revisioning.</div>'
+ printf '<div class="error">%s</div>' "$(_ GIT is not available to handle revisioning.)"
+ exit 1
fi
if [ "$LIST" = true ]; then
if [ "$DIFF" = true -a "$LANGUAGE_DEFAULT" -a "$page_default" != "$page_abs" ]; then
commit="$(git -C "$_DATA" log --pretty=format:%H -- "pages${page_abs}#page.md" |head -n1)"
- printf '<section class="diff"><h2>Latest changes to original language page</h2>'
+ printf '<section class="diff"><h2>%s</h2>' "$(_ 'Latest changes to the original language page')"
git -C "$_DATA" diff -U3 "$commit" -- "pages${page_default}#page.md" |tail -n+5 \
| while read -r diff; do case $diff in
@@\ *\ @@*)
. "$_EXEC/cgilite/cgilite.sh"
. "$_EXEC/cgilite/users.sh"
+_(){ printf %s\\n "$*"; }
[ "${LANGUAGE}" -a -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh"
case $action in
local page="$1"
if acl_write "$page"; then
- printf '
- <ul class="pagemenu">
- <li><a href="./%%5Bview%%5D">View</a></li>
- <li><a href="./%%5Bedit%%5D">Edit</a></li>
- <li><a href="./%%5Battachment%%5D">Attachments</a></li>
- <li><a href="./%%5Brevision%%5D">Revisions</a></li>
- <li><a href="./%%5Brename%%5D">Rename</a></li>
- <li><a href="./%%5Bmove%%5D">Move</a></li>
- <li><a href="./%%5Bdelete%%5D">Delete</a></li>
- </ul>'
+ cat <<-EOF
+ <ul class="pagemenu">
+ <li><a href="./%5Bview%5D">$(_ View)</a></li>
+ <li><a href="./%5Bedit%5D">$(_ Edit)</a></li>
+ <li><a href="./%5Battachment%5D">$(_ Attachments)</a></li>
+ <li><a href="./%5Brevision%5D">$(_ Revisions)</a></li>
+ <li><a href="./%5Brename%5D">$(_ Rename)</a></li>
+ <li><a href="./%5Bmove%5D">$(_ Move)</a></li>
+ <li><a href="./%5Bdelete%5D">$(_ Delete)</a></li>
+ </ul>
+ EOF
fi
}
[ "$template" ] && acl_read "$template" || template="$page"
theme_page - "Editor: $title" <<-EOF
- <input checked type=radio class=tab name=edithelp value=edtr id=editor><label for=editor>Editor</label>
- <input type=radio class=tab name=edithelp value=help id=syntax><label for=syntax>Syntax</label>
- <input type=radio class=tab name=edithelp value=att id=attach><label for=attach>Attachments</label>
+ <input checked type=radio class=tab name=edithelp value=edtr id=editor><label for=editor>$(_ Editor)</label>
+ <input type=radio class=tab name=edithelp value=help id=syntax><label for=syntax>$(_ Syntax)</label>
+ <input type=radio class=tab name=edithelp value=att id=attach><label for=attach>$(_ Attachments)</label>
$([ "$LANGUAGE_DEFAULT" -a "$LANGUAGE_DEFAULT" != "$LANGUAGE" ] && printf '
<input type=radio class=tab name=edithelp value=att id=transl><label for=transl>%s</label>
' "$LANGUAGE_DEFAULT"
<input type=hidden name=session_key value="${SESSION_KEY}"/>
<textarea name=pagetext>$({ wiki_text "$page" \
|| wiki_text "$template"; } |HTML)</textarea>
- <button type=submit name=action value=update>Update</button>
- <button type=submit name=action value=cancel>Cancel</button>
+ <button type=submit name=action value=update>$(_ Update)</button>
+ <button type=submit name=action value=cancel>$(_ Cancel)</button>
</form>
<div class="tab syntax">$(wiki "/[wiki]/editorhelp/")</div>
<div class="tab attach">
if acl_write "$page"; then
theme_page - "Attachments: $title" <<-EOF
<form class=upload method=POST enctype="multipart/form-data">
- <h2>Upload</h2>
+ <h2>$(_ Upload)</h2>
<input type=hidden name=session_id value="$SESSION_ID">
<input type=file name=file multiple>
- <button type=submit name=action value=upload>Upload</button>
+ <button type=submit name=action value=upload>$(_ Upload)</button>
</form>
<form method=POST>
- <h2>Attachments</h2>
+ <h2>$(_ Attachments)</h2>
<input type=hidden name=session_key value="$SESSION_KEY">
- <input checked type=radio class=tab name=attachaction value=view id=tview><label for=tview>View</label>
- <input type=radio class=tab name=attachaction value=del id=tdel ><label for=tdel >Delete</label>
- <input type=radio class=tab name=attachaction value=move id=tmove><label for=tmove>Move</label>
- <input type=radio class=tab name=attachaction value=ren id=tren ><label for=tren >Rename</label>
+ <input checked type=radio class=tab name=attachaction value=view id=tview><label for=tview>$(_ View)</label>
+ <input type=radio class=tab name=attachaction value=del id=tdel ><label for=tdel >$(_ Delete)</label>
+ <input type=radio class=tab name=attachaction value=move id=tmove><label for=tmove>$(_ Move)</label>
+ <input type=radio class=tab name=attachaction value=ren id=tren ><label for=tren >$(_ Rename)</label>
<div class="tab">
<ul class="attachment list">
$(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do
"$(size_human "$size")" "$(date -d @"$date" +"%F %T")"
done)
</ul>
- <button type=submit name=action value=delete>Delete</button>
- <label for=moveto>Move To:</label>
- <input id="moveto" name="moveto" value="$(HTML "$page")" placeholder="page name">
- <button type=submit name=action value=move >Move</button>
- <button type=submit name=action value=rename>Rename</button>
+ <button type=submit name=action value=delete>$(_ Delete)</button>
+ <label for=moveto>$(_ Move To:)</label>
+ <input id="moveto" name="moveto" value="$(HTML "$page")" placeholder="$(_ page name)">
+ <button type=submit name=action value=move >$(_ Move)</button>
+ <button type=submit name=action value=rename>$(_ Rename)</button>
</div>
</form>
EOF