st4lk / django-solid-i18n-urls

[DEPRECATED] Use default language for urls without language prefix.
http://www.lexev.org/en/
Other
112 stars 29 forks source link

TemplateDoesNotExist at /fr/ #31

Closed amehdi92 closed 8 years ago

amehdi92 commented 8 years ago

Hello,

I'm working on a bilingual website and decided to use django-solid-i18n. However, after putting my index in /static/templates/fr and /static/templates/en, I got the message: TemplateDoesNotExist at /fr/.

Here's my views.py:

from django.shortcuts import render

def home(request): context={} template='index.html' return render(request,template,context)

And urls.py: from django.contrib import admin from django.conf.urls import patterns, include, url from solid_i18n.urls import solid_i18n_patterns import profiles.views

urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^i18n/', include('django.conf.urls.i18n')), ]

urlpatterns = solid_i18n_patterns('', url(r'^$', profiles.views.home, name='home'),

)

st4lk commented 8 years ago

Hello! This is not the way how translation works in django. You don't need to have separate template for each language. Create one template, mark translatable strings (for example by using {% trans '...' %} template tag) and translate those strings. Please, read the docs carefully.

st4lk commented 8 years ago

Closing, if some additional help is needed, please reopen