Cache detected langTags
Categories
(Firefox :: Translations, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: nordzilla, Assigned: nordzilla)
References
Details
Attachments
(1 file)
When doing in-page translations, we end up calling getLangTagsForTranslation()
twice.
Once to determine if the translations icon should appear on the page, and once again to populate the dropdown menus in the translations panel:
Computing this value is very fast when we are able to pull the langTag from the document's markup, but there is a delay on websites which need to utilize the language identification engine to detect the language. The behavior when using the language identification engine is such that the panel opens with blank dropdowns, and then they populate after a noticeable delay.
We already have a data member for #langTags
but it is not being set when we call the getLangTagsForTranslation()
function.
We should update this function to cache the tags upon first retrieval so that there is no delay in populating the language dropdowns when using the language identification engine.
Assignee | ||
Comment 1•2 years ago
|
||
Caches the detected langTags to ensure that the language
identification engine does not need to run twice when
populating the languag dropdowns in the translations panel.
![]() |
||
Comment 3•2 years ago
|
||
bugherder |
Description
•