-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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 i18n default code translation bundles #4215
Conversation
[V1] Deploy preview success Built with commit 9c4e7ec |
Size Change: +14 B (0%) Total Size: 156 kB ℹ️ View Unchanged
|
Deploy preview for docusaurus-2 ready! Built with commit 9c4e7ec |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4215--docusaurus-2.netlify.app/classic/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Can we do extract messages for translation from attributes like aria-label
?
Also can we take into account subthemes like docusaurus-theme-search-algolia
(eg it contains input placeholder text "Search").
I'll have to complete all the missing translations and things we can translate, but here it's mostly the infrastructure. Providing exhaustive aria label translations and other language fallback translations can probably be made in other PRS |
Ah, got it, so if wrap other raw strings in the translation API functions, then they will be accessible to extract? |
Yes. There's a translate() fn for aria attributes
Le jeu. 11 févr. 2021 à 20:10, Alexey Pyltsyn <notifications@github.com> a
écrit :
… Ah, got it, so if wrap other raw strings in the translation API functions,
then they will be accessible to extract?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFW6PWKD6FMU7SPTZVRKY3S6QTQXANCNFSM4XPFRGQA>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you! I'll make other raw strings translatable in the next PR.
Motivation
For strings hardcoded in a theme (like "next"/"previous" pagination labels), we can pre-translate them in the current locale so that the user does not have to.
These "provided translation bundles" serve for 2 things:
docusaurus write-translations --locale fr
docusaurus start --locale fr
even iffr/code.json
does not existTest Plan
Tests