问题
I'd like to localize a placeholder
attribute with L20N. I can't find anything in their documentation, and doing this (unsurprisingly) doesn't work.
<input type="text" data-l10n-id="email" />
回答1:
A normal translation (meaning you want to replace the content) is written like this:
<test "this is a translated text">
You can then translate attributes like this:
<test "this is a translated text" title:"this is the title">
In your case, you only want the attribute, so this will work:
<test placeholder:"this is a translated text">
The HTML should be
<input type="text" data-l10n-id="test" placeholder="" />
来源:https://stackoverflow.com/questions/29329204/localize-an-attribute-with-l20n