Commits

Andriy Kornatskyy committed 868716a

Localization for wheezy templates

  • Participants
  • Parent commits d47a680

Comments (0)

Files changed (4)

demos/template/content/templates-wheezy/preprocessor/shared/master.html

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
-        <title>My Site - \
+        <title>@_('My Site') - \
         @def title():
         @end
         @title()</title>
         <div class="page">
             <div id="header">
                 <div id="title">
-                    <h1><a href="@path_for('default')">My Site</a></h1>
+                    <h1><a href="@path_for('default')">@_('My Site')</a></h1>
                 </div>
                 <div id="logindisplay">
                     #include("shared/snippet/menu-signin.html")
                     @end
                     @content()\
                 </div>
-                <div id="footer">Version #__version__</div>
+                <div id="footer">@_('Version') #__version__</div>
             </div>
         </div>
         #include("shared/snippet/script.html")

demos/template/content/templates-wheezy/shared/snippet/menu-header.html

-@require(path_for, route_args)
+@require(_, path_for, route_args)
 @def menu_item(route_name, title):
     @# ignore
     @if route_name == route_args.route_name:
     <a href="@path_for(route_name)">@title</a></li>\
 @end
 <ul id="menu">
-    @menu_item('home', 'Home')
-    @menu_item('about', 'About')
+    @menu_item('home', _('s:Home'))
+    @menu_item('about', _('s:About'))
 </ul>

demos/template/content/templates-wheezy/shared/snippet/menu-locale.html

-@require(path_for, route_args)
+@require(_, path_for, route_args)
 <i>
-    <a href="@path_for(route_args.route_name, locale='en')">English</a> | \
-    <a href="@path_for(route_args.route_name, locale='ru')">Russian</a>
+    <a href="@path_for(route_args.route_name, locale='en')">@_('English')</a> | \
+    <a href="@path_for(route_args.route_name, locale='ru')">@_('Russian')</a>
 </i>

demos/template/content/templates-wheezy/shared/snippet/menu-signin.html

-@require(principal, path_for)
+@require(_, principal, path_for)
 @if principal:
-Welcome <b>@principal.alias!h</b>! [
-<a href="@path_for('signout')">Sign out</a>]
+@_('Welcome') <b>@principal.alias!h</b>! [
+<a href="@path_for('signout')">@_('Sign out')</a>]
 @else:
-[<a href="@path_for('signin')">Sign in</a>]
+[<a href="@path_for('signin')">@_('Sign in')</a>]
 @end