You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I updated to the latest version of Multi-Account Container and tested if I can reproduce the issue
I searched for existing reports to see if it hasn't already been reported
Step to reproduce
N/A
Actual behavior
The current code in js/i18n.js doesn't let us specify an attribute.
Expected behavior
We should be able to translate attributes. Code example:
document.querySelectorAll('[data-i18n]').forEach(node => {
let [attr, text] = node.dataset.i18n.split('|');
text = browser.i18n.getMessage(text);
attr ? node.setAttribute(attr, text) : node.append(text);
});
<input data-i18n="placeholder|Here the text for my placeholder">
To support multiple attributes, we simply split the string twice and use two different delimiter. For example,
dannycolin
changed the title
Add support for translating tag attributes (e.g. placeholder)
Add support for translating multiple tag attributes
Jul 13, 2022
Before submitting a bug report
Step to reproduce
N/A
Actual behavior
The current code in
js/i18n.js
doesn't let us specify an attribute.Expected behavior
We should be able to translate attributes. Code example:
To support multiple attributes, we simply split the string twice and use two different delimiter. For example,
Additional informations
No response
Provide a copy of Troubleshooting Information page
The text was updated successfully, but these errors were encountered: