Translating the shop templates

Edit the shop/base.html template of the shop application. Make sure that you load the i18n tag at the top of the template and mark strings for translation as follows:

{% load i18n %}{% load static %}<!DOCTYPE html><html><head>  <meta charset="utf-8" />  <title>    {% block title %}{% trans "My shop" %}{% endblock %}  </title>  <link href="{% static "css/base.css" %}" rel="stylesheet"></head><body>  <div id="header">    <a href="/" class="logo">{% trans "My shop" %}</a>  </div>  <div id="subheader">    <div class="cart">      {% with total_items=cart|length %}        {% if cart|length > 0 %}          {% trans "Your cart" %}:          <a href="{% url "cart:cart_detail" %}">            {% blocktrans with total_items_plural=total_items|pluralize  total_price=cart.get_total_price ...

Get Django 2 by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.