Closed mslosarz closed 8 years ago
@mslosarz It's not clearly documented in the README, sorry. Regarding the translation of attributes, the README simply points to the specs. Here's how you'd do it:
<Translate component="input" type="email" id="inputEmail" className="form-control"
attributes={{ placeholder: "login_page.email_address" }}
required
/>
See also #14.
I've found how to do it on my own (I've analyzed spec.js). This library is great, but it'll greatest if in README or in demo will be example of use with common html attribute (alt for images / placeholders for input etc. :) Thanks for quick response.
@mslosarz It's not clearly documented in the README, sorry. Regarding the translation of attributes, the README simply points to the specs. Here's how you'd do it:
<Translate component="input" type="email" id="inputEmail" className="form-control" attributes={{ placeholder: "login_page.email_address" }} required />
See also #14.
Perfect answer, save my day. Thank you
I have an input element like this one:
<input type="email" id="inputEmail" className="form-control" placeholder="Email address" required/>
I've tried to translate it in this way:
<Translate component="input" type="email" id="inputEmail" className="form-control" placeholder="login_page.email_address" required/>
In result I expected to have translated placeholder, but I've got:
<input type="email" id="inputEmail" class="form-control" placeholder="login_page.email_address" required="">
What am I doing wrong?