mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add accessibility to localization
only set fallback english values implement on ModelSelect and ProgressBar
This commit is contained in:
parent
6b41127421
commit
c3c1511ec6
@ -1,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"accessibility": {
|
||||||
|
"modelSelect": "Model Select",
|
||||||
|
"invokeProgressBar": "Invoke progress bar"
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"hotkeysLabel": "Hotkeys",
|
"hotkeysLabel": "Hotkeys",
|
||||||
"themeLabel": "Theme",
|
"themeLabel": "Theme",
|
||||||
|
@ -6,6 +6,7 @@ import IAISelect from 'common/components/IAISelect';
|
|||||||
import { isEqual, map } from 'lodash';
|
import { isEqual, map } from 'lodash';
|
||||||
|
|
||||||
import { ChangeEvent } from 'react';
|
import { ChangeEvent } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { activeModelSelector, systemSelector } from '../store/systemSelectors';
|
import { activeModelSelector, systemSelector } from '../store/systemSelectors';
|
||||||
|
|
||||||
const selector = createSelector(
|
const selector = createSelector(
|
||||||
@ -24,6 +25,7 @@ const selector = createSelector(
|
|||||||
|
|
||||||
const ModelSelect = () => {
|
const ModelSelect = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
const { t } = useTranslation();
|
||||||
const { models, isProcessing } = useAppSelector(selector);
|
const { models, isProcessing } = useAppSelector(selector);
|
||||||
const activeModel = useAppSelector(activeModelSelector);
|
const activeModel = useAppSelector(activeModelSelector);
|
||||||
const handleChangeModel = (e: ChangeEvent<HTMLSelectElement>) => {
|
const handleChangeModel = (e: ChangeEvent<HTMLSelectElement>) => {
|
||||||
@ -38,7 +40,7 @@ const ModelSelect = () => {
|
|||||||
>
|
>
|
||||||
<IAISelect
|
<IAISelect
|
||||||
style={{ fontSize: 'sm' }}
|
style={{ fontSize: 'sm' }}
|
||||||
aria-label="Model Select"
|
aria-label={t('accessibility.modelSelect')}
|
||||||
tooltip={activeModel.description}
|
tooltip={activeModel.description}
|
||||||
isDisabled={isProcessing}
|
isDisabled={isProcessing}
|
||||||
value={activeModel.name}
|
value={activeModel.name}
|
||||||
|
@ -3,6 +3,7 @@ import { createSelector } from '@reduxjs/toolkit';
|
|||||||
import { useAppSelector } from 'app/storeHooks';
|
import { useAppSelector } from 'app/storeHooks';
|
||||||
import { SystemState } from 'features/system/store/systemSlice';
|
import { SystemState } from 'features/system/store/systemSlice';
|
||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { PROGRESS_BAR_THICKNESS } from 'theme/util/constants';
|
import { PROGRESS_BAR_THICKNESS } from 'theme/util/constants';
|
||||||
import { systemSelector } from '../store/systemSelectors';
|
import { systemSelector } from '../store/systemSelectors';
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ const progressBarSelector = createSelector(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const ProgressBar = () => {
|
const ProgressBar = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const { isProcessing, currentStep, totalSteps, currentStatusHasSteps } =
|
const { isProcessing, currentStep, totalSteps, currentStatusHasSteps } =
|
||||||
useAppSelector(progressBarSelector);
|
useAppSelector(progressBarSelector);
|
||||||
|
|
||||||
@ -30,7 +32,7 @@ const ProgressBar = () => {
|
|||||||
return (
|
return (
|
||||||
<Progress
|
<Progress
|
||||||
value={value}
|
value={value}
|
||||||
aria-label="Invoking progress bar"
|
aria-label={t('accessibility.invokeProgressBar')}
|
||||||
isIndeterminate={isProcessing && !currentStatusHasSteps}
|
isIndeterminate={isProcessing && !currentStatusHasSteps}
|
||||||
height={PROGRESS_BAR_THICKNESS}
|
height={PROGRESS_BAR_THICKNESS}
|
||||||
zIndex={99}
|
zIndex={99}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user