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

chore: improve translations for multi-locale #65

Closed
wants to merge 3 commits into from

Conversation

TanguyFi
Copy link

@TanguyFi TanguyFi commented Apr 1, 2021

Hi there,

First, thanks a lot for this incredible plugin for Docusaurus ! 👌 I used it at work to search in my docs in two languages.

Nevertheless, it was not possible to localized this plugin in more than one locale, so this is the goal of this PR. Feel free to make me remarks. ;-)

@coveralls
Copy link

coveralls commented Apr 2, 2021

Coverage Status

Coverage increased (+0.04%) to 78.734% when pulling 8ff4482 on TanguyFi:master into ae7ce72 on easyops-cn:master.

@weareoutman
Copy link
Member

👍 Well done!

I think it would be better if we provide a new option to keep backward compatibilities. E.g., a new option of i18n which will take precedence over translations

@TanguyFi
Copy link
Author

TanguyFi commented Apr 5, 2021

I made the changes that you suggest, is it OK ? 🙂

| searchResultLimits | number | `8` | Limit the search results. |
| searchResultContextMaxLength | number | `50` | Set the max length of characters of each search result to show. |
| translations | TranslationMap | - | Set translations of this plugin, see [docs below](#translations). |
| i18n | TranslationLocaleMap | - | Allow to translate the plugin for more than one locale, see [docs below](#translations). |
Copy link
Member

Choose a reason for hiding this comment

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

I'm not familiar with i18n in Docusaurus right now, but I think we should follow the official i18n guide of Docusaurus, it seems that it supports i18n of plugins which is defined by files in specific path.

By the way, I have a limited time to maintain this project and to learn new features from Docusaurus, so it may take days to review a PR.

@weareoutman
Copy link
Member

Hi we just supported docusaurus i18n system in #182 , so we're going to close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants