【问题标题】:Localize an attribute with l20n使用 l20n 本地化属性
【发布时间】:2015-06-02 11:09:08
【问题描述】:

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

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

【问题讨论】:

  • 您说的是 Mozilla 扩展(浏览器插件)还是一般的 HTML?
  • 谈L20N框架l20n.org
  • 抱歉,错过了标签 (:

标签: html localization internationalization attributes l20n


【解决方案1】:

一个普通的翻译(意思是你要替换的内容)是这样写的:

<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="" />

【讨论】:

  • 不适用于 href、my-custom-attribute 等属性
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-15
  • 1970-01-01
  • 2014-04-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多