multi languages, in backend only for the moment
[booh] / lib / booh / html-merges.rb
index ee89dd8e9a90f7e360605540195b867b4fc1450a..e04e2a45e56f0127e2433caca4ed9339a6576b6b 100644 (file)
@@ -41,11 +41,12 @@ dbltilda_current_size = '~~current_size~~';
 dbltilda_theme = '~~theme~~';
 dbltilda_stop_slideshow = '~~stop_slideshow~~';
 dbltilda_run_slideshow = '~~run_slideshow~~';
+dbltilda_htmlsuffix = '~~htmlsuffix~~';
 </script>
 EOF
 
-$image_head_code.sub!('~~run_slideshow~~', utf8(_('Run slideshow!')))
-$image_head_code.sub!('~~stop_slideshow~~', utf8(_('Stop slideshow')))
+$image_head_code.sub!('~~run_slideshow~~', defer_translation(N_('Run slideshow!')))
+$image_head_code.sub!('~~stop_slideshow~~', defer_translation(N_('Stop slideshow')))
 
 $body_additions = <<'EOF'
 onload="init()" id="body"
@@ -54,35 +55,35 @@ EOF
 $button_first = '
     <form action="fake"><input type="button"
                  onclick="first()"
-                 value="' + utf8(_('<<- First')) + '"
+                 value="' + defer_translation(N_('<<- First')) + '"
                  id="b_first"/></form>'
 
 $button_previous = '
     <form action="fake"><input type="button"
                  onclick="previous()"
-                 value="' + utf8(_('<- Previous')) + '"
+                 value="' + defer_translation(N_('<- Previous')) + '"
                  id="b_previous"/></form>'
 
 $button_next = '
     <form action="fake"><input type="button"
                  onclick="next()"
-                 value="' + utf8(_('Next ->')) + '"
+                 value="' + defer_translation(N_('Next ->')) + '"
                  id="b_next"/></form>'
 
 $button_last = '
     <form action="fake"><input type="button"
                  onclick="last()"
-                 value="' + utf8(_('Last ->>')) + '"
+                 value="' + defer_translation(N_('Last ->>')) + '"
                  id="b_last"/></form>'
 
 $button_slideshow = '
     <input type="button"
            onclick="toggle_slideshow(true)"
-           value="' + utf8(_('Run slideshow!')) + '"
+           value="' + defer_translation(N_('Run slideshow!')) + '"
            id="b_slideshow"/>'
 
 $pause_slideshow = '
-    <font size="-2">' + utf8(_('pause:')) + '<input type="text" id="secs" size="1" value="3"/>' + utf8(_('secs')) + '</font>'
+    <font size="-2">' + defer_translation(N_('pause:')) + '<input type="text" id="secs" size="1" value="3"/>' + defer_translation(N_('secs')) + '</font>'
 
 
 $image = <<'EOF'
@@ -136,21 +137,21 @@ function getPreferredSize() {
             size = document.cookie.substring(oleft, oright);
             for (i = 0; i < sizes.length; i++) {
                 if (sizes[i] == size) {
-                    return 'thumbnails-' + size + '-0.html';
+                    return 'thumbnails-' + size + '-0~~htmlsuffix~~';
                 }
             }
         }
     }
     w = document.body.offsetWidth;
     ~~size_auto_chooser~~
-    return 'thumbnails-~~default_size~~-0.html';
+    return 'thumbnails-~~default_size~~-0~~htmlsuffix~~';
 }
 
 window.location.href = getPreferredSize();
 
         </script>
 
-        <meta http-equiv="refresh" content="0.1;url=thumbnails-~~default_size~~-nojs-0.html">
+        <meta http-equiv="refresh" content="0.1;url=thumbnails-~~default_size~~-nojs-0~~htmlsuffix~~">
 </html>
 EOF
 
@@ -159,7 +160,7 @@ $index_head_code = '<meta name="generator" content="Booh-' + $VERSION + ' http:/
 <script language="JavaScript1.1" type="text/JavaScript">
 function init() {
     if (!document.cookie || document.cookie.indexOf("booh-not-a-newbie") == -1) {
-        document.getElementById("title").innerHTML += "<br/><br/>' + utf8(_("<i>Hint: you can click on the images to open the albums!</i>")) + '";
+        document.getElementById("title").innerHTML += "<br/><br/>' + defer_translation(N_("<i>Hint: you can click on the images to open the albums!</i>")) + '";
     }
     var expires = new Date(new Date().getTime() + (10 * 86400000));  // 10 days
     document.cookie = "booh-not-a-newbie=true"