Ask Your Question

url translations

asked 2012-01-06 12:16:22 -0500

piskvorky gravatar image

updated 2012-01-06 12:58:56 -0500

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-01-06 12:27:33 -0500

Evgeny gravatar image

This option currently only toggles translation of urls in the 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.

edit flag offensive delete link more


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 gravatar image piskvorky  ( 2012-01-06 12:31:58 -0500 )edit

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

Evgeny gravatar image Evgeny  ( 2012-01-06 12:47:22 -0500 )edit

Created a bug entry for this

Evgeny gravatar image Evgeny  ( 2012-01-06 12:59:07 -0500 )edit

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 gravatar image piskvorky  ( 2012-01-06 16:06:37 -0500 )edit

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 gravatar image piskvorky  ( 2012-01-07 17:38:02 -0500 )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


Asked: 2012-01-06 12:16:22 -0500

Seen: 124 times

Last updated: Jan 06 '12