docs: Remove discussion of old Django templating engine.

This was unnecessary complexity for users, and in fact, we removed the
code a couple months ago.
This commit is contained in:
Tim Abbott 2017-06-15 11:47:00 -07:00
parent 2c76f2b1e3
commit 3d1d09b3d3
1 changed files with 10 additions and 13 deletions

View File

@ -210,13 +210,15 @@ These files are uploaded to [Transifex][], where they can be translated.
All user-facing text in the Zulip UI should be generated by an HTML All user-facing text in the Zulip UI should be generated by an HTML
template so that it can be translated. template so that it can be translated.
Zulip uses two types of templates: backend templates (powered by the Zulip's HTML is primarily implemented using two types of HTML
[Jinja2][] template engine, though the original [Django][] template templates: backend templates (powered by the [Jinja2][] template
engine is still supported) and frontend templates (powered by engine used for logged-out ("portico") pages and the webapp's base
[Handlebars][]). content) and frontend templates (powered by [Handlebars][]) used for
live-rendering HTML from JavaScript for things like the main message
feed.
To mark a string for translation in the Jinja2 and Django template To mark a string for translation in the Jinja2 template engines, you
engines, you can use the `_()` function in the templates like this: can use the `_()` function in the templates like this:
``` ```
{{ _("English text") }} {{ _("English text") }}
@ -225,9 +227,8 @@ engines, you can use the `_()` function in the templates like this:
If a string contains both a literal string component and variables, If a string contains both a literal string component and variables,
you can use a block translation, which makes use of placeholders to you can use a block translation, which makes use of placeholders to
help translators to translate an entire sentence. To translate a help translators to translate an entire sentence. To translate a
block, Jinja2 uses the [trans][] tag while Django uses the block, Jinja2 uses the [trans][] tag. So rather than writing
[blocktrans][] tag. So rather than writing something ugly and something ugly and confusing for translators like this:
confusing for translators like this:
``` ```
# Don't do this! # Don't do this!
@ -239,8 +240,6 @@ You can instead use:
``` ```
# Jinja2 style # Jinja2 style
{% trans %}This string will have {{ value }} inside.{% endtrans %} {% trans %}This string will have {{ value }} inside.{% endtrans %}
# Django style
{% blocktrans %}This string will have {{ value }} inside.{% endblocktrans %}
``` ```
Zulip expects all the error messages to be translatable as well. To Zulip expects all the error messages to be translatable as well. To
@ -356,11 +355,9 @@ This basically identifies you as a Transifex user, so you can access your
organizations from the command line. organizations from the command line.
[Django]: https://docs.djangoproject.com/en/1.9/topics/templates/#the-django-template-language
[Jinja2]: http://jinja.pocoo.org/ [Jinja2]: http://jinja.pocoo.org/
[Handlebars]: http://handlebarsjs.com/ [Handlebars]: http://handlebarsjs.com/
[trans]: http://jinja.pocoo.org/docs/dev/templates/#i18n [trans]: http://jinja.pocoo.org/docs/dev/templates/#i18n
[blocktrans]: https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#std:templatetag-blocktrans
[i18next]: http://i18next.com [i18next]: http://i18next.com
[official]: http://i18next.com/translate/pluralSimple/ [official]: http://i18next.com/translate/pluralSimple/
[helpers]: http://handlebarsjs.com/block_helpers.html [helpers]: http://handlebarsjs.com/block_helpers.html