-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
feat(v2): Add Interpolate / interpolate APIs + complete theme translations #4295
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 86e6b98 |
[V1] Deploy preview success Built with commit 86e6b98 |
Size Change: +11.9 kB (+2%) Total Size: 544 kB
ℹ️ View Unchanged
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4295--docusaurus-2.netlify.app/classic/ |
Going to use This way, the current is more compatible with the ICU format (subset of it). If we need to support more ICU features in the future it won't require any breaking change, and will likely be better understood by translation softwares supporting ICU. |
Motivation
To provide exhaustive Docusaurus classic theme translations, we need a way to interpolate a string containing placeholders with string or JSX values.
This is particularly useful with the
Translate
component, when we need to wrap some placeholders in additional JSX like a Docusaurus Link, or have a substring being translated independently...Note:
Sources of inspirations:
Other studied solutions:
Also complete the theme translations
Also add a script to manage the default theme translations more easily for maintainers:
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
tests + dogfooding