]> git.plutz.net Git - shellwiki/blobdiff - handlers/40_edit_attachment.sh
Merge commit '6bc502434737d7f08379e79b94fc6fda424ef779'
[shellwiki] / handlers / 40_edit_attachment.sh
index 97a4b9df2d8825be71512714c98f6e8fbdd193cf..b23a35d31bc9fc03632703751fd638d60123f0dc 100755 (executable)
@@ -1,5 +1,19 @@
 #!/bin/sh
 
+# Copyright 2022 - 2023 Paul Hänsch
+# 
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+# 
+# THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
 REV_ATTACHMENTS="${REV_ATTACHMENTS:-false}"
 
 if [ "${PATH_INFO##*/\[attachment\]}" ]; then
@@ -163,51 +177,51 @@ elif [ "$action" = rename ]; then
 
   if [ "$success" -a "$fail" ]; then
     printf "%s\r\n" "Status: 500 Internal Server Error"
-    theme_page - "Attachment rename" <<-EOF
-       <h1 class="rename partial">Some files could not be renamed</h1>
-       <h2 class="rename success">Successfully renamed:</h2>
+    theme_page - "$(_ "Attachment rename")" <<-EOF
+       <h1 class="rename partial">$(_ Some files could not be renamed)</h1>
+       <h2 class="rename success">$(_ Successfully renamed:)</h2>
        <ul class="rename success">
        $(printf %s "$success" |while read html; do
          printf '<li><span class=from>%s</span> -&gt; <span class=to>%s</span></li>' \
                 "${html%%/*}" "${html##*/}"
        done)
        </ul>
-       <h2 class="rename fail">Errors:</h2>
+       <h2 class="rename fail">$(_ Errors:)</h2>
        <ul class="rename fail">
        $(printf %s "$fail" |while read html; do
          printf '<li><span class=from>%s</span> -&gt; <span class=to>%s</span></li>' \
                 "${html%%/*}" "${html##*/}"
        done)
        </ul>
-       <a class="button rename fail" href="[attachment]">OK</a>
+       <a class="button rename fail" href="[attachment]">$(_ OK)</a>
        EOF
     exit 0
 
   elif [ "$fail" ]; then
     printf "%s\r\n" "Status: 500 Internal Server Error"
-    theme_page - "Attachment rename" <<-EOF
-       <h1 class="rename fail">Files could not be renamed</h1>
+    theme_page - "$(_ "Attachment rename")" <<-EOF
+       <h1 class="rename fail">$(_ "Files could not be renamed")</h1>
        <ul class="rename fail">
        $(printf %s "$fail" |while read html; do
          printf '<li><span class=from>%s</span> -&gt; <span class=to>%s</span></li>' \
                 "${html%%/*}" "${html##*/}"
        done)
        </ul>
-       <a class="button rename fail" href="[attachment]">OK</a>
+       <a class="button rename fail" href="[attachment]">$(_ OK)</a>
        EOF
     exit 0
 
   elif [ "$success" ]; then
     printf 'Refresh: %i\r\n' 4
     theme_page - "Attachment rename" <<-EOF
-       <h1 class="rename success">Files were renamed</h1>
+       <h1 class="rename success">$(_ Files were renamed)</h1>
        <ul class="rename success">
        $(printf %s "$success" |while read html; do
          printf '<li><span class=from>%s</span> -&gt; <span class=to>%s</span></li>' \
                 "${html%%/*}" "${html##*/}"
        done)
        </ul>
-       <a class="button rename success" href="[attachment]">OK</a>
+       <a class="button rename success" href="[attachment]">$(_ OK)</a>
        EOF
     exit 0