Translations don't properly set the "lang" attribute
shawnbot opened this issue · 1 comments
It looks like there are some localization-related things happening in either our JavaScript or Google Translate that are fighting with the way that formio-sfds
is told which language it should be using. The expectation right now is that the closest element with a lang
attribute determines this, which used to work until recently. However, I'm now seeing a DOM that looks like this after I've chosen Spanish in the language selector:
<article role="article"
class="[...] sfgov-translate-lang-es" lang="en">
<div class="[...] sfgov-translate-lang-es">
This bit in our JS appears to be coming up with the right class to add:
sfgov/web/themes/custom/sfgovpl/src/js/translate.js
Lines 43 to 46 in c385d71
...but the lang
attribute is still en
. I don't know where the lang
attribute is getting set, and I didn't find anything our JS that does that; so maybe Google Translate is doing it? 🤷
/cc @aekong
JIRA ticket here: https://sfgovdt.jira.com/browse/SG-1110
Closing!