Ciao Luca, Take a look at django's i18n [0], it will spare you a lot of work.
[0] https://docs.djangoproject.com/es/1.9/topics/i18n/ On Tue, Apr 19, 2016 at 11:27 AM, 'luca72' via Django users < [email protected]> wrote: > hello my view.py is like this: > > from django.contrib import auth > from django.contrib.auth.decorators import login_required > from django.db import models > from django.core.files.storage import FileSystemStorage > #from django.core.servers.basehttp import FileWrapper > from django.contrib.auth import authenticate, login > from .forms import FormContatti > from django.core.mail import send_mail > from django.views.decorators.csrf import csrf_protect > global lenguage > language = 'it' > > > > def first_page(request): > testo = ["aaaa ....." , 'bbbbbb'] > if language == 'it': > testo = testo[0] > else : > testo = testo[1] > return render(request,'polls/first_page.html',{'testo':testo,}) > > where language can be it or en, in the web page i have two flag where i > have to place an <href and i need only to pass the global variable > language, because any view have the if statement to the global varible > language > > Thanks for your help > > Luca > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/157f35f6-7f52-4451-ae68-0fb704b9e64b%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/157f35f6-7f52-4451-ae68-0fb704b9e64b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- --- Gabriel Marcondes Engenheiro de Computação - UFSCar -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE0ZiweeugexOp09s3gG2OYDeyDUksq6J1DkkuTg_%2Bb30BbH1w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

