Commits

Andriy Kornatskyy committed 4727906

Localization for jinja2 templates

Comments (0)

Files changed (3)

demos/template/content/templates-jinja2/public/about.html

 {% extends "/shared/master.html" %}
-{% block title %}About{% endblock %}
+{% block title %}{{ _('About') }}{% endblock %}
 {% block content %}
 <div id="about">
-    <h2>About</h2>
+    <h2>{{ _('About') }}</h2>
     <p>Proin at lorem vel dolor pharetra aliquam. Phasellus auctor,
     nunc vitae lobortis pretium, mauris ligula sagittis quam, nec
     volutpat est arcu a diam. Nunc nisi augue, sollicitudin eu

demos/template/content/templates-jinja2/public/home.html

 {% extends "/shared/master.html" %}
-{% block title %}Home{% endblock %}
+{% block title %}{{ _('Home') }}{% endblock %}
 {% block content %}
 <div id="welcome">
-    <h2>Welcome!</h2>
+    <h2>{{ _('Welcome!') }}</h2>
     <p>
     Lorem ipsum dolor sit amet, consectetur adipiscing elit.
     Donec quis tempus tellus. Curabitur faucibus fermentum enim,

demos/template/content/templates-jinja2/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 - {% block title %}{% endblock %}</title>
+        <title>{{ _('My Site') }} - {% block title %}{% endblock %}</title>
         <link href="{{ path_for('static', path='css/site.css') }}"
         type="text/css" rel="stylesheet" />
     </head>
         <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">
                     {% inline "shared/snippet/menu-signin.html" %}
                     {% block content %}
                     {% endblock %}
                 </div>
-                <div id="footer">Version {{ __version__ }}</div>
+                <div id="footer">{{ _('Version') }} {{ __version__ }}</div>
             </div>
         </div>
         {% inline "shared/snippet/script.html" %}