First time here? Check out the FAQ!
1

url translations
 

I can't get the new ASKBOT_TRANSLATE_URL to work, using the current master branch. After setting LANGUAGE_CODE = 'de', I expected that all urls will be either all translated or all not translated.

The question url is ok:

  • /question/xyz for ASKBOT_TRANSLATE_URL=False, or
  • /frage/xyz for True.

But the ajax vote url is some half-translated hybrid, in both cases: askbot['urls']['vote_url_template'] = scriptUrl + 'fragen/{{QuestionID}}/vote/';.

And then the POST of course fails, in both cases, so ppl cannot vote. You said you're reworking the language stuff now -- is this some work-in-progress, or am I doing it wrong?

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, updated 13 years ago

Comments

see more comments

1 Answer

1

This option currently only toggles translation of urls in the urls.py file.

To do this properly - the check for the ASKBOT_TRANSLATE_URL condition must be added to the templates as well. There are a few places where urls are not inserted into the templates using the {% url %} template tag, that's because the "reverse" function in some cases must be run by javascript, but there is no equivalent for it in js. So we need to solve this problem somehow.

A workaround is - modify all url translations in the django.po and djangojs.po files - anything that has slashes in the key strings, there are not too many of them actually. If you mark those strings as "fuzzy", the translations will be disabled.

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

So the master branch now won't work, no matter how ASKBOT_TRANSLATE_URL is set?

I fixed/hacked the vote url (I sent a pull request on github) but if there are more problems, I'll probably just revert to an older version of askbot.

piskvorky's avatar piskvorky (13 years ago)

You'd have to revert to version 30 where this feature was introduced, it would be better to fix it properly though.

Evgeny's avatar Evgeny (13 years ago)

Created a bug entry for this http://bugs.askbot.org/issues/161

Evgeny's avatar Evgeny (13 years ago)

Great, thanks Evgeny. Can you answer my questions on the pull request? Maybe I could help if I understand better where the problem is.

piskvorky's avatar piskvorky (13 years ago)

Note for others: this quick-fix resolves the above issue, but there are other issues with translations, so it's not the whole story yet.

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