The resolved redirection link may also be an external one. But we haven't check this before assigning the enUSFallbackURL, which caused the only-in-en-us CSS class to be added accidentally to the external links.
Solution
Check whether the resolved URL is an external one, if so, do not assign the enUSFallbackURL. Which means, the only-in-en-us CSS class would not be added.
Screenshots
Checkout the git commit sha f277be087b9484b077fc734e5192d83bc3ee04a1, which is the last commit sha before the fix in translated-content (mdn/translated-content#21711).
Check the section /zh-CN/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension#打包和发布:
Summary
Fixes: mdn/translated-content#20809
Problem
The resolved redirection link may also be an external one. But we haven't check this before assigning the
enUSFallbackURL
, which caused theonly-in-en-us
CSS class to be added accidentally to the external links.Solution
Check whether the resolved URL is an external one, if so, do not assign the
enUSFallbackURL
. Which means, theonly-in-en-us
CSS class would not be added.Screenshots
Checkout the git commit sha
f277be087b9484b077fc734e5192d83bc3ee04a1
, which is the last commit sha before the fix in translated-content (mdn/translated-content#21711).Check the section
/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension#打包和发布
:Before
See: mdn/translated-content#20809
After
How did you test this change?
Run
yarn dev
, and check the rendered page.