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

Replace old-style compatibility/specification tables with new macro #5618

Closed
queengooborg opened this issue May 13, 2022 · 17 comments
Closed
Labels
l10n-pt-br Issues related to Brazilian Portuguese l10n-ru Issues related to Russian content.

Comments

@queengooborg
Copy link
Collaborator

queengooborg commented May 13, 2022

In mid-2019, we have migrated all of the compatibility table information over to the BCD project. Recently, we have also transitioned to using BCD to generate the specifications table.

When I went and marked the old {{CompatXXX}} macros as deprecated in Yari, I happened to notice that there are a LOT of translations that are still using the old-style compatibility tables, which means readers may be getting outdated compatibility information. We should go through and replace all of these tables with ones generated by the new {{Compat}} macro. While we're at it, we should also replace the specifications tables with the {{Specifications}} macro as well.

Steps to fix pages:

  • Find pages that use any of the following macros: CompatAndroid, CompatChrome, CompatGeckoDesktop, CompatGeckoMobile, CompatibilityTable, CompatIE, CompatNo, CompatOpera, CompatOperaMobile, CompatSafari, CompatUnknown, CompatVersionUnknown, spec, spec2, SpecName
  • Replace all content in the "Specifications" section with {{Specifications}}
  • Replace all content in the "Browser Compatibility" section with {{Compat}}

P.S. BCD has an open issue regarding how to handle localization for notes. We're open to suggestions, see mdn/browser-compat-data#114 for more!

@yin1999
Copy link
Member

yin1999 commented Jun 4, 2022

For replacing the specifications tables, I've using <table class="standard-table">[\s\S\r]*</table> to match and replace with {{Specifications}} if existed in en-US. The script I've used is here (in Golang, really simple, may not deal with all the cases).

And please check the modifications made by this script, because of the usage of standard-table in other tables.

@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-de (retired) Issues related to German content. l10n-ko Issues related to Korean content. l10n-pl (retired) Issues related to Polish content. l10n-pt-br Issues related to Brazilian Portuguese labels Jul 31, 2022
@yin1999
Copy link
Member

yin1999 commented Aug 7, 2022

Hi @queengooborg, I found that yari will merge metadata from en-US when render a macro in l10n documents, so whether it's ok to remove browser-compat metadata from l10n documents (is there any other usage of this metadata)?

see: https://github.com/mdn/yari/blob/5d8d88976164b6f653c3f2de688f3cd76f8537bb/kumascript/index.js#L56-L69

@queengooborg
Copy link
Collaborator Author

Great catch, thanks for the info @yin1999! Since the en-US metadata is merged, then we can omit the frontmatter key -- I've updated the instructions accordingly!

@hochan222
Copy link
Member

@queengooborg Hello!

Replace all content in the "Browser Compatibility" section with {{Compat}}

I have a question for confirmation. Is it ok to change everything to {{Compat}} as shown below?

  • AS IS
<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.Cache.put")}}</p>
  • TO BE
<h2 id="Browser_compatibility">Browser compatibility</h2>

{{Compat}}

@hochan222
Copy link
Member

hochan222 commented Aug 8, 2022

ko-locale

@yin1999
Copy link
Member

yin1999 commented Aug 8, 2022

  • TO BE

<h2 id="Browser_compatibility">Browser compatibility</h2>



{{Compat}}

This is ok, I've used this in l10n-zh.

@hochan222
Copy link
Member

hochan222 commented Aug 8, 2022

@yin1999 , Thank you for the reply 🙇🙇

@yin1999
Copy link
Member

yin1999 commented Aug 9, 2022

done for l10n-zh

@yin1999 yin1999 removed the l10n-zh Issues related to Chinese content. label Aug 9, 2022
@SphinxKnight
Copy link
Member

just in case someone needs a regex or two:

\{\{\s*compatAndroid|\{\{\s*compatChrome|\{\{\s*compatGecko|\{\{\s*compatibilityTable|\{\{\s*compatIE|\{\{\s*compatIE|\{\{\s*CompatNo|\{\{\s*compatOpera|\{\{\s*compatSafari|\{\{\s*compatUnknown|\{\{\s*compatVersionUnknown

\{\{\s*spec\s*\(|\{\{\s*spec2\s*\(|\{\{\s*specName\s*\(

yin1999 pushed a commit that referenced this issue Nov 6, 2022
* chore: remove instances of CompatChrome

This removes instances of `CompatChrome` from the content. It also updates some sections to be closer to mdn/content.
Your feedback is appreciated.

Part of #5618

* Apply `es` suggestions from code review

* Apply suggestions from code review

Co-authored-by: Alexander <[email protected]>
Co-authored-by: Masahiro FUJIMOTO <[email protected]>
@YujiSoftware
Copy link
Contributor

I wrote a script to migrate Specifications.
(Removed old spec macros and insert specifications macros)
https://gist.github.com/YujiSoftware/6ca47a35df8097c15dd5c1c4f7f23c3c

Already applied to ja.

@hochan222
Copy link
Member

Done for l10n-ko. Have a nice day :)

@hochan222 hochan222 removed the l10n-ko Issues related to Korean content. label Jan 24, 2023
@Graywolf9
Copy link
Contributor

Done for es. Thank you so much!

@Graywolf9 Graywolf9 removed the l10n-es Issues related to Spanish content. label Jan 27, 2023
@mfuji09 mfuji09 removed the l10n-ja Issues related to Japanese content. label Jan 29, 2023
@queengooborg
Copy link
Collaborator Author

Closing in favor of the new tracking issue at #11594.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n-pt-br Issues related to Brazilian Portuguese l10n-ru Issues related to Russian content.
Projects
Development

No branches or pull requests

8 participants