我试图让我的扩展程序通过本地化字符串使用aria标记,如MDN中所述。所以,我有一个属性文件,其中包含:
new_file=New file
new_file.ariaLabel=Creates a new file
然后,我试图在我的侧边栏html代码中使用它:
<button type="button" class="btn ui-button">
<span class="glyphicon glyphicon-plus"
data-l10n-id="new_file"
aria-label="new_file.ariaValueText"/>
</button>
new_file在span中工作,我可以读取它,但不能读取aria标签。我试着没有在html中指定aria-label,也写了任何东西,但它不起作用。我错过了什么?提前谢谢!