Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(flaws): don't report link to missing translation as broken if en-US fallback exists #9408

Merged
merged 11 commits into from
Mar 15, 2024

Conversation

yin1999
Copy link
Member

@yin1999 yin1999 commented Jul 31, 2023

Summary

Resolves: https://github.com/orgs/mdn/discussions/144

stop report URL to not localized doc as broken

Problem

To reduce the workload on update the URLs which have pointed to en-US when a document is localized. We always make the URL pointed to a localized page, as Yari could fallback to en-US automatically. But it reports too many flaws (which may let the user change the link to point to en-US).

And in the above discuesstion, there is no maintainer has objected to stopping reporting such flaws.

Solution

Only modify the link if the linked page is not localized, and suggest to use localized URL (even if the page is not existed).

but we may need to reorganize the repair logic for links (with the flaws reporting).


How did you test this change?

Modify the URL at the end of https://github.com/mdn/translated-content/blob/b96d6e1bd2f1b30ced085c2ca7088246a80b9ff4/files/zh-cn/web/html/element/input/search/index.md?plain=1#L133

如果没有指定 `incremental` ,则仅当用户显式启动搜索时(例如,在编辑字段时按 <kbd>Enter</kbd> 或 <kbd>Return</kbd> )才发送 [`search`](/zh-CN/docs/Web/Events/search) 事件。

As the URL to search event is only in en-US and has a redirection.

Check if the suggestion is /zh-CN/docs/Web/API/HTMLInputElement/search_event.

And also check if there is any flaws about this link before we modify this URL (reporting this could fallback to en-US).

@github-actions github-actions bot added the flaw-system issues and feature requests related to the flaws system label Jul 31, 2023
@yin1999 yin1999 marked this pull request as draft July 31, 2023 06:45
@yin1999 yin1999 marked this pull request as ready for review August 4, 2023 13:11
@awxiaoxian2020
Copy link
Contributor

Any update for this PR?

@caugner caugner requested a review from a team as a code owner November 7, 2023 19:12
@github-actions github-actions bot added the idle label Jan 24, 2024
@caugner caugner changed the title fix(build): stop report URL to not localized doc as broken fix(flaws): don't report link to missing translation as broken if en-US fallback exists Mar 15, 2024
testing/tests/index.test.ts Outdated Show resolved Hide resolved
@caugner caugner merged commit f9756d1 into mdn:main Mar 15, 2024
9 checks passed
@caugner
Copy link
Contributor

caugner commented Mar 15, 2024

Sincere apologies for the long wait @yin1999 and @awxiaoxian2020, and awesome work! 🙌

@yin1999 yin1999 deleted the ignore-not-localized-flaws branch March 15, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaw-system issues and feature requests related to the flaws system idle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants