Commits

Andriy Kornatskyy committed 8366959

Localization for mako templates

Comments (0)

Files changed (3)

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

 </%def>
 
 <ul id="menu">
-    ${menu_item('home', 'Home')}
-    ${menu_item('about', 'About')}
+    ${menu_item('home', _('s:Home'))}
+    ${menu_item('about', _('s:About'))}
 </ul>
 </%block>

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

     cache_key="${'menu-locale' + route_args.route_name}">
 
 <i><a href="${path_for(route_args.route_name, locale='en')}"
-        >English</a> | <a
+        >${_('English')}</a> | <a
         href="${path_for(route_args.route_name, locale='ru')}"
-        >Russian</a></i>
+        >${_('Russian')}</a></i>
 </%block>

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

     cache_key="${route_args.locale + 'menu-signin' + (principal and principal.alias or '')}">
 
 % 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>]
 % endif
 </%block>