I'm trying to make my extension to use the aria tags through localized strings, as explained in MDN. So, I have a properties file with things like:
new_file=New file
new_file.ariaLabel=Creates a new file
And then, I'm trying to use it inside my sidebar html code:
<button type="button" class="btn ui-button">
<span class="glyphicon glyphicon-plus"
data-l10n-id="new_file"
aria-label="new_file.ariaValueText"/>
</button>
The new_file works in the span, I can read it, but not the aria label. I tryed without specifying an aria-label in the html, also to write anything, and it doesn't work. What am I missing? Thanks in advance!
Make your sidebar an xhtml file. Then use l10n xhtml localization: https://github.com/Noitidart/l10n/tree/xhtml-xul you can use this technique to populate your aria-
tags.
Here's a great guide on MDN for exactly the github link i gave you: https://developer.mozilla.org/en-US/Add-ons/Bootstrapped_extensions#Localization_%28L10n%29
Here's a link to l10n html options page (xhtml is just html with localization files) https://github.com/Noitidart/l10n/tree/html-options