本地化与l20n属性 [英] Localize an attribute with l20n
本文介绍了本地化与l20n属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想本地化占位符
与L20N属性。我找不到自己的文档中任何事情,做这个(意料之中)无法正常工作。
<输入类型=文本数据本地化-ID =电子邮件/>
解决方案
一个正常的翻译(这意味着你要替换的内容)是这样写的:
<试验,这是一个翻译文本>
您可以再转换成这样的属性:
<试验,这是一个翻译文本的称号:这是标题>
在你的情况,你只想要属性,因此这将工作:
<试验占位符:这是一个翻译文本>
中的HTML应
<输入类型=文本数据本地化-ID =测试占位符=/>
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" />
解决方案
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="" />
这篇关于本地化与l20n属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文