Html 使用l20n对属性进行本地化

Html 使用l20n对属性进行本地化,html,localization,internationalization,attributes,l20n,Html,Localization,Internationalization,Attributes,L20n,我想用L20N本地化一个占位符属性。我在他们的文档中找不到任何东西,这样做(毫不奇怪)是行不通的 <input type="text" data-l10n-id="email" /> 正常翻译(意思是您要替换内容)的编写方式如下: <test "this is a translated text"> <test "this is a translated text" title:"this is the title"> 然后可以像这样转换属性: &

我想用L20N本地化一个
占位符
属性。我在他们的文档中找不到任何东西,这样做(毫不奇怪)是行不通的

<input type="text" data-l10n-id="email" />

正常翻译(意思是您要替换内容)的编写方式如下:

<test "this is a translated text">
<test "this is a translated text" title:"this is the title">

然后可以像这样转换属性:

<test "this is a translated text">
<test "this is a translated text" title:"this is the title">

在您的情况下,您只需要属性,因此这将起作用:

<test placeholder:"this is a translated text">

HTML应该是

<input type="text" data-l10n-id="test" placeholder="" />


您是在谈论Mozilla扩展(浏览器加载项)还是通用HTML?谈论L20N框架哦,对不起,错过了标签(:不适用于诸如href、我的自定义属性之类的属性