fix(shared): Add translations to missing measurements string
This commit is contained in:
parent
cea7f520d4
commit
7ad6ef575d
2 changed files with 9 additions and 3 deletions
|
@ -258,6 +258,8 @@ thankYouVeryMuch: Thank you very much
|
||||||
csetSuggestedMsg: Your submission has been registered and will be processed by one of our curators.
|
csetSuggestedMsg: Your submission has been registered and will be processed by one of our curators.
|
||||||
itIsAvailableAt: It is available at
|
itIsAvailableAt: It is available at
|
||||||
csetNameMsg: Each curated set has a name. You can suggest your own name or a pseudonym.
|
csetNameMsg: Each curated set has a name. You can suggest your own name or a pseudonym.
|
||||||
|
missing: Missing
|
||||||
|
andMore: and more
|
||||||
|
|
||||||
patternNew: Generate a new pattern
|
patternNew: Generate a new pattern
|
||||||
patternNewInfo: Pick a design, add your measurements set, and we'll generate a bespoke sewing pattern for you.
|
patternNewInfo: Pick a design, add your measurements set, and we'll generate a bespoke sewing pattern for you.
|
||||||
|
|
|
@ -124,6 +124,7 @@ export const MsetCard = ({
|
||||||
sm: 36,
|
sm: 36,
|
||||||
}
|
}
|
||||||
const s = sizes[size]
|
const s = sizes[size]
|
||||||
|
const { t } = useTranslation(ns)
|
||||||
|
|
||||||
const wrapperProps = {
|
const wrapperProps = {
|
||||||
className: `bg-base-300 aspect-square h-${s} w-${s} mb-2
|
className: `bg-base-300 aspect-square h-${s} w-${s} mb-2
|
||||||
|
@ -155,10 +156,13 @@ export const MsetCard = ({
|
||||||
<NoIcon className={`${iconClasses} bg-error text-error-content`} stroke={3} />
|
<NoIcon className={`${iconClasses} bg-error text-error-content`} stroke={3} />
|
||||||
)
|
)
|
||||||
if (missing.length > 0) {
|
if (missing.length > 0) {
|
||||||
let missingString = 'Missing: ' + missing.toString().replaceAll(',', ', ')
|
const translated = missing.map((m) => {
|
||||||
|
return t(m)
|
||||||
|
})
|
||||||
|
let missingString = t('missing') + ': ' + translated.join(', ')
|
||||||
if (missingString.length > maxLength) {
|
if (missingString.length > maxLength) {
|
||||||
const lastSpace = missingString.lastIndexOf(' ', maxLength)
|
const lastSpace = missingString.lastIndexOf(', ', maxLength)
|
||||||
missingString = missingString.substring(0, lastSpace) + ' and more...'
|
missingString = missingString.substring(0, lastSpace) + ', ' + t('andMore') + '...'
|
||||||
}
|
}
|
||||||
const measieClasses = 'font-normal text-xs'
|
const measieClasses = 'font-normal text-xs'
|
||||||
missingMeasies = <span className={`${measieClasses}`}>{missingString}</span>
|
missingMeasies = <span className={`${measieClasses}`}>{missingString}</span>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue