Localize an attribute with l20n

元气小坏坏 提交于 2020-01-24 02:54:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!