diff --git a/src/components/Minting/Minting.tsx b/src/components/Minting/Minting.tsx index 60d5185..8371a68 100644 --- a/src/components/Minting/Minting.tsx +++ b/src/components/Minting/Minting.tsx @@ -684,7 +684,7 @@ export const Minting = ({ setIsOpenMinting, myAddress, show }) => { sx={{ textAlign: 'center' }} > {t('core:minting.blockchain_statistics', { - postProcess: 'capitalizeFirstChar', + postProcess: 'capitalizeEachFirstChar', })} @@ -696,7 +696,7 @@ export const Minting = ({ setIsOpenMinting, myAddress, show }) => { > { { { sx={{ textAlign: 'center' }} > {t('core:minting.account_details', { - postProcess: 'capitalizeFirstChar', + postProcess: 'capitalizeEachFirstChar', })} @@ -755,19 +755,19 @@ export const Minting = ({ setIsOpenMinting, myAddress, show }) => { > { sx={{ textAlign: 'center' }} > {t('core:minting.rewards_info', { - postProcess: 'capitalizeFirstChar', + postProcess: 'capitalizeEachFirstChar', })} @@ -822,13 +822,13 @@ export const Minting = ({ setIsOpenMinting, myAddress, show }) => { > { /> { /> { /> {{ level }} уровня за {{ count }} дней", "rewards_info": "информация о наградах за майнинг", @@ -343,7 +343,7 @@ }, "name": "имя", "name_app": "имя/приложение", - "new_post_in": "new post in {{ title }}", + "new_post_in": "новые сообщения в {{ title }}", "none": "никто", "note": "примечание", "option": "вариант", diff --git a/src/i18n/processors.ts b/src/i18n/processors.ts index 16afecd..da5ad79 100644 --- a/src/i18n/processors.ts +++ b/src/i18n/processors.ts @@ -4,6 +4,20 @@ export const capitalizeAll = { process: (value: string) => value.toUpperCase(), }; +export const capitalizeEachFirstChar = { + type: 'postProcessor', + name: 'capitalizeEachFirstChar', + process: (value: string) => { + if (!value?.trim()) return value; + + const leadingSpaces = value.match(/^\s*/)?.[0] || ''; + const trailingSpaces = value.match(/\s*$/)?.[0] || ''; + const core = value.trim().replace(/\b\w/g, (char) => char.toUpperCase()); + + return leadingSpaces + core + trailingSpaces; + }, +}; + export const capitalizeFirstChar = { type: 'postProcessor', name: 'capitalizeFirstChar',