@@ -5,12 +5,16 @@ import { useTranslation } from 'react-i18next'
5
5
import { RiListUnordered } from '@remixicon/react'
6
6
import TemplateEn from './template/template.en.mdx'
7
7
import TemplateZh from './template/template.zh.mdx'
8
+ import TemplateJa from './template/template.ja.mdx'
8
9
import TemplateAdvancedChatEn from './template/template_advanced_chat.en.mdx'
9
10
import TemplateAdvancedChatZh from './template/template_advanced_chat.zh.mdx'
11
+ import TemplateAdvancedChatJa from './template/template_advanced_chat.ja.mdx'
10
12
import TemplateWorkflowEn from './template/template_workflow.en.mdx'
11
13
import TemplateWorkflowZh from './template/template_workflow.zh.mdx'
14
+ import TemplateWorkflowJa from './template/template_workflow.ja.mdx'
12
15
import TemplateChatEn from './template/template_chat.en.mdx'
13
16
import TemplateChatZh from './template/template_chat.zh.mdx'
17
+ import TemplateChatJa from './template/template_chat.ja.mdx'
14
18
import I18n from '@/context/i18n'
15
19
import { LanguagesSupported } from '@/i18n/language'
16
20
@@ -57,7 +61,6 @@ const Doc = ({ appDetail }: IDocProps) => {
57
61
// Run after component has rendered
58
62
setTimeout ( extractTOC , 0 )
59
63
} , [ appDetail , locale ] )
60
-
61
64
return (
62
65
< div className = "flex" >
63
66
< div className = { `fixed right-8 top-32 z-10 transition-all ${ isTocExpanded ? 'w-64' : 'w-10' } ` } >
@@ -98,16 +101,52 @@ const Doc = ({ appDetail }: IDocProps) => {
98
101
</ div >
99
102
< article className = "prose prose-xl" >
100
103
{ ( appDetail ?. mode === 'chat' || appDetail ?. mode === 'agent-chat' ) && (
101
- locale !== LanguagesSupported [ 1 ] ? < TemplateChatEn appDetail = { appDetail } variables = { variables } inputs = { inputs } /> : < TemplateChatZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
104
+ ( ( ) => {
105
+ switch ( locale ) {
106
+ case LanguagesSupported [ 1 ] :
107
+ return < TemplateChatZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
108
+ case LanguagesSupported [ 7 ] :
109
+ return < TemplateChatJa appDetail = { appDetail } variables = { variables } inputs = { inputs } />
110
+ default :
111
+ return < TemplateChatEn appDetail = { appDetail } variables = { variables } inputs = { inputs } />
112
+ }
113
+ } ) ( )
102
114
) }
103
115
{ appDetail ?. mode === 'advanced-chat' && (
104
- locale !== LanguagesSupported [ 1 ] ? < TemplateAdvancedChatEn appDetail = { appDetail } variables = { variables } inputs = { inputs } /> : < TemplateAdvancedChatZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
116
+ ( ( ) => {
117
+ switch ( locale ) {
118
+ case LanguagesSupported [ 1 ] :
119
+ return < TemplateAdvancedChatZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
120
+ case LanguagesSupported [ 7 ] :
121
+ return < TemplateAdvancedChatJa appDetail = { appDetail } variables = { variables } inputs = { inputs } />
122
+ default :
123
+ return < TemplateAdvancedChatEn appDetail = { appDetail } variables = { variables } inputs = { inputs } />
124
+ }
125
+ } ) ( )
105
126
) }
106
127
{ appDetail ?. mode === 'workflow' && (
107
- locale !== LanguagesSupported [ 1 ] ? < TemplateWorkflowEn appDetail = { appDetail } variables = { variables } inputs = { inputs } /> : < TemplateWorkflowZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
128
+ ( ( ) => {
129
+ switch ( locale ) {
130
+ case LanguagesSupported [ 1 ] :
131
+ return < TemplateWorkflowZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
132
+ case LanguagesSupported [ 7 ] :
133
+ return < TemplateWorkflowJa appDetail = { appDetail } variables = { variables } inputs = { inputs } />
134
+ default :
135
+ return < TemplateWorkflowEn appDetail = { appDetail } variables = { variables } inputs = { inputs } />
136
+ }
137
+ } ) ( )
108
138
) }
109
139
{ appDetail ?. mode === 'completion' && (
110
- locale !== LanguagesSupported [ 1 ] ? < TemplateEn appDetail = { appDetail } variables = { variables } inputs = { inputs } /> : < TemplateZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
140
+ ( ( ) => {
141
+ switch ( locale ) {
142
+ case LanguagesSupported [ 1 ] :
143
+ return < TemplateZh appDetail = { appDetail } variables = { variables } inputs = { inputs } />
144
+ case LanguagesSupported [ 7 ] :
145
+ return < TemplateJa appDetail = { appDetail } variables = { variables } inputs = { inputs } />
146
+ default :
147
+ return < TemplateEn appDetail = { appDetail } variables = { variables } inputs = { inputs } />
148
+ }
149
+ } ) ( )
111
150
) }
112
151
</ article >
113
152
</ div >
0 commit comments