I have a website that is written in dutch. Now I have to provide a second language for that website which is french.
So I surrounded all text that needs to be translated with the gettext function, created the po files and compiled those to mo files. I also created a view that sets the django_language session to the appropriate language code. So now the french version is working but I can't switch back to the dutch version.
So I was wondering do I need to create a po/mo file for the dutch version also? The text that's being past to gettext is already in dutch. Is there a way to say use the 'default text'?
This is the view I use to add the language code to my session:
class LanguagePickerView(RedirectView):
url = '/'
def get(self,request,*args, **kwargs):
request.session['django_language'] = self.kwargs.get('language')
return super(LanguagePickerView, self).get(request, args, kwargs)
In my templates I use the following urls:
<a href='{% url web-language 'nl-nl' %}'>NL</a>
<a href='{% url web-language 'fr' %}'>fr</a>