@@ -92,7 +92,7 @@ export default function MainConfigCard({
9292 ] ) ;
9393 const [ shellTypes , setShellTypes ] = useState < string [ ] > ( [ ] ) ;
9494 const shellTool = form . watch ( "shellTool" ) ;
95- const { t } = useTranslation ( ) ;
95+ const { t } = useTranslation ( [ "common" , "memshell" ] ) ;
9696
9797 const [ serverVersionOptions , setServerVersionOptions ] = useState (
9898 defaultServerVersionOptions ,
@@ -137,7 +137,7 @@ export default function MainConfigCard({
137137 ) {
138138 form . setValue ( "targetJdkVersion" , "52" ) ;
139139 } else {
140- form . resetField ( "targetJdkVersion" ) ;
140+ form . setValue ( "targetJdkVersion" , "50 ") ;
141141 }
142142
143143 // 特殊的服务需要指定版本
@@ -259,7 +259,7 @@ export default function MainConfigCard({
259259 < CardHeader className = "pb-1" >
260260 < CardTitle className = "text-md flex items-center gap-2" >
261261 < ServerIcon className = "h-5" />
262- < span > { t ( "configs.main-config " ) } </ span >
262+ < span > { t ( "common:mainConfig.title " ) } </ span >
263263 </ CardTitle >
264264 </ CardHeader >
265265 < CardContent >
@@ -269,7 +269,7 @@ export default function MainConfigCard({
269269 name = "server"
270270 render = { ( { field } ) => (
271271 < FormFieldItem >
272- < FormFieldLabel > { t ( "mainConfig. server" ) } </ FormFieldLabel >
272+ < FormFieldLabel > { t ( "common: server" ) } </ FormFieldLabel >
273273 < Select
274274 onValueChange = { ( v ) => {
275275 field . onChange ( v ) ;
@@ -279,7 +279,9 @@ export default function MainConfigCard({
279279 >
280280 < FormControl >
281281 < SelectTrigger >
282- < SelectValue placeholder = { t ( "placeholders.select" ) } />
282+ < SelectValue
283+ placeholder = { t ( "common:placeholders.select" ) }
284+ />
283285 </ SelectTrigger >
284286 </ FormControl >
285287 < SelectContent >
@@ -291,14 +293,14 @@ export default function MainConfigCard({
291293 </ SelectContent >
292294 </ Select >
293295 < FormDescription className = "flex items-center" >
294- { t ( "tips.targetServerNotFound" ) }
296+ { t ( "memshell: tips.targetServerNotFound" ) }
295297 < a
296298 href = "https://github.com/ReaJason/MemShellParty/issues/new?template=%E8%AF%B7%E6%B1%82%E9%80%82%E9%85%8D.md"
297299 target = "_blank"
298300 rel = "noreferrer"
299301 className = "flex items-center underline"
300302 >
301- { t ( "tips.targetServerRequest" ) }
303+ { t ( "memshell: tips.targetServerRequest" ) }
302304 < ArrowUpRightIcon className = "h-4" />
303305 </ a >
304306 </ FormDescription >
@@ -310,11 +312,13 @@ export default function MainConfigCard({
310312 name = "serverVersion"
311313 render = { ( { field } ) => (
312314 < FormFieldItem >
313- < FormFieldLabel > { t ( "mainConfig. serverVersion" ) } </ FormFieldLabel >
315+ < FormFieldLabel > { t ( "common: serverVersion" ) } </ FormFieldLabel >
314316 < Select onValueChange = { field . onChange } value = { field . value } >
315317 < FormControl >
316318 < SelectTrigger >
317- < SelectValue placeholder = { t ( "placeholders.select" ) } />
319+ < SelectValue
320+ placeholder = { t ( "common:placeholders.select" ) }
321+ />
318322 </ SelectTrigger >
319323 </ FormControl >
320324 < SelectContent >
@@ -337,9 +341,13 @@ export default function MainConfigCard({
337341 render = { ( { field } ) => (
338342 < FormItem className = "flex items-center space-x-2 space-y-0" >
339343 < FormControl >
340- < Switch id = { debugId } checked = { field . value } onCheckedChange = { field . onChange } />
344+ < Switch
345+ id = "debug"
346+ checked = { field . value }
347+ onCheckedChange = { field . onChange }
348+ />
341349 </ FormControl >
342- < FormLabel htmlFor = { debugId } > { t ( "mainConfig. debug" ) } </ FormLabel >
350+ < FormLabel htmlFor = "debug" > { t ( "common: debug" ) } </ FormLabel >
343351 </ FormItem >
344352 ) }
345353 />
@@ -349,9 +357,13 @@ export default function MainConfigCard({
349357 render = { ( { field } ) => (
350358 < FormItem className = "flex items-center space-x-2 space-y-0" >
351359 < FormControl >
352- < Switch id = { bypassId } checked = { field . value } onCheckedChange = { field . onChange } />
360+ < Switch
361+ id = "bypass"
362+ checked = { field . value }
363+ onCheckedChange = { field . onChange }
364+ />
353365 </ FormControl >
354- < Label htmlFor = { bypassId } > { t ( "mainConfig. byPassJavaModule" ) } </ Label >
366+ < Label htmlFor = "bypass" > { t ( "common: byPassJavaModule" ) } </ Label >
355367 </ FormItem >
356368 ) }
357369 />
@@ -361,9 +373,13 @@ export default function MainConfigCard({
361373 render = { ( { field } ) => (
362374 < FormItem className = "flex items-center space-x-2 space-y-0" >
363375 < FormControl >
364- < Switch id = { shrinkId } checked = { field . value } onCheckedChange = { field . onChange } />
376+ < Switch
377+ id = "shrink"
378+ checked = { field . value }
379+ onCheckedChange = { field . onChange }
380+ />
365381 </ FormControl >
366- < Label htmlFor = { shrinkId } > { t ( "mainConfig. shrink" ) } </ Label >
382+ < Label htmlFor = "shrink" > { t ( "common: shrink" ) } </ Label >
367383 </ FormItem >
368384 ) }
369385 />
0 commit comments