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(docs): versioning CLI should copy localized translation file current.json to version-<v>.json #10875

Merged

Conversation

jkboxomine
Copy link
Contributor

@jkboxomine jkboxomine commented Jan 28, 2025

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

When tagging a new version in a site where both i18n and versioning are applied, the i18n resource file for the tagged version is not created and the user must create it manually.

  • Typically, when tagging a new version, a user expects that an i18n resource file for the newly tagged version (version-{version_number}.json) is created based on current.json.
  • However, the file is not created at all during the versioning process and the user must create it manually for each localized language.

Test Plan

I verified that the changes work by installing it from a local Docusaurus repo on the Docusaurus website code itself, enabling i18n for one of the localized languages, and tagging a new version with the CLI.

Test links

N/A (The code change is related to CLI, which is non-UI related.)

Related issues/PRs

N/A

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 28, 2025
Copy link

netlify bot commented Jan 28, 2025

[V2]

Name Link
🔨 Latest commit 5ce472f
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/679cb5ec2fd1e2000815d7af
😎 Deploy Preview https://deploy-preview-10875--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Jan 28, 2025

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🔴 43 🟢 98 🟢 96 🟢 100 Report
/docs/installation 🟠 53 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 72 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 62 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 64 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 63 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 73 🟢 100 🟢 100 🟠 86 Report

@slorber slorber changed the title fix: Add code to copy i18n resource files while versioning fix(docs): versioning CLI should copy i18n/<l>/docusaurus-plugin-content-docs/current.json Jan 31, 2025
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jan 31, 2025
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

LGTM thanks 👍

Added a test to cover this case

@slorber slorber changed the title fix(docs): versioning CLI should copy i18n/<l>/docusaurus-plugin-content-docs/current.json fix(docs): versioning CLI should copy localized translation file current.json to version-<v>.json Jan 31, 2025
@slorber slorber merged commit 3b72bb4 into facebook:main Jan 31, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants