i18n
This commit is contained in:
@@ -7,6 +7,7 @@ import {exit, readRoot, switchModel, updateConfig} from '../apis';
|
||||
import {toast} from 'react-toastify';
|
||||
import manifest from '../../../manifest.json';
|
||||
import {getStrategy} from '../utils';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
|
||||
const mainButtonText = {
|
||||
[ModelStatus.Offline]: 'Run',
|
||||
@@ -70,6 +71,8 @@ const onClickMainButton = async () => {
|
||||
};
|
||||
|
||||
export const RunButton: FC<{ onClickRun?: MouseEventHandler }> = observer(({onClickRun}) => {
|
||||
const {t} = useTranslation();
|
||||
|
||||
return (
|
||||
<Button disabled={commonStore.modelStatus === ModelStatus.Starting} appearance="primary" size="large"
|
||||
onClick={async (e) => {
|
||||
@@ -77,7 +80,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler }> = observer(({onCl
|
||||
await onClickRun?.(e);
|
||||
await onClickMainButton();
|
||||
}}>
|
||||
{mainButtonText[commonStore.modelStatus]}
|
||||
{t(mainButtonText[commonStore.modelStatus])}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import {FC, ReactElement} from 'react';
|
||||
import {Card, Text} from '@fluentui/react-components';
|
||||
|
||||
export const Section: FC<{
|
||||
title: string; desc?: string, content: ReactElement, outline?: boolean
|
||||
title: string; desc?: string | null, content: ReactElement, outline?: boolean
|
||||
}> =
|
||||
({title, desc, content, outline = true}) => {
|
||||
return (
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, {FC, MouseEventHandler, ReactElement} from 'react';
|
||||
import {Button, Tooltip} from '@fluentui/react-components';
|
||||
|
||||
export const ToolTipButton: FC<{
|
||||
text?: string, desc: string, icon?: ReactElement, onClick?: MouseEventHandler
|
||||
text?: string | null, desc: string, icon?: ReactElement, onClick?: MouseEventHandler
|
||||
}> = ({
|
||||
text,
|
||||
desc,
|
||||
|
||||
Reference in New Issue
Block a user