-
-
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
Missing type definitions for @docusaurus/theme-translations #6087
Comments
Agree it's unexpected that it's not published https://unpkg.com/browse/@docusaurus/[email protected]/lib/ This should fix it: #6088 However, I must warn that You are implementing a single plugin, unlike us, so you can as well use a simpler approach and just have a This fn is mostly suited for our own use-case, as we need to split translations per plugin, but also gather them into a unique place so that files to translate are easier to find for our translators. You likely have different requirements, and our way of organizing translation is maybe not the best for a repo with a single plugin. Maybe you could re-use |
Thank you for the additional insights! I think when I initially implemented i18n in my plugin I looked at how the core plugins were handling translations and copied that. I'll use |
Agree we could provide a convenient way for plugin authors to manage translations on disc, including the locale fallback strategy. But it would probably be something different than
This could be dangerous and fail, Docusaurus expects that all |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
I am trying to make my local search plugin (https://github.com/cmfcmf/docusaurus-search-local) work with Docusaurus beta 10+. #5849 has moved
readDefaultCodeTranslationMessages
to@docusaurus/theme-translations
. However, the version of@docusaurus/theme-translations
published to npm does not include type defintions forreadDefaultCodeTranslationMessages
. For more context on the migration see cmfcmf/docusaurus-search-local#82.Steps to reproduce
@docusaurus/[email protected]
readDefaultCodeTranslationMessages
in a TypeScript projectExpected behavior
@docusaurus/theme-translations
should contain TypeScript definitions.Actual behavior
@docusaurus/theme-translations
does not contain TypeScript definitions.Your environment
No response
Reproducible demo
No response
Self-service
The text was updated successfully, but these errors were encountered: