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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
wowas's avatar
1
wowas
asked 11 years ago, updated 11 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago, updated 11 years ago
link

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
olduser's avatar
11
olduser
answered 11 years ago, updated 11 years ago
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 (11 years ago)

Awesome, I will take a look today.

Evgeny's avatar Evgeny (11 years ago)
see more comments