I am investigating what is possible with i18next localization library.
Right now I have the following code (full Fiddle is here):
HTML
Consider calling
$('body').i18n()
inside .done() function. You should tell where to look for localizer. This will work without having to call [placeholders] in the data-i18n attribute.
For me the following worked
<input data-i18n="[placeholder]placeTransl" value="name">
So just enter the attribute's name between [] and then the translation.
After asking i18next creator this question directly, I received the following reply: all I need is to put my custom attribute in front of the translation element. Here is an example:
<div data-i18n="[title]titleTransl"></div>
<input data-i18n="[placeholder]placeTransl" value="name">
If multiple attributes are needed, separate them by a ;
.
I learned 2 things by this: