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 = {
21
21
22
22
type ResultMapPath = { path : string ; siteSection : string } ;
23
23
24
- import { themeConfig } from './utils' ;
24
+ import { themeConfig , translationKeys } from './utils' ;
25
25
26
26
const uppercaseFirst = ( word : string ) =>
27
27
word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) ;
@@ -63,9 +63,9 @@ const SearchButton: FC = () => {
63
63
style = { { flexGrow : 1 } }
64
64
colorScheme = { colorScheme }
65
65
themeConfig = { themeConfig }
66
- aria-label = { t ( 'components.search.searchBox.placeholder ' ) }
66
+ aria-label = { t ( 'components.search.searchPlaceholder ' ) }
67
67
>
68
- { t ( 'components.search.searchBox.placeholder ' ) }
68
+ { t ( 'components.search.searchPlaceholder ' ) }
69
69
</ OramaSearchButton >
70
70
71
71
< OramaSearchBox
@@ -82,6 +82,9 @@ const SearchButton: FC = () => {
82
82
HTMLTag : 'b' ,
83
83
CSSClass : 'font-bold' ,
84
84
} }
85
+ dictionary = { Object . fromEntries (
86
+ translationKeys . map ( key => [ key , t ( `components.search.${ key } ` ) ] )
87
+ ) }
85
88
searchParams = { DEFAULT_ORAMA_QUERY_PARAMS }
86
89
suggestions = { DEFAULT_ORAMA_SUGGESTIONS }
87
90
chatMarkdownLinkHref = { ( { href } ) => {
Original file line number Diff line number Diff line change @@ -41,3 +41,20 @@ export const themeConfig = {
41
41
} ,
42
42
} ,
43
43
} ;
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 37
37
"@opentelemetry/instrumentation" : " ~0.200.0" ,
38
38
"@opentelemetry/resources" : " ~1.30.1" ,
39
39
"@opentelemetry/sdk-logs" : " ~0.200.0" ,
40
- "@orama/react-components" : " ^0.7 .0" ,
40
+ "@orama/react-components" : " ^0.8 .0" ,
41
41
"@oramacloud/client" : " ^2.1.4" ,
42
42
"@radix-ui/react-slot" : " ^1.1.2" ,
43
43
"@radix-ui/react-tabs" : " ^1.1.3" ,
Original file line number Diff line number Diff line change 238
238
"tableOfContents" : " Table of Contents"
239
239
},
240
240
"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"
244
255
},
245
256
"blog" : {
246
257
"blogHeader" : {
You can’t perform that action at this time.
0 commit comments