Ask Your Question
1

url translations

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

piskvorky gravatar image piskvorky
350 9 4 19

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?

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

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

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
http://askbot.org/

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.

link publish delete flag offensive edit

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 ( 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 ( 2012-01-06 12:47:22 -0500 )edit

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

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

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

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

Seen: 60 times

Last updated: Jan 06 '12