feat(ui): add missing translations

This commit is contained in:
psychedelicious 2024-01-20 16:28:22 +11:00
parent 5d068c1da1
commit 580d29257c
4 changed files with 16 additions and 7 deletions

View File

@ -203,7 +203,11 @@
"prevPage": "Previous Page", "prevPage": "Previous Page",
"nextPage": "Next Page", "nextPage": "Next Page",
"unknownError": "Unknown Error", "unknownError": "Unknown Error",
"unsaved": "Unsaved" "unsaved": "Unsaved",
"red": "Red",
"green": "Green",
"blue": "Blue",
"alpha": "Alpha"
}, },
"controlnet": { "controlnet": {
"controlAdapter_one": "Control Adapter", "controlAdapter_one": "Control Adapter",
@ -703,6 +707,7 @@
"clearCheckpointFolder": "Clear Checkpoint Folder", "clearCheckpointFolder": "Clear Checkpoint Folder",
"closeAdvanced": "Close Advanced", "closeAdvanced": "Close Advanced",
"config": "Config", "config": "Config",
"configFile": "Config File",
"configValidationMsg": "Path to the config file of your model.", "configValidationMsg": "Path to the config file of your model.",
"conversionNotSupported": "Conversion Not Supported", "conversionNotSupported": "Conversion Not Supported",
"convert": "Convert", "convert": "Convert",

View File

@ -12,6 +12,7 @@ import type {
ColorPickerBaseProps, ColorPickerBaseProps,
RgbaColor, RgbaColor,
} from 'react-colorful/dist/types'; } from 'react-colorful/dist/types';
import { useTranslation } from 'react-i18next';
type IAIColorPickerProps = ColorPickerBaseProps<RgbaColor> & { type IAIColorPickerProps = ColorPickerBaseProps<RgbaColor> & {
withNumberInput?: boolean; withNumberInput?: boolean;
@ -37,6 +38,7 @@ const numberInputWidth: ChakraProps['w'] = '4.2rem';
const IAIColorPicker = (props: IAIColorPickerProps) => { const IAIColorPicker = (props: IAIColorPickerProps) => {
const { color, onChange, withNumberInput, ...rest } = props; const { color, onChange, withNumberInput, ...rest } = props;
const { t } = useTranslation();
const handleChangeR = useCallback( const handleChangeR = useCallback(
(r: number) => onChange({ ...color, r }), (r: number) => onChange({ ...color, r }),
[color, onChange] [color, onChange]
@ -64,7 +66,7 @@ const IAIColorPicker = (props: IAIColorPickerProps) => {
{withNumberInput && ( {withNumberInput && (
<Flex> <Flex>
<FormControl> <FormControl>
<FormLabel>Red</FormLabel> <FormLabel>{t('common.red')}</FormLabel>
<CompositeNumberInput <CompositeNumberInput
value={color.r} value={color.r}
onChange={handleChangeR} onChange={handleChangeR}
@ -76,7 +78,7 @@ const IAIColorPicker = (props: IAIColorPickerProps) => {
/> />
</FormControl> </FormControl>
<FormControl> <FormControl>
<FormLabel>Green</FormLabel> <FormLabel>{t('common.green')}</FormLabel>
<CompositeNumberInput <CompositeNumberInput
value={color.g} value={color.g}
onChange={handleChangeG} onChange={handleChangeG}
@ -88,7 +90,7 @@ const IAIColorPicker = (props: IAIColorPickerProps) => {
/> />
</FormControl> </FormControl>
<FormControl> <FormControl>
<FormLabel>Blue</FormLabel> <FormLabel>{t('common.blue')}</FormLabel>
<CompositeNumberInput <CompositeNumberInput
value={color.b} value={color.b}
onChange={handleChangeB} onChange={handleChangeB}
@ -100,7 +102,7 @@ const IAIColorPicker = (props: IAIColorPickerProps) => {
/> />
</FormControl> </FormControl>
<FormControl> <FormControl>
<FormLabel>Alpha</FormLabel> <FormLabel>{t('common.alpha')}</FormLabel>
<CompositeNumberInput <CompositeNumberInput
value={color.a} value={color.a}
onChange={handleChangeA} onChange={handleChangeA}

View File

@ -190,7 +190,7 @@ const CheckpointModelEdit = (props: CheckpointModelEditProps) => {
</FormControl> </FormControl>
)} )}
<FormControl> <FormControl>
<FormLabel>Use Custom Config</FormLabel> <FormLabel>{t('modelManager.useCustomConfig')}</FormLabel>
<Checkbox <Checkbox
isChecked={useCustomConfig} isChecked={useCustomConfig}
onChange={handleChangeUseCustomConfig} onChange={handleChangeUseCustomConfig}

View File

@ -6,6 +6,7 @@ import type {
import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui'; import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui';
import { memo, useCallback, useMemo } from 'react'; import { memo, useCallback, useMemo } from 'react';
import { useController, type UseControllerProps } from 'react-hook-form'; import { useController, type UseControllerProps } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { useGetCheckpointConfigsQuery } from 'services/api/endpoints/models'; import { useGetCheckpointConfigsQuery } from 'services/api/endpoints/models';
import type { CheckpointModelConfig } from 'services/api/types'; import type { CheckpointModelConfig } from 'services/api/types';
@ -15,6 +16,7 @@ const CheckpointConfigsSelect = (
props: UseControllerProps<CheckpointModelConfig> props: UseControllerProps<CheckpointModelConfig>
) => { ) => {
const { data } = useGetCheckpointConfigsQuery(); const { data } = useGetCheckpointConfigsQuery();
const { t } = useTranslation();
const options = useMemo<ComboboxOption[]>( const options = useMemo<ComboboxOption[]>(
() => (data ? data.map((i) => ({ label: i, value: i })) : []), () => (data ? data.map((i) => ({ label: i, value: i })) : []),
[data] [data]
@ -33,7 +35,7 @@ const CheckpointConfigsSelect = (
return ( return (
<FormControl> <FormControl>
<FormLabel>Config File</FormLabel> <FormLabel>{t('modelManager.configFile')}</FormLabel>
<Combobox <Combobox
placeholder="Select A Config File" placeholder="Select A Config File"
value={value} value={value}