wikimedia / jquery.i18n

🌐 jQuery based internationalization library
GNU General Public License v2.0
704 stars 144 forks source link

More than one html attribute in data-i18n label #180

Closed JaviPalla closed 6 years ago

JaviPalla commented 6 years ago

Hi, I'm trying to have an input html element with two different html attributes bound in its data-i18n attribute. My approach after reading on the web was to have this pattern in order to bind more than one message to the same data-i18n element:

<input id="dni" type="text" class="form-control" data-i18n="[placeholder]dni;[maxlength]dniLength" data-bind="value: dataCenter.nie" />

[placeholder]dni;[maxlength]dniLength

But the obtained behaviour is that I get a placeholder containing dni;[maxlength]dniLength.

How can I achieve that? I don't even know if this feature is already implemented Thank you!!!!

santhoshtr commented 6 years ago

Sorry, this is not currently possible with the library. I did not completely understood the usecase, but I guess you may need to programmatically set the localized message to the html element.