]> git.plutz.net Git - shellwiki/commitdiff
various translations
authorPaul Hänsch <paul@plutz.net>
Tue, 15 Aug 2023 12:55:26 +0000 (14:55 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 15 Aug 2023 12:55:26 +0000 (14:55 +0200)
handlers/10_translations.sh
l10n/de.sh
macros/changes
macros/errormessage
macros/revisions
macros/wikiform
themes/default.sh

index e93b465e9ce2849d6c0aca8da3210d7178aa7da5..642d9c382030137b1b49fb680b363a0ef5c1a887 100755 (executable)
@@ -28,7 +28,9 @@ 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##*/:}"
@@ -67,6 +69,7 @@ case ${PATH_INFO} in
     ;;
 esac
 
+_(){ printf %s\\n "$*"; }
 [ -r "${_EXEC}/l10n/${LANGUAGE}.sh" ] && . "${_EXEC}/l10n/${LANGUAGE}.sh"
 
 return 1
index d2783acef199bebe43c8cceab0e4f3b5042acd6c..6e406f89d6aca5a0970d06939b00e0aefd9ebf4e 100644 (file)
@@ -1,5 +1,40 @@
 #!/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}
@@ -138,7 +173,7 @@ w_user_login_logon(){  # TRANSLATION
        [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
 }
@@ -146,7 +181,7 @@ w_user_login_logoff(){  # TRANSLATION
   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
 }
index 562fa8f6dddf35aed439dbd57ed4f3fc008be8f2..8714976154c43748cae3d56b31ac85782950931f 100755 (executable)
@@ -4,6 +4,9 @@
 . "$_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;;
@@ -25,7 +28,8 @@ page_glob "$glob" "$depth" |while read page; do
   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>"
@@ -40,14 +44,14 @@ page_glob "$glob" "$depth" |while read page; do
        )
        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
index ff1e06e23cc4b3b8884c0a3b11f6431c6740f441..b42e426c62415b51a62c82c58ccb5460273f4a62 100755 (executable)
@@ -2,6 +2,9 @@
 
 . "$_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
index 75440d60609fcb070d79dd2a23aaa3278eaf5925..5d7b5893596c8a9b09edf66e81db0a8c332a6aa3 100755 (executable)
@@ -4,6 +4,9 @@
 . "$_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)
@@ -37,7 +40,8 @@ fi
 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
@@ -57,7 +61,7 @@ fi
 
 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
     @@\ *\ @@*)
index 9a736da1b82c6af06af1b187b56befce5ef49a92..4fe285e567941178ae902477abc6c171f6cf24d7 100755 (executable)
@@ -5,6 +5,7 @@ action="$1"
 . "$_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
index 6c761a747aba50f42ae76a8d7e68caaafe0d650b..de357871bd49695f9a2b01efc81c1f12178b2628 100755 (executable)
@@ -25,16 +25,17 @@ theme_pagemenu(){
   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
 }
 
@@ -74,9 +75,9 @@ theme_editor(){
   [ "$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"
@@ -85,8 +86,8 @@ theme_editor(){
          <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">
@@ -123,19 +124,19 @@ theme_attachments(){
   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
@@ -157,11 +158,11 @@ theme_attachments(){
                 "$(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