1
0
Fork 0

fix(gui): translate tab labels

This commit is contained in:
Sean Sube 2024-01-13 20:54:36 -06:00
parent 19b84ed28d
commit a7568dbef1
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
5 changed files with 12 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import { createTheme, ThemeProvider } from '@mui/material/styles';
import { Allotment } from 'allotment'; import { Allotment } from 'allotment';
import * as React from 'react'; import * as React from 'react';
import { useContext, useMemo } from 'react'; import { useContext, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useHash } from 'react-use/lib/useHash'; import { useHash } from 'react-use/lib/useHash';
import { useStore } from 'zustand'; import { useStore } from 'zustand';
@ -126,6 +127,7 @@ export function TabGroup(props: TabGroupProps) {
const layout = LAYOUT_STYLES[props.direction]; const layout = LAYOUT_STYLES[props.direction];
const [hash, setHash] = useHash(); const [hash, setHash] = useHash();
const { t } = useTranslation();
return <Stack direction='column' minWidth={layout.control.width} sx={{ mx: STANDARD_MARGIN }}> return <Stack direction='column' minWidth={layout.control.width} sx={{ mx: STANDARD_MARGIN }}>
<TabContext value={getTab(hash)}> <TabContext value={getTab(hash)}>
@ -133,7 +135,7 @@ export function TabGroup(props: TabGroupProps) {
<TabList onChange={(_e, idx) => { <TabList onChange={(_e, idx) => {
setHash(idx); setHash(idx);
}}> }}>
{TAB_LABELS.map((name) => <Tab key={name} label={name} value={name} />)} {TAB_LABELS.map((name) => <Tab key={name} label={t(`tab.${name}`)} value={name} />)}
</TabList> </TabList>
</Box> </Box>
<TabPanel value='txt2img'> <TabPanel value='txt2img'>

View File

@ -75,7 +75,7 @@ export const I18N_STRINGS_DE = {
}, },
loading: { loading: {
cancel: 'Stornieren', cancel: 'Stornieren',
progress: '{{current}} von {{total}} Schritten, {{tiles.current}} of {{tiles.total}} Kacheln, {{stages.current}} of {{stages.total}} Abschnitten', progress: '{{steps.current}} von {{steps.total}} Schritten, {{tiles.current}} of {{tiles.total}} Kacheln, {{stages.current}} of {{stages.total}} Abschnitten',
queue: '{{current}} von {{total}} in der Warteschlange', queue: '{{current}} von {{total}} in der Warteschlange',
server: 'Verbindung zum Server...', server: 'Verbindung zum Server...',
unknown: 'vielen', unknown: 'vielen',
@ -248,6 +248,8 @@ export const I18N_STRINGS_DE = {
blend: 'Mischung', blend: 'Mischung',
img2img: 'Img2img', img2img: 'Img2img',
inpaint: '', inpaint: '',
models: 'Modelle',
settings: 'Einstellungen',
txt2txt: 'Txt2txt', txt2txt: 'Txt2txt',
txt2img: 'Txt2img', txt2img: 'Txt2img',
upscale: 'Vergrößern', upscale: 'Vergrößern',

View File

@ -329,6 +329,8 @@ export const I18N_STRINGS_EN = {
blend: 'Blend', blend: 'Blend',
img2img: 'Img2img', img2img: 'Img2img',
inpaint: 'Inpaint', inpaint: 'Inpaint',
models: 'Models',
settings: 'Settings',
txt2txt: 'Txt2txt', txt2txt: 'Txt2txt',
txt2img: 'Txt2img', txt2img: 'Txt2img',
upscale: 'Upscale', upscale: 'Upscale',

View File

@ -250,6 +250,8 @@ export const I18N_STRINGS_ES = {
blend: 'Mezclar', blend: 'Mezclar',
img2img: 'Img2img', img2img: 'Img2img',
inpaint: 'Inpaint', inpaint: 'Inpaint',
models: '',
settings: '',
txt2txt: 'Txt2txt', txt2txt: 'Txt2txt',
txt2img: 'Txt2img', txt2img: 'Txt2img',
upscale: 'Aumentar', upscale: 'Aumentar',

View File

@ -250,6 +250,8 @@ export const I18N_STRINGS_FR = {
blend: '', blend: '',
img2img: '', img2img: '',
inpaint: '', inpaint: '',
models: '',
settings: '',
txt2txt: '', txt2txt: '',
txt2img: '', txt2img: '',
upscale: '', upscale: '',