How translate live search?
Is it possible translate live search through PO files? For example text in searchbox: "search or ask your question".
Is it possible translate live search through PO files? For example text in searchbox: "search or ask your question".
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.
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.
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.
Awesome, I will take a look today.
To enter a block of code:
Comments