Ask Your Question

How translate live search?

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

wowas gravatar image

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

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

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

olduser gravatar image

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

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() {;
    this._promptText = interpolate(
    gettext('search or %(ask_your_question)s'),
    {'ask_your_question': askbot['messages']['askYourQuestion'].toLowerCase() },
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


I've opened an issue on Github with a modification of the `live_search.js` script 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 -0500 )edit

Awesome, I will take a look today.

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

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

Evgeny gravatar image

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

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 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


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

Seen: 278 times

Last updated: Jan 31 '14