First time here? Check out the FAQ!
1

Implementing language choice

Hello,

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,

Ulf Karlsson's avatar
33
Ulf Karlsson
asked 2012-10-12 09:26:57 -0600
edit flag offensive 0 remove flag close merge delete

Comments

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's avatar finid (2012-10-12 12:41:27 -0600) edit
add a comment see more comments

1 Answer

1

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.

Evgeny's avatar
13.2k
Evgeny
answered 2012-10-12 15:07:52 -0600
edit flag offensive 0 remove flag delete link

Comments

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's avatar Ulf 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's avatar Ulf 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's avatar siovene (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's avatar Evgeny (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's avatar siovene (2012-11-04 23:49:07 -0600) edit
add a comment see more comments