Ask Your Question
1

How translate live search?

asked 2013-05-17 04:03:37 -0600

wowas gravatar image

updated 2013-05-17 04:04:40 -0600

Is it possible translate live search through PO files? For example text in searchbox: "search or ask your question".

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2014-01-31 08:30:57 -0600

olduser gravatar image

updated 2014-01-31 08:47:34 -0600

Hi, I'm trying to use Askbot in french and I have problems with the livesearch default text. The text translated in lines 133-135 in the djangojs.po file isn't used:

#: media/js/live_search.js:313
msgid "search or ask your question"
msgstr "rechercher ou poser votre question"

So I should I've prompted in the input:"rechercher ou poser votre question", but the text shown is "search or poser votre question" which is a concatenation done in livesearch.js in lines 313-321

var InputToolTip = function() {
    WrappedElement.call(this);
    this._promptText = interpolate(
    gettext('search or %(ask_your_question)s'),
    {'ask_your_question': askbot['messages']['askYourQuestion'].toLowerCase() },
    true
    );
};
inherits(InputToolTip, WrappedElement);

This javascript code is using a translation made in lines 123-125 in the djangojs.po file:

#: media/js/live_search.js:218
msgid "Ask Your Question"
msgstr "Poser votre question"

The only way I found to get the correct translation is to change the var InputToolTip function and then regenerate the translations files.

edit flag offensive delete link more

Comments

I've opened an issue on Github with a modification of the `live_search.js` script https://github.com/ASKBOT/askbot-devel/pull/204. The new var InpuToolTip function works for french without any modifications of the `.po` and `.mo` files, It seems to work with other languages too.

olduser gravatar imageolduser ( 2014-02-01 05:27:39 -0600 )edit

Awesome, I will take a look today.

Evgeny gravatar imageEvgeny ( 2014-02-01 12:58:25 -0600 )edit
0

answered 2013-05-17 15:11:46 -0600

Evgeny gravatar image

updated 2013-05-18 14:40:27 -0600

Yes - the file djangojs.po in your locale should have the message, please let us know if it does not, we'll add it.

All the strings from the .js files are described in djangojs.po and the rest in django.po.

important: - please use transifex.com to make translations (google askbot transifex), we maintain translations only there.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-17 04:03:37 -0600

Seen: 279 times

Last updated: Jan 31 '14