Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions apps/site/components/Common/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type ResultMapDescription = {

type ResultMapPath = { path: string; siteSection: string };

import { themeConfig } from './utils';
import { themeConfig, translationKeys } from './utils';

const uppercaseFirst = (word: string) =>
word.charAt(0).toUpperCase() + word.slice(1);
Expand Down Expand Up @@ -63,9 +63,9 @@ const SearchButton: FC = () => {
style={{ flexGrow: 1 }}
colorScheme={colorScheme}
themeConfig={themeConfig}
aria-label={t('components.search.searchBox.placeholder')}
aria-label={t('components.search.searchPlaceholder')}
>
{t('components.search.searchBox.placeholder')}
{t('components.search.searchPlaceholder')}
</OramaSearchButton>

<OramaSearchBox
Expand All @@ -82,6 +82,9 @@ const SearchButton: FC = () => {
HTMLTag: 'b',
CSSClass: 'font-bold',
}}
dictionary={Object.fromEntries(
translationKeys.map(key => [key, t(`components.search.${key}`)])
)}
searchParams={DEFAULT_ORAMA_QUERY_PARAMS}
suggestions={DEFAULT_ORAMA_SUGGESTIONS}
chatMarkdownLinkHref={({ href }) => {
Expand Down
17 changes: 17 additions & 0 deletions apps/site/components/Common/Search/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,20 @@ export const themeConfig = {
},
},
};

export const translationKeys = [
'searchPlaceholder',
'chatPlaceholder',
'noResultsFoundFor',
'suggestions',
'seeAll',
'addMore',
'clearChat',
'errorMessage',
'disclaimer',
'startYourSearch',
'initErrorSearch',
'initErrorChat',
'chatButtonLabel',
'searchButtonLabel',
] as const;
2 changes: 1 addition & 1 deletion apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@opentelemetry/instrumentation": "~0.200.0",
"@opentelemetry/resources": "~1.30.1",
"@opentelemetry/sdk-logs": "~0.200.0",
"@orama/react-components": "^0.7.0",
"@orama/react-components": "^0.8.0",
"@oramacloud/client": "^2.1.4",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.3",
Expand Down
17 changes: 14 additions & 3 deletions packages/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,20 @@
"tableOfContents": "Table of Contents"
},
"search": {
"searchBox": {
"placeholder": "Start typing..."
}
"searchPlaceholder": "Start typing...",
"chatPlaceholder": "Ask me anything",
"noResultsFoundFor": "No results found for",
"suggestions": "Suggestions",
"seeAll": "See all",
"addMore": "Add more",
"clearChat": "Clear chat",
"errorMessage": "An error occurred while trying to search. Please try again.",
"disclaimer": "Orama can make mistakes. Please verify the information.",
"startYourSearch": "Start your search",
"initErrorSearch": "Unable to initialize search service",
"initErrorChat": "Unable to initialize chat service",
"chatButtonLabel": "Get a summary",
"searchButtonLabel": "Search"
},
"blog": {
"blogHeader": {
Expand Down
125 changes: 99 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading