mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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:
		@@ -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
 | 
			
		||||
template so that it can be translated.
 | 
			
		||||
 | 
			
		||||
Zulip uses two types of templates: backend templates (powered by the
 | 
			
		||||
[Jinja2][] template engine, though the original [Django][] template
 | 
			
		||||
engine is still supported) and frontend templates (powered by
 | 
			
		||||
[Handlebars][]).
 | 
			
		||||
Zulip's HTML is primarily implemented using two types of HTML
 | 
			
		||||
templates: backend templates (powered by the [Jinja2][] template
 | 
			
		||||
engine used for logged-out ("portico") pages and the webapp's base
 | 
			
		||||
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
 | 
			
		||||
engines, you can use the `_()` function in the templates like this:
 | 
			
		||||
To mark a string for translation in the Jinja2 template engines, you
 | 
			
		||||
can use the `_()` function in the templates like this:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
{{ _("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,
 | 
			
		||||
you can use a block translation, which makes use of placeholders to
 | 
			
		||||
help translators to translate an entire sentence.  To translate a
 | 
			
		||||
block, Jinja2 uses the [trans][] tag while Django uses the
 | 
			
		||||
[blocktrans][] tag.  So rather than writing something ugly and
 | 
			
		||||
confusing for translators like this:
 | 
			
		||||
block, Jinja2 uses the [trans][] tag.  So rather than writing
 | 
			
		||||
something ugly and confusing for translators like this:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
# Don't do this!
 | 
			
		||||
@@ -239,8 +240,6 @@ You can instead use:
 | 
			
		||||
```
 | 
			
		||||
# Jinja2 style
 | 
			
		||||
{% 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
 | 
			
		||||
@@ -356,11 +355,9 @@ This basically identifies you as a Transifex user, so you can access your
 | 
			
		||||
organizations from the command line.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[Django]: https://docs.djangoproject.com/en/1.9/topics/templates/#the-django-template-language
 | 
			
		||||
[Jinja2]: http://jinja.pocoo.org/
 | 
			
		||||
[Handlebars]: http://handlebarsjs.com/
 | 
			
		||||
[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
 | 
			
		||||
[official]: http://i18next.com/translate/pluralSimple/
 | 
			
		||||
[helpers]: http://handlebarsjs.com/block_helpers.html
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user