Created
December 15, 2012 19:34
-
-
Save aruseni/4298465 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These strings are not present in any other template or Python file, so you just put them here in order to make the makemessages management command keep them in the translation file. | |
{% load i18n %} | |
{% trans "Some string you want to keep in the django.po translation file" %} | |
{% trans "So makemessages won't comment it out each time you run it" %} | |
{% trans "This template does not have to be used anywhere, putting it in your templates directory is enough" %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes you want to put some dynamically generated strings in the translation file, but do not want to manually uncomment these messages after each run of the makemessages management command (python manage.py makemessages). In these cases you can put such template in your templates dir and add the strings there (so they won't be automatically commented out when you run the makemessages management command).
Please note that if you deal with translation of model objects content, you can also use django-modeltranslation or some other similar package.