List Info

Thread: Templates




Templates
country flaguser name
United States
2007-10-18 05:22:18
Hi...
  I am trying inernationalization.
{% for lang in LANGUAGES %}
<option value="{{ lang.0}}" >{{ lang.1
}}</option>
{% endfor %}
 This lists all the languages in the settings.py .

Can someone tell me how to get the current language being
used in the
template? I managed to pass it from my view. but is there
some way to
get this from the template?
I tried {% load i18n %}
{% get_current_language as LANGUAGE_CODE %}  This gives the
code.
please advice


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Templates
user name
2007-10-18 13:32:20
2007/10/18, AniNair <anitnairgmail.com>:
>
> Hi...
>   I am trying inernationalization.
> {% for lang in LANGUAGES %}
> <option value="{{ lang.0}}" >{{ lang.1
}}</option>
> {% endfor %}
>  This lists all the languages in the settings.py .
>
> Can someone tell me how to get the current language
being used in the
> template? I managed to pass it from my view. but is
there some way to
> get this from the template?
> I tried {% load i18n %}
> {% get_current_language as LANGUAGE_CODE %}  This gives
the code.
> please advice
Just use it, {} as the tag just gets the
language, or
perhaps I'm missing something...

-- 
Antoni Aloy López
Binissalem - Mallorca
http://www.trespams.com
Soci de Bulma - http://www.bulma.cat

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )