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

Remove duplicated frontmatter keys from localized content #7412

Closed
queengooborg opened this issue Aug 7, 2022 · 15 comments · Fixed by #14355
Closed

Remove duplicated frontmatter keys from localized content #7412

queengooborg opened this issue Aug 7, 2022 · 15 comments · Fixed by #14355
Labels
good first issue A good issue for newcomers to get started with. help wanted If you know something about this, we would love your help!

Comments

@queengooborg
Copy link
Collaborator

queengooborg commented Aug 7, 2022

As pointed out by @yin1999, frontmatter metadata (ex. tags, title) is combined with the metadata from the original en-US docs. As such, keys such as tags, browser-compat, and spec-urls is redundant to copy to the localized content. These duplicated keys should be removed from the localized docs for easier maintenance overall. We should only keep: title, short_title, slug, original_slug and l10n.*.

Edit; July 18, 2023
A configuration file is now present in this repository, which will let us utilize the frontmatter linter in upstream content! To use the linter to fix the frontmatter, perform the following:

cd /path/to/mdn/content
yarn fix:fm --configFile /path/to/mdn/translated-content/front-matter-config.json --files /path/to/mdn/translated-content/files/<locale>
@yin1999 yin1999 added l10n-ja Issues related to Japanese content. l10n-fr Issues related to French content. l10n-zh Issues related to Chinese content. l10n-es Issues related to Spanish content. l10n-ru Issues related to Russian content. l10n-ko Issues related to Korean content. l10n-pt-br Issues related to Brazilian Portuguese labels Aug 7, 2022
@SphinxKnight
Copy link
Member

@queengooborg is there any "deadline" or something blocked by this or can we go progressively during "new" edits on pages?

Note to self: double-check HTMLRef (and maybe JS or CSS sidebar as I have a doubt about them not using localized pages' tags)

@queengooborg
Copy link
Collaborator Author

This can be done progressively and isn't blocking anything, so it can be done at our own leisure!

@SphinxKnight SphinxKnight self-assigned this Aug 7, 2022
@queengooborg queengooborg changed the title Remove tags frontmatter key from localized content Remove tags frontmatter keys from localized content Aug 7, 2022
@queengooborg queengooborg changed the title Remove tags frontmatter keys from localized content Remove duplicated frontmatter keys from localized content Aug 7, 2022
@queengooborg
Copy link
Collaborator Author

In another issue (#5618), @yin1999 pointed out that all frontmatter keys are merged with the en-US metadata. I've broadened the scope of this issue to include all redundant metadata!

@SphinxKnight
Copy link
Member

Without testing, I'd go for removing translation_of, this key might be useful for dealing with orphaned/conflicting pages but does not contain any other info than the slug (in a yari world).

@queengooborg queengooborg added the help wanted If you know something about this, we would love your help! label Aug 9, 2022
@yin1999 yin1999 removed their assignment Aug 20, 2022
@yin1999 yin1999 removed the l10n-zh Issues related to Chinese content. label Aug 20, 2022
@yin1999
Copy link
Member

yin1999 commented Aug 20, 2022

Done for l10n-zh

@YujiSoftware
Copy link
Contributor

YujiSoftware commented Aug 28, 2022

I made a script to batch delete.
https://gist.github.com/YujiSoftware/bfa7aa0957d276c679f52d254baea6b1

ruby remove_frontmatter_keys.rb files\ja\webassembly

Remove anything but the meta below.

  • title
  • slug
  • original_slug
  • l10n.*
  • i10n.*

Lou8is added a commit to Lou8is/translated-content that referenced this issue Jun 10, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jun 10, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jun 10, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jun 10, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jun 10, 2023
SphinxKnight added a commit to Lou8is/translated-content that referenced this issue Jul 3, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jul 3, 2023
SphinxKnight added a commit to Lou8is/translated-content that referenced this issue Jul 4, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jul 8, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jul 16, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jul 19, 2023
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jul 19, 2023
This reverts commit 3f9550a, reversing
changes made to a851416.
Lou8is added a commit to Lou8is/translated-content that referenced this issue Jul 19, 2023
SphinxKnight added a commit to Lou8is/translated-content that referenced this issue Jul 19, 2023
@SphinxKnight SphinxKnight removed the l10n-fr Issues related to French content. label Jul 31, 2023
@queengooborg queengooborg removed the l10n-ru Issues related to Russian content. label Aug 2, 2023
@yin1999 yin1999 unpinned this issue Aug 12, 2023
@yin1999 yin1999 moved this to Archive/Closed in MDN translated-content l10n-zh May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good issue for newcomers to get started with. help wanted If you know something about this, we would love your help!
Projects
7 participants