multi languages, in backend only for the moment
[booh] / lib / booh / booh-lib.rb
index e593cb37d9148d46ceff560975232bff50407388..804add313ed5aa578432431822415d8eb9c0bbff 100644 (file)
@@ -58,12 +58,17 @@ module Booh
         end
     end
 
-    def sizename(key)
+    def sizename(key, translate)
         #- fake for gettext to find these; if themes need more sizes, english name for them should be added here
-        sizenames = { 'small' => utf8(_("small")), 'medium' => utf8(_("medium")), 'large' => utf8(_("large")),
-                      'x-large' => utf8(_("x-large")), 'xx-large' => utf8(_("xx-large")),
-                      'original' => utf8(_("original")) }
-        return sizenames[key] || key
+        sizenames = { 'small' => N_("small"), 'medium' => N_("medium"), 'large' => N_("large"),
+                      'x-large' => N_("x-large"), 'xx-large' => N_("xx-large"),
+                      'original' => N_("original") }
+        sizename = sizenames[key] || key
+        if translate
+            return utf8(_(sizename))
+        else
+            return sizename
+        end
     end
     
     def from_utf8(string)
@@ -824,6 +829,9 @@ French: Guillaume Cottenceau')),
         return sorted_entries
     end
 
+    def defer_translation(msg)
+        return "@@#{msg}@@"
+    end
 end
 
 class File