使用 l20n 本地化属性

Localize an attribute with l20n

我想用 L20N 本地化 placeholder 属性。我在他们的文档中找不到任何内容,并且这样做(不出所料)不起作用。

<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 placeholder:"this is a translated text">

HTML应该是

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