File tree Expand file tree Collapse file tree 5 files changed +137
-33
lines changed
Expand file tree Collapse file tree 5 files changed +137
-33
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ type ResultMapDescription = {
2121
2222type ResultMapPath = { path : string ; siteSection : string } ;
2323
24- import { themeConfig } from './utils' ;
24+ import { themeConfig , translationKeys } from './utils' ;
2525
2626const uppercaseFirst = ( word : string ) =>
2727 word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) ;
@@ -63,9 +63,9 @@ const SearchButton: FC = () => {
6363 style = { { flexGrow : 1 } }
6464 colorScheme = { colorScheme }
6565 themeConfig = { themeConfig }
66- aria-label = { t ( 'components.search.searchBox.placeholder ' ) }
66+ aria-label = { t ( 'components.search.searchPlaceholder ' ) }
6767 >
68- { t ( 'components.search.searchBox.placeholder ' ) }
68+ { t ( 'components.search.searchPlaceholder ' ) }
6969 </ OramaSearchButton >
7070
7171 < OramaSearchBox
@@ -82,6 +82,9 @@ const SearchButton: FC = () => {
8282 HTMLTag : 'b' ,
8383 CSSClass : 'font-bold' ,
8484 } }
85+ dictionary = { Object . fromEntries (
86+ translationKeys . map ( key => [ key , t ( `components.search.${ key } ` ) ] )
87+ ) }
8588 searchParams = { DEFAULT_ORAMA_QUERY_PARAMS }
8689 suggestions = { DEFAULT_ORAMA_SUGGESTIONS }
8790 chatMarkdownLinkHref = { ( { href } ) => {
Original file line number Diff line number Diff line change @@ -41,3 +41,20 @@ export const themeConfig = {
4141 } ,
4242 } ,
4343} ;
44+
45+ export const translationKeys = [
46+ 'searchPlaceholder' ,
47+ 'chatPlaceholder' ,
48+ 'noResultsFoundFor' ,
49+ 'suggestions' ,
50+ 'seeAll' ,
51+ 'addMore' ,
52+ 'clearChat' ,
53+ 'errorMessage' ,
54+ 'disclaimer' ,
55+ 'startYourSearch' ,
56+ 'initErrorSearch' ,
57+ 'initErrorChat' ,
58+ 'chatButtonLabel' ,
59+ 'searchButtonLabel' ,
60+ ] as const ;
Original file line number Diff line number Diff line change 3737 "@opentelemetry/instrumentation" : " ~0.200.0" ,
3838 "@opentelemetry/resources" : " ~1.30.1" ,
3939 "@opentelemetry/sdk-logs" : " ~0.200.0" ,
40- "@orama/react-components" : " ^0.7 .0" ,
40+ "@orama/react-components" : " ^0.8 .0" ,
4141 "@oramacloud/client" : " ^2.1.4" ,
4242 "@radix-ui/react-slot" : " ^1.1.2" ,
4343 "@radix-ui/react-tabs" : " ^1.1.3" ,
Original file line number Diff line number Diff line change 238238 "tableOfContents" : " Table of Contents"
239239 },
240240 "search" : {
241- "searchBox" : {
242- "placeholder" : " Start typing..."
243- }
241+ "searchPlaceholder" : " Start typing..." ,
242+ "chatPlaceholder" : " Ask me anything" ,
243+ "noResultsFoundFor" : " No results found for" ,
244+ "suggestions" : " Suggestions" ,
245+ "seeAll" : " See all" ,
246+ "addMore" : " Add more" ,
247+ "clearChat" : " Clear chat" ,
248+ "errorMessage" : " An error occurred while trying to search. Please try again." ,
249+ "disclaimer" : " AI summaries can make mistakes. Please verify the information." ,
250+ "startYourSearch" : " Start your search" ,
251+ "initErrorSearch" : " Unable to initialize search service" ,
252+ "initErrorChat" : " Unable to initialize chat service" ,
253+ "chatButtonLabel" : " Get an AI summary" ,
254+ "searchButtonLabel" : " Search"
244255 },
245256 "blog" : {
246257 "blogHeader" : {
You can’t perform that action at this time.
0 commit comments