diff --git a/apps/trading/client-pages/referrals/apply-code-form.tsx b/apps/trading/client-pages/referrals/apply-code-form.tsx index 822fdaa96..c9065f642 100644 --- a/apps/trading/client-pages/referrals/apply-code-form.tsx +++ b/apps/trading/client-pages/referrals/apply-code-form.tsx @@ -276,10 +276,12 @@ export const ApplyCodeForm = () => { {/* TODO: Re-check plural forms once i18n is updated */} {previewData && previewData.isEligible ? (
{t( 'You approved deposits of up to {{assetSymbol}} {{approvedAllowanceValue}}.', - [ - { - assetSymbol: selectedAsset?.symbol, - approvedAllowanceValue, - }, - ] + { + assetSymbol: selectedAsset?.symbol, + approvedAllowanceValue, + } )}
{txLink &&{txLink}
} diff --git a/libs/environment/__mocks__/react-i18next.ts b/libs/environment/__mocks__/react-i18next.ts deleted file mode 100644 index 9a23fc585..000000000 --- a/libs/environment/__mocks__/react-i18next.ts +++ /dev/null @@ -1,15 +0,0 @@ -export const useTranslation = () => ({ - t: (label: string, replacements?: Record{secondaryTooltip}
{t('Status: {{status}}', { - nsSeparator: '*', - replace: { - status: PositionStatusMapping[args.data.status], - }, + status: PositionStatusMapping[args.data.status], })}
{POSITION_RESOLUTION_LINK && ( @@ -390,18 +387,14 @@ export const PositionsTable = ({ <>{t('Realised PNL: {{value}}', { - nsSeparator: '*', - replace: { value: args.value }, + value: args.value, })}
{t( 'Lifetime loss socialisation deductions: {{losses}}', { - nsSeparator: '*', - replace: { - losses: lossesFormatted, - }, + losses: lossesFormatted, } )}
diff --git a/libs/proposals/src/components/protocol-upgrade-countdown.tsx b/libs/proposals/src/components/protocol-upgrade-countdown.tsx index 07242d3f9..36d7af70c 100644 --- a/libs/proposals/src/components/protocol-upgrade-countdown.tsx +++ b/libs/proposals/src/components/protocol-upgrade-countdown.tsx @@ -48,6 +48,7 @@ export const ProtocolUpgradeCountdown = ({ case ProtocolUpgradeCountdownMode.IN_BLOCKS: countdown = ({t('Error: {{errorMessage}}', { - nsSeparator: '*', - replace: { errorMessage }, + errorMessage, })}
); diff --git a/libs/web3/src/lib/use-ethereum-transaction-toasts.tsx b/libs/web3/src/lib/use-ethereum-transaction-toasts.tsx index 70271d7af..ab1302e65 100644 --- a/libs/web3/src/lib/use-ethereum-transaction-toasts.tsx +++ b/libs/web3/src/lib/use-ethereum-transaction-toasts.tsx @@ -66,8 +66,11 @@ const EthTransactionDetails = ({ tx }: { tx: EthStoredTxState }) => { <>{t( - 'Awaiting confirmations {{confirmations}}/{[requiredConfirmations}}', - tx + 'Awaiting confirmations {{confirmations}}/{{requiredConfirmations}}', + { + confirmations: tx.confirmations, + requiredConfirmations: tx.requiredConfirmations, + } )}
{tx.order.status === Schema.OrderStatus.STATUS_STOPPED ? t('Your order has been stopped because: {{rejectionReason}}', { - nsSeparator: '*', - replace: { - rejectionReason, - }, + rejectionReason, }) : t('Your order has been rejected because: {{rejectionReason}}', { - nsSeparator: '*', - replace: { - rejectionReason, - }, + rejectionReason, })}
) : ( diff --git a/package.json b/package.json index ea35ad15c..be499cf02 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ "graphql": "^15.7.2", "graphql-request": "^5.0.0", "graphql-ws": "^5.6.3", - "i18next": "^20.3.5", - "i18next-browser-languagedetector": "^6.1.2", + "i18next": "23.7.6", + "i18next-browser-languagedetector": "7.2.0", "i18next-http-backend": "^2.3.1", "i18next-locize-backend": "^6.4.1", "immer": "^9.0.12", @@ -82,7 +82,7 @@ "react-copy-to-clipboard": "5.1.0", "react-dom": "18.2.0", "react-hook-form": "^7.27.0", - "react-i18next": "^11.11.4", + "react-i18next": "13.5.0", "react-intersection-observer": "^9.2.2", "react-markdown": "^8.0.6", "react-router-dom": "6.11.2", diff --git a/yarn.lock b/yarn.lock index 4635d6a09..7ef382aaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1460,13 +1460,20 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.19.0", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.6", "@babel/runtime@^7.23.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.6", "@babel/runtime@^7.23.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.23.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== dependencies: regenerator-runtime "^0.14.0" +"@babel/runtime@^7.22.5": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.4.tgz#36fa1d2b36db873d25ec631dcc4923fdc1cf2e2e" + integrity sha512-2Yv65nlWnWlSpe3fXEyX5i7fx5kIKo4Qbcj+hMO0odwaneFjfXw5fdum+4yL20O0QiaHpia0cYQ9xpNMqrBwHg== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.3.3": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" @@ -14193,17 +14200,17 @@ husky@^7.0.4: resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== -i18next-browser-languagedetector@^6.1.2: - version "6.1.8" - resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-6.1.8.tgz#8e9c61b32a4dfe9b959b38bc9d2a8b95f799b27c" - integrity sha512-Svm+MduCElO0Meqpj1kJAriTC6OhI41VhlT/A0UPjGoPZBhAHIaGE5EfsHlTpgdH09UVX7rcc72pSDDBeKSQQA== +i18next-browser-languagedetector@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.0.tgz#de0321cba6881be37d82e20e4d6f05aa75f6e37f" + integrity sha512-U00DbDtFIYD3wkWsr2aVGfXGAj2TgnELzOX9qv8bT0aJtvPV9CRO77h+vgmHFBMe7LAxdwvT/7VkCWGya6L3tA== dependencies: - "@babel/runtime" "^7.19.0" + "@babel/runtime" "^7.23.2" i18next-http-backend@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.3.1.tgz#9ea06cd96772527f5bf171f4948af5f34be5fe05" - integrity sha512-jnagFs5cnq4ryb+g92Hex4tB5kj3tWmiRWx8gHMCcE/PEgV1fjH5rC7xyJmPSgyb9r2xgcP8rvZxPKgsmvMqTw== + version "2.4.2" + resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.4.2.tgz#bd53cacaed671e9f38bdcfd46ac9d1763a898186" + integrity sha512-wKrgGcaFQ4EPjfzBTjzMU0rbFTYpa0S5gv9N/d8WBmWS64+IgJb7cHddMvV+tUkse7vUfco3eVs2lB+nJhPo3w== dependencies: cross-fetch "4.0.0" @@ -14214,12 +14221,12 @@ i18next-locize-backend@^6.4.1: dependencies: cross-fetch "4.0.0" -i18next@^20.3.5: - version "20.6.1" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-20.6.1.tgz#535e5f6e5baeb685c7d25df70db63bf3cc0aa345" - integrity sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A== +i18next@23.7.6: + version "23.7.6" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-23.7.6.tgz#7328e76c899052d5d33d930164612dd21e575f74" + integrity sha512-O66BhXBw0fH4bEJMA0/klQKPEbcwAp5wjXEL803pdAynNbg2f4qhLIYlNHJyE7icrL6XmSZKPYaaXwy11kJ6YQ== dependencies: - "@babel/runtime" "^7.12.0" + "@babel/runtime" "^7.23.2" iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" @@ -19035,12 +19042,12 @@ react-hook-form@^7.27.0: resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.48.2.tgz#01150354d2be61412ff56a030b62a119283b9935" integrity sha512-H0T2InFQb1hX7qKtDIZmvpU1Xfn/bdahWBN1fH19gSe4bBEqTfmlr7H3XWTaVtiK4/tpPaI1F3355GPMZYge+A== -react-i18next@^11.11.4: - version "11.18.6" - resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.18.6.tgz#e159c2960c718c1314f1e8fcaa282d1c8b167887" - integrity sha512-yHb2F9BiT0lqoQDt8loZ5gWP331GwctHz9tYQ8A2EIEUu+CcEdjBLQWli1USG3RdWQt3W+jqQLg/d4rrQR96LA== +react-i18next@13.5.0: + version "13.5.0" + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.5.0.tgz#44198f747628267a115c565f0c736a50a76b1ab0" + integrity sha512-CFJ5NDGJ2MUyBohEHxljOq/39NQ972rh1ajnadG9BjTk+UXbHLq4z5DKEbEQBDoIhUmmbuS/fIMJKo6VOax1HA== dependencies: - "@babel/runtime" "^7.14.5" + "@babel/runtime" "^7.22.5" html-parse-stringify "^3.0.1" react-inspector@^6.0.0: