jenseng / react-i18nliner

translate="yes" all the things
MIT License
45 stars 15 forks source link

piggy-back on key for placeholder name #12

Closed jenseng closed 9 years ago

jenseng commented 9 years ago

This could provide a mechanism to specify a friendlier placeholder, rather than letting it be inferred. For example:

<p translate="yes">
  Create <input onChange={this.createAccounts} /> new user accounts
</p>

Currently this yields "Create %{input_on_change_this_create_accounts} new accounts", which is terrible, and likely to change.

If we used the key, you could do this:

<p translate="yes">
  Create <input key="numAccounts" onChange={this.createAccounts} /> new user accounts
</p>

then the string could just be "Create %{num_accounts} new accounts"