question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[i18n] allow translating docsearch labels

See original GitHub issue

Discussed in https://github.com/vuejs/vitepress/discussions/1368

<div type='discussions-op-text'>

Originally posted by Zogsha September 19, 2022 Hi, thanks for your work on vitepress!

My documentation site is written in French, so I need the Docsearch component in French.

I have two problems :

  1. There is a algolia.buttonText option in themeConfig. I set it to “Rechercher” instead of the default “Search”, but whenever I click on the search component or use “CTRL+K”, the placeholder turns back to “Search”. It only displays “Rechercher” when the page refreshes. I only tested in dev.

  2. In the Docsearch API Reference, there is translations option (https://docsearch.algolia.com/docs/api#translations). I can’t figure out how to configure it.

I think 1. is not intended, but I didn’t look further. Is 2. intended ? If that is the case, do you plan to let us translate the Doscsearch modal via algolia config in themeConfig?

Thanks, Aliosha</div>

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kiakingcommented, Oct 31, 2022

Well currently at the initial render, we display placeholder that mimics Algolia search button, and when user clicks on the button, Algolia will render its button.

So, we should pass in those VitePress config to Algolia I guess 👀

For (2), the translations key… maybe we should support it? I mean if it’s set, we use that for VitePress’s placeholder too.

0reactions
fake-carcommented, Dec 8, 2022

@brc-dd Thanks a lot, I will give it a try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[i18n] Making everything translatable (website title, description...)
Feature First of all, the i18n feature of Docusaurus is terrific, thanks a lot! It seems that the website's title can't be translated....
Read more >
HOWTO: Upload Labels Translations in Nuxeo Studio (i18n)
Studio allows you to upload .properties files to be deployed with the customization plugin. It's useful: To translate new labels that appear ...
Read more >
i18n - Tutorial - Docusaurus
Locate all text labels in your React code that will be visible to your users, and mark them with the translation APIs. There...
Read more >
The Translation View - Paligo
Paligo has its own built-in translation environment called the Translation View. You can use it to edit translations and manage translation ...
Read more >
API Reference | DocSearch by Algolia
If you are using DocSearch v2, see the legacy documentation. ... Allow translations of any raw text and aria-labels present in the DocSearch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found