1

We are actually creating a website with some comunity elements. We choose django as programming language. We'd like to keep the website multilingual. We already created some apps and website, but kept them static and singlle-language. I read about 2 approaches to create a multilingual website. The first is to keep the translations in a database. This should be the easiest way, but way to unefficient and with an ordinary performance. I also read about setting up a xml translation file, where you can store every single translation.

I'd like to know the differences in performance and the advantage or disadvantages of these approaches. Is there any efficient way in django to keep my website multi-language?

Depa
  • 459
  • 8
  • 18

1 Answers1

1

Django has good built in support for multiple languages based on GNU gettext.

Unfortunately, the support is limited to text that you know in advanced, which is good enough for your UI, but if you have users creating content in multiple languages, it will not be enough, and you'll have to deal with it yourself in the database.

JeffS
  • 2,647
  • 2
  • 19
  • 24
  • I guess he's refering to UI text, so +1 for django built-in – Alvaro May 08 '14 at 00:31
  • Sounds good. I'll read the django page. I already have everything i need, to translate the website, but i am also working with some kind of api, which is providing my page with some content (its already translated in different languages). is it an good alternative to use django AND a database to translate the whole content of my website? – Depa May 08 '14 at 01:11
  • @Depa It's typical to use the Django tools for the content created by Django, and a database (or possibly just the results of the API in your case), and use `django.utils.translation.get_language()` or serve content from the current language for dynamic content – JeffS May 08 '14 at 20:20