First time here? Check out the FAQ!
0

help with localization
 

I tried adding localization middleware following your example here.

Viewing pages works fine now, but I noticed ajax requests still lead to POST /questions/123/vote/, which then redirects (301) to GET en/questions/123/vote/, which of course fails because vote doesn't handle GET requests.

Any ideas where I went wrong in the settings? I am using askbot from the master branch of github.


My middleware settings:

MIDDLEWARE_CLASSES = (
#'django.middleware.gzip.GZipMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
#'django.middleware.cache.UpdateCacheMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'my_added.middleware.JinjaDjangoLocaleUrlMiddleware', # <------ added this one
'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',
)

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
piskvorky's avatar
350
piskvorky
asked 13 years ago

Comments

see more comments

1 Answer

0

Hello, that example has differences not only in the settings.py file, that's why it is not enough to just modify the settings.py.

If you want to use the multilingual site, then take that whole branch for the starting point.

We are going to merge the current master branch into the multilingual version, probably within two weeks, you might want to wait until then.

Another option - start with a single language site meanwhile.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 13 years ago
link

Comments

Yes, I changed other things as well, but apparently not enough. I will wait for your official merge then, thanks.

piskvorky's avatar piskvorky (13 years ago)
see more comments