Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For askbot we implemented this just to show that there are translations and there are still two issues - occasionally incorrect display of translations and lack of proper multilingual search.

Source code of askbot site is here https://github.com/ASKBOT/askbot-devel/tree/askbot-site, it is a little out of date, but it is easy to merge with the master branch.

We use an extension called django-multilingual, available here http://code.google.com/p/django-multilingual/, and at the time we started using this it was necessary to patch some code in askbot, so it is forked.

For askbot we implemented this just to show that there are translations and there are still two issues - occasionally incorrect display of translations and lack of proper multilingual search.

Source code of askbot site is here https://github.com/ASKBOT/askbot-devel/tree/askbot-site, it is a little out of date, but it is easy to merge with the master branch.

We use an extension called django-multilingualdjango-localeurl, available here http://code.google.com/p/django-multilingual/, http://pypi.python.org/pypi/django-localeurl/1.4, and at the time we started using this it was necessary to patch some code in askbot, so it is forked.

For askbot we implemented this just to show that there are translations and there are still two issues - occasionally incorrect display of translations and lack of proper multilingual search.

Source code of askbot site is here https://github.com/ASKBOT/askbot-devel/tree/askbot-site, it is a little out of date, but it is easy to merge with the master branch.

We use an extension called django-localeurl, available here http://pypi.python.org/pypi/django-localeurl/1.4, and at the time we started using this it was necessary to patch some code in askbot, so it is forked.

Also we have the following modifications in the settings:

MIDDLEWARE_CLASSES = (
    #'django.middleware.gzip.GZipMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    #'django.middleware.locale.LocaleMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    #'django.middleware.cache.UpdateCacheMiddleware',
    'askbot_site.middleware.JinjaDjangoLocaleUrlMiddleware',
    'django.middleware.common.CommonMiddleware',
    #'django.middleware.cache.FetchFromCacheMiddleware',
    #'django.middleware.sqlprint.SqlPrintingMiddleware',

    #below is askbot stuff for this tuple$
    'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
    'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
    'askbot.middleware.cancel.CancelActionMiddleware',
    'django.middleware.transaction.TransactionMiddleware',
    #'debug_toolbar.middleware.DebugToolbarMiddleware',
    'askbot.middleware.view_log.ViewLogMiddleware',
    'askbot.middleware.spaceless.SpacelessMiddleware',
)

Also I have 'localeurl', in my INSTALLED_APPS.

And one more group of settings:

import re
LOCALE_INDEPENDENT_PATHS = (
    re.compile(r'^/m/'),
    re.compile(r'^/rosetta'),
    re.compile(r'^/admin'),
    re.compile(r'^/cache'),
    re.compile(r'^/account/signin'),
    re.compile(r'^/comment/upvote'),
    re.compile(r'^/account/delete_login_method'),
    re.compile(r'^/sitemap\.xml'),
    re.compile(r'^/doc'),
    re.compile(r'^/robots.txt'),
    re.compile(r'^/feeds/rss'),
    re.compile(r'^/upload'),
    re.compile(r'^/followit'),
)

If you have any files missing, please let me know, I'll add them to the repo.