Django Multilangual Site

Hello guys i want to make an multilangual site but i don’t have any idea how to do and i’ve some questions. First of all, after i finish my project i did a second template(for second lang) for every template. Then i change my idea and deleted secend templates and make one template for each page with using 7 or 8 if-elif-endif. Now i’m really confused about what to do. Does my first try was good and faster or my second is good and faster. And i’ve a idea but i don’t know is it possible. I want to make 1 template for each page and also at the back end i want to create dictionary(?) like this:

hello-bonjour-merhaba as a,
goodbye-aurevoir-hoscakal as b

and at the templates i just want to write {{dictionary.a}} or {{dictionary.b}}.

For final i hope you can understand my english and before finishing i want to add that i’m not 100% sure the meaning of the ‘template’, when i’m saying template i mean .html docs (like index.html and product.html is an template)

Check out the docs on internationalization (i18n). It’s a lot to learn but it’s worth it.

1 Like