fix(ui): fix plurals in translation

This commit is contained in:
psychedelicious 2023-10-12 21:34:24 +11:00
parent cb1509bf52
commit 75de20af6a
4 changed files with 19 additions and 36 deletions

View File

@ -275,7 +275,8 @@
"batchValues": "Batch Values",
"notReady": "Unable to Queue",
"batchQueued": "Batch Queued",
"batchQueuedDesc": "Added {{item_count}} sessions to {{direction}} of queue",
"batchQueuedDesc_one": "Added {{count}} sessions to {{direction}} of queue",
"batchQueuedDesc_other": "Added {{count}} sessions to {{direction}} of queue",
"front": "front",
"back": "back",
"batchFailedToQueue": "Failed to Queue Batch",
@ -1111,17 +1112,17 @@
"clearIntermediatesDesc2": "Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space.",
"clearIntermediatesDesc3": "Your gallery images will not be deleted.",
"clearIntermediates": "Clear Intermediates",
"clearIntermediates_one": "Clear 1 Intermediate",
"clearIntermediates_other": "Clear {{number}} Intermediates",
"noIntermediates": "No Intermediates to Clear",
"intermediatesCleared_one": "Cleared 1 Intermediate",
"intermediatesCleared_other": "Cleared {{number}} Intermediates",
"clearIntermediatesWithCount_one": "Clear {{count}} Intermediate",
"clearIntermediatesWithCount_other": "Clear {{count}} Intermediates",
"clearIntermediatesWithCount_zero": "No Intermediates to Clear",
"intermediatesCleared_one": "Cleared {{count}} Intermediate",
"intermediatesCleared_other": "Cleared {{count}} Intermediates",
"intermediatesClearedFailed": "Problem Clearing Intermediates"
},
"toast": {
"addedToBoard": "Added to board",
"baseModelChangedCleared_one": "Base model changed, cleared or disabled {{number}} incompatible submodel",
"baseModelChangedCleared_many": "$t(toast.baseModelChangedCleared_one)s",
"baseModelChangedCleared_one": "Base model changed, cleared or disabled {{count}} incompatible submodel",
"baseModelChangedCleared_other": "Base model changed, cleared or disabled {{count}} incompatible submodels",
"canceled": "Processing Canceled",
"canvasCopiedClipboard": "Canvas Copied to Clipboard",
"canvasDownloaded": "Canvas Downloaded",

View File

@ -30,7 +30,7 @@ export const addBatchEnqueuedListener = () => {
id: 'batch-queued',
title: t('queue.batchQueued'),
description: t('queue.batchQueuedDesc', {
item_count: response.enqueued,
count: response.enqueued,
direction: arg.prepend ? t('queue.front') : t('queue.back'),
}),
duration: 1000,

View File

@ -73,14 +73,9 @@ export const addModelSelectedListener = () => {
dispatch(
addToast(
makeToast({
title: t(
modelsCleared === 1
? 'toast.baseModelChangedCleared_one'
: 'toast.baseModelChangedCleared_many',
{
number: modelsCleared,
}
),
title: t('toast.baseModelChangedCleared', {
count: modelsCleared,
}),
status: 'warning',
})
)

View File

@ -1,7 +1,7 @@
import { Heading, Text } from '@chakra-ui/react';
import { useAppDispatch } from 'app/store/storeHooks';
import { controlAdaptersReset } from 'features/controlAdapters/store/controlAdaptersSlice';
import { useCallback, useEffect, useMemo } from 'react';
import { useCallback, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import IAIButton from '../../../../common/components/IAIButton';
import {
@ -25,15 +25,12 @@ export default function SettingsClearIntermediates() {
const handleClickClearIntermediates = useCallback(() => {
clearIntermediates()
.unwrap()
.then((number) => {
.then((clearedCount) => {
dispatch(controlAdaptersReset());
dispatch(resetCanvas());
dispatch(
addToast({
title:
number === 1
? t('settings.intermediatesCleared_one')
: t('settings.intermediatesCleared_other', { number }),
title: t('settings.intermediatesCleared', { count: clearedCount }),
status: 'info',
})
);
@ -53,18 +50,6 @@ export default function SettingsClearIntermediates() {
updateIntermediatesCount();
}, [updateIntermediatesCount]);
const buttonText = useMemo(() => {
if (!intermediatesCount) {
return t('settings.noIntermediates');
}
if (intermediatesCount === 1) {
return t('settings.clearIntermediates_one');
}
return t('settings.clearIntermediates_other', {
number: intermediatesCount,
});
}, [intermediatesCount, t]);
return (
<StyledFlex>
<Heading size="sm">{t('settings.clearIntermediates')}</Heading>
@ -74,7 +59,9 @@ export default function SettingsClearIntermediates() {
isLoading={isLoadingClearIntermediates}
isDisabled={!intermediatesCount}
>
{buttonText}
{t('settings.clearIntermediatesWithCount', {
count: intermediatesCount ?? 0,
})}
</IAIButton>
<Text fontWeight="bold">{t('settings.clearIntermediatesDesc1')}</Text>
<Text variant="subtext">{t('settings.clearIntermediatesDesc2')}</Text>