I just took over an old project using Django 1.8 + Python 2.7. I need to refactor a feature where I have to retrieve different information based on different host information and display it on the page. Additionally, I need to internationalize this displayed information.
my code looks something like this:
<div>
{% blocktrans with site_name=request.site.site_name %} welcome to {{ site_name }} {% endblocktrans %}
</div>
I want to translate this entire content, but I found that only the variable ‘site_name’ was translated
eg:site_name = “stackoverflow”
I want to translate welcome to stackoverflow
, not stockoverflow
.
Can you tell me how to solve this problem?
thanks!!!!
cchenjuan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.