From e583c021cb5258d391bede25465e294a6c6e6f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nazar=C3=A9=20da=20Piedade?= Date: Sat, 31 Aug 2024 11:21:31 +0100 Subject: [PATCH 1/2] docs: add a options template to localize algolia tool instructions closes #2744 --- packages/docs/.vitepress/config/en.ts | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/packages/docs/.vitepress/config/en.ts b/packages/docs/.vitepress/config/en.ts index 136796123d..57e708d267 100644 --- a/packages/docs/.vitepress/config/en.ts +++ b/packages/docs/.vitepress/config/en.ts @@ -155,3 +155,49 @@ export const enConfig: LocaleSpecificConfig = { }, }, } + +// options to translate instructions of algolia tool to your language. +// you just need to do the same we did with the chinese configuration. +export const enSearch: DefaultTheme.AlgoliaSearchOptions['locales'] = { + en: { + placeholder: 'Search for Documents', + translations: { + button: { + buttonText: 'Search for Documents', + buttonAriaLabel: 'Search for Documents', + }, + modal: { + searchBox: { + resetButtonTitle: 'Clear the search criteria', + resetButtonAriaLabel: 'Clear the search criteria', + cancelButtonText: 'Cancel', + cancelButtonAriaLabel: 'Cancel', + }, + startScreen: { + recentSearchesTitle: 'Search History', + noRecentSearchesText: 'No search history', + saveRecentSearchButtonTitle: 'Save to Search History', + removeRecentSearchButtonTitle: 'Remove from search history', + favoriteSearchesTitle: 'Favorite', + removeFavoriteSearchButtonTitle: 'Remove from Favorites', + }, + errorScreen: { + titleText: 'Unable to get results', + helpText: 'You may need to check your internet connection', + }, + footer: { + selectText: 'Option', + navigateText: 'Switch modes or data streams', + closeText: 'close', + searchByText: 'Search for suppliers', + }, + noResultsScreen: { + noResultsText: 'No results could be found', + suggestedQueryText: 'You can try querying', + reportMissingResultsText: 'Do you think the query should yield results?', + reportMissingResultsLinkText: 'Click on Feedback', + }, + }, + }, + }, +} From 93bf4d089b053cb2f672999e31eab23b88529100 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 30 Sep 2024 15:03:06 +0200 Subject: [PATCH 2/2] refactor: feedback --- .github/CONTRIBUTING.md | 4 +++ packages/docs/.vitepress/config/en.ts | 46 --------------------------- 2 files changed, 4 insertions(+), 46 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2b95855bf6..ec8b7f93f9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -86,3 +86,7 @@ pnpm run docs:translation:compare upstream/v2 ``` + +### Translating Search text + +The search box is powered by Algolia and you will need to translate the properties. Inspire yourself from `.vitepress/config/zh.ts` `zhSearch` variable. diff --git a/packages/docs/.vitepress/config/en.ts b/packages/docs/.vitepress/config/en.ts index 57e708d267..136796123d 100644 --- a/packages/docs/.vitepress/config/en.ts +++ b/packages/docs/.vitepress/config/en.ts @@ -155,49 +155,3 @@ export const enConfig: LocaleSpecificConfig = { }, }, } - -// options to translate instructions of algolia tool to your language. -// you just need to do the same we did with the chinese configuration. -export const enSearch: DefaultTheme.AlgoliaSearchOptions['locales'] = { - en: { - placeholder: 'Search for Documents', - translations: { - button: { - buttonText: 'Search for Documents', - buttonAriaLabel: 'Search for Documents', - }, - modal: { - searchBox: { - resetButtonTitle: 'Clear the search criteria', - resetButtonAriaLabel: 'Clear the search criteria', - cancelButtonText: 'Cancel', - cancelButtonAriaLabel: 'Cancel', - }, - startScreen: { - recentSearchesTitle: 'Search History', - noRecentSearchesText: 'No search history', - saveRecentSearchButtonTitle: 'Save to Search History', - removeRecentSearchButtonTitle: 'Remove from search history', - favoriteSearchesTitle: 'Favorite', - removeFavoriteSearchButtonTitle: 'Remove from Favorites', - }, - errorScreen: { - titleText: 'Unable to get results', - helpText: 'You may need to check your internet connection', - }, - footer: { - selectText: 'Option', - navigateText: 'Switch modes or data streams', - closeText: 'close', - searchByText: 'Search for suppliers', - }, - noResultsScreen: { - noResultsText: 'No results could be found', - suggestedQueryText: 'You can try querying', - reportMissingResultsText: 'Do you think the query should yield results?', - reportMissingResultsLinkText: 'Click on Feedback', - }, - }, - }, - }, -}