I'm looking at someone else's Django registration templates and I see the line {% load i18n %}
in every file. What is i18n
?
I know it has something to do with International and localization, but could someone explain it and give a detailed example? Thanks.
{% load i18n %} is needed for internationalization. The purpose of internationalization is to allow a single application to read in multiple languages. In order to do this: you need a few hooks called translation strings. To give your template access to these tags, put {% load i18n %} toward the top of your template..
A successful i18n effort ensures that your app, website, or software is ready to be localized to meet the needs of different regional markets. Effective i18n allows you to translate and update every piece of text without changing the source code.
Internationalization (sometimes shortened to "I18N , meaning "I - eighteen letters -N") is the process of planning and implementing products and services so that they can easily be adapted to specific local languages and cultures, a process called localization .
It loads translation tags such as {% trans "Text" %}
that could be used in template. If you do not use it you can remove {% load i18n %}
When you use trans
tag for all text that is not dynamic in templates you can then collect all such strings by running ./manage.py makemessages
which creates .po file that would be used for translation.
{% load i18n %}
is needed for internationalization. The purpose of internationalization is to allow a single application to read in multiple languages. In order to do this: you need a few hooks called translation strings. To give your template access to these tags, put {% load i18n %}
toward the top of your template..
Refer to this for more info: https://docs.djangoproject.com/en/1.10/topics/i18n/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With