Translate custom attributes with i18next (placeholder, value)

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:

  • I have to read better documentation.
  • 118next's creator is really helpful (this is a thank you remark for him).

For me the following worked

<input data-i18n="[placeholder]placeTransl" value="name">

So just enter the attribute's name between [] and then the translation.