Ask Your Question

Implementing language choice

asked 2012-10-12 09:26:57 -0600

Ulf Karlsson gravatar image


First, thanks for developing this piece of software, it is impressive.

We are trying to implement a QA site for support that we're trying to make available in different languages and we do not want to mix the languages but we would still like to allow users to browse and post in the QA-section for other languages, thus different instances of Askbot is not the best option.

It seems like this is not possible with the current version of Askbot and the groups feature does not seem to be exactly what we're looking for. Is this planned in any future releases?

We may try to implement this otherwise. Do you have any suggestions regarding how this could be implemented? Also, do you have any other means of communicating between developers, it would be nice to feel that we are are part of the community of Askbot while we're doing this, for asking quick questions regarding how to do this and that and hearing about how development proceeds and what the roadmap is etc..

Kind regards,

edit retag flag offensive close merge delete


This will be great. I agree that it would be better to develop this in tandem so that this feature is immediately available to all when it is completed.

finid gravatar imagefinid ( 2012-10-12 12:41:27 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-12 15:07:52 -0600

Evgeny gravatar image

There are several issues to solve:

  • make dynamic language selection work well for the UI translation (it kind of works, but there are edge cases where parts of the UI are in one language and other parts in another - I think the issues are in how translations work in the jinja2 templates).
  • make selection of content depend on the current language
  • possibly add language code to the url scheme - there is a an app called localeurl, maybe that can help.
  • add UI for translation of the content

Consider that there may be another solution - mount language specific sites on the subdomains (wikipedia does it this way). This method would allow locating the servers for specific languages physically in the regions where there are more speakers of that language, but with this approach it would be harder to synchronize user accounts and the user sing-in.

edit flag offensive delete link more


Hello, Thanks for your answer. We have opted for the solution where we allow content selection to depend on a user selectable choice of current language (a box in the upper right corner). We have added a language field to User, Thread and Tag. So, all queries have been adapted so that the language is taken into consideration whes displaying questions and tags. It adds a bit of complexity to the code, e.g. every time we want to search for tags or otherwise work with tags, we have to pass in the language to those functions. Also, when a thread is moved from one language to another (continued)

Ulf Karlsson gravatar imageUlf Karlsson ( 2012-10-26 06:25:28 -0600 )edit

we have to keep track of the tag counts correctly... We also wanted a notion of persistent tags that do not go away when usage count is 0 - these may be added through the admin inteface. It may be possible to generalize this and instead of language have a section field.. but that section field would still have to be passed around when Tags are queried. Do you think this is anything that could be interesting for inclusion in Askbot, in that case we may try to generalize our code and refactor it according to any guidelines you could provide. Kind regards,

Ulf Karlsson gravatar imageUlf Karlsson ( 2012-10-26 06:31:07 -0600 )edit

Hi, could you share this code? I need the same feature and I could help with the code. It's a win-win situation :)

siovene gravatar imagesiovene ( 2012-11-03 15:14:01 -0600 )edit

@siovene, the solution was to use the django-multilingual app. It is pretty easy to enable, but you might to hack get_absolute_url functions in some places inside askbot code, also some urls should be made exempt from the internationalization. I'll try to give you some more info early this week.

Evgeny gravatar imageEvgeny ( 2012-11-04 10:55:43 -0600 )edit

@Evgeny I've used django-modeltranslation in another project with success. But I guess I was looking for more than that. I would like the following: 1. Users must tag every question with a language (either a tag in the form of lan-en, lang-de, etc, or a selection box); 2. When the user selects a language he wants to use, then the site appears localized that way (including the model translations) and the questions are filtered by that language. So is there something like this somewhere, maybe in some branch? I'm okay with spending time improving it if it's not perfect yet.

siovene gravatar imagesiovene ( 2012-11-04 23:49:07 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-10-12 09:26:57 -0600

Seen: 285 times

Last updated: Oct 12 '12