First time here? Check out the FAQ!
1

How translate live search?

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

wowas's avatar
1
wowas
asked 2013-05-17 04:03:37 -0500, updated 2013-05-17 04:04:40 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

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.

Evgeny's avatar
13.2k
Evgeny
answered 2013-05-17 15:11:46 -0500, updated 2013-05-18 14:40:27 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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.

olduser's avatar
11
olduser
answered 2014-01-31 08:30:57 -0500, updated 2014-01-31 08:47:34 -0500
edit flag offensive 0 remove flag delete link

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's avatar olduser (2014-02-01 05:27:39 -0500) edit

Awesome, I will take a look today.

Evgeny's avatar Evgeny (2014-02-01 12:58:25 -0500) edit
add a comment see more comments