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

chore(build): remove the translation_of metadata #10037

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

yin1999
Copy link
Member

@yin1999 yin1999 commented Nov 17, 2023

Summary

The "translation_of" metadata is used to present the en-US slug when we use a "localized" slug for a translated document. We have only used it in the past.

For now, we use the same slug for localized documents as for en-US documents, and we have removed the "translation_of" metadata from translated-content repo (check the search result, finished in mdn/translated-content#7412). It's time to get rid of this metadata key.

Solution

Search through the source code, and remove all the reference of this metadata key:

  1. remove it from the type definition.
  2. remove it from "documentData1.json", and update the urls/slugs (according to the "translation_of" fields).
  3. remove it from testing raw documents (under "testing/translated-content/files/" tree)
  4. remove the usage of it from "build/index.ts" (used to generate other_translation when the building document is from translation content and the slug is "localized" (the translations cannot be generated))
  5. remove the "redundant-translations" tool, which is used to detect documents that have the same "translation_of" metadata key

Screenshots

Check if the other translations can be generated without the translation_of metadata.

Before

image

After

image


How did you test this change?

@github-actions github-actions bot added the macros tracking issues related to kumascript macros label Nov 17, 2023
@yin1999 yin1999 marked this pull request as ready for review November 17, 2023 09:07
@yin1999 yin1999 requested a review from a team as a code owner November 17, 2023 09:07
@github-actions github-actions bot added the idle label Jan 24, 2024
Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up and apologies for the delay.

@fiji-flo fiji-flo merged commit e457ab8 into mdn:main Feb 14, 2024
9 checks passed
@yin1999 yin1999 deleted the remove-translation-of branch February 14, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle macros tracking issues related to kumascript macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants