]> git.plutz.net Git - shellwiki/blobdiff - macros/revisions
various translations
[shellwiki] / macros / revisions
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
     @@\ *\ @@*)