Dropdown menus aren't translated
Categories
(Firefox :: Translations, defect)
Tracking
()
People
(Reporter: mkaply, Unassigned)
References
()
Details
Attachments
(1 file)
72.97 KB,
image/png
|
Details |
I was trying to use this website:
https://www.soeren-hentzschel.at/kontakt/
and translations works great except the dropdown menu is not translated.
We should translate HTML Select.
Comment 1•7 months ago
|
||
The severity field is not set for this bug.
:gregtatum, could you have a look please?
For more information, please visit BugBot documentation.
Comment 2•7 months ago
|
||
While the page is lang="de"
, a parent div of the select
has lang="en-US"
, which full page translation respects. Normally I would say this is a case for select (as in context menu) translation, but we can't right click translate the select options. I'm marking as invalid as this is still correct behavior. If you remove the lang
attribute the select properly translates.
Reporter | ||
Comment 3•7 months ago
|
||
Odd that other browsers translate the whole thing.
Comment 4•7 months ago
|
||
Hmm... that is true. Erik: what do you think about this case? Other browsers aren't respecting the lang attribute in divs. I tested and they happily translate tags labeled as other languages.
Comment 5•7 months ago
•
|
||
I think it's worth considering.
On one hand, it appears to users as though we do the wrong thing here (even though we are intentionally respecting the language tag). On the other hand, there exist cases in which the specified language tags do match the content, and then it would be correct to not translate it.
I think the key goal here should be feature parity with other popular browsers, as well as maximizing the perception of "correctness."
In Bug 1859081, we audited Google's algorithm for when to offer Translations for a page as a whole, and came up with a list of changes to make that would improve feature parity on our end.
I think it would be worth doing the same thing here, before we make a final decision.
Surface-Level Investigation
I experimented with Google Chrome a bit (without looking at their code yet), and I can't exactly tell what they do.
They certainly seem to have a "detected language" mode, because I tested our Select Translations test file, which correctly uses lang
attributes and has content in 3 different languages. Google Chrome seems to have a full-page "translate from detected language" mode, that is capable of translating the entire page correctly to a single target language.
However, I also experimented with manually translating the <select>
items in https://www.soeren-hentzschel.at/kontakt/ from German to Chinese (Simplified), then replacing them in the markup while retaining the lang="en-US"
tag. This resulted in Google hilariously translating everything incorrectly, and, curiously, leaving one of the strings in Chinese (see attached screenshot). I assume it ran the Chinese strings with the context of de -> en
, though if that's the case I'm surprised the end results are even coherent despite being incorrect translations.
Conclusion
It appears that Google Chrome is doing some fine-grained language detection, but is also not 100% correct when the lang
attributes don't match the actual content.
My stance right now is that we shouldn't make any changes to outright ignore lang
attributes in favor of fixing this single case, but we should consider cases in which we can run the language detector to try to achieve better feature parity with other popular browsers.
Comment 6•7 months ago
|
||
Comment 7•7 months ago
|
||
While the page is lang="de", a parent div of the select has lang="en-US", which full page translation respects.
Oh, I wasn't aware that the lang attribute was used there. That's the disadvantage of using plugins instead of developing everything yourself. As it affects my website, I just fixed it. ;-)
Comment 8•7 months ago
|
||
My stance right now is that we shouldn't make any changes to outright ignore lang attributes in favor of fixing this single case, but we should consider cases in which we can run the language detector to try to achieve better feature parity with other popular browsers.
Well put! I agree and filed: Bug 1910486
Description
•