Commits

Andriy Kornatskyy committed c6e00f1

Localization for jinja2 templates

  • Participants
  • Parent commits 4727906

Comments (0)

Files changed (3)

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

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

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

 <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>

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

 {% if principal: %}
-Welcome <b>{{ principal.alias | e }}</b>!
-[<a href="{{ path_for('signout') }}">Sign out</a>]
+{{ _('Welcome') }} <b>{{ principal.alias | e }}</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 %}