From 9d395b0824e5b0a402a359c7530cf7eede8b5aea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 02:09:13 +0000 Subject: [PATCH 1/2] chore(deps): bump i18next from 22.5.1 to 23.13.0 in /template Bumps [i18next](https://github.com/i18next/i18next) from 22.5.1 to 23.13.0. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v22.5.1...v23.13.0) --- updated-dependencies: - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- template/package.json | 2 +- template/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/template/package.json b/template/package.json index e6db10a..43f676d 100644 --- a/template/package.json +++ b/template/package.json @@ -27,7 +27,7 @@ "@react-navigation/stack": "^6.3.20", "@reduxjs/toolkit": "^1.9.5", "axios": "^1.6.8", - "i18next": "^22.4.15", + "i18next": "^23.13.0", "intl-pluralrules": "^2.0.1", "react": "18.2.0", "react-i18next": "^12.3.1", diff --git a/template/yarn.lock b/template/yarn.lock index 05e4189..2b1bc5b 100644 --- a/template/yarn.lock +++ b/template/yarn.lock @@ -1124,10 +1124,10 @@ 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.12.1", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.6", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.24.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.6.tgz#5b76eb89ad45e2e4a0a8db54c456251469a3358e" - integrity sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw== +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.6", "@babel/runtime@^7.23.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.0.tgz#3af9a91c1b739c569d5d80cc917280919c544ecb" + integrity sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw== dependencies: regenerator-runtime "^0.14.0" @@ -4851,12 +4851,12 @@ husky@^8.0.3: resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== -i18next@^22.4.15: - version "22.5.1" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.5.1.tgz#99df0b318741a506000c243429a7352e5f44d424" - integrity sha512-8TGPgM3pAD+VRsMtUMNknRz3kzqwp/gPALrWMsDnmC1mKqJwpWyooQRLMcbTwq8z8YwSmuj+ZYvc+xCuEpkssA== +i18next@^23.13.0: + version "23.13.0" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-23.13.0.tgz#d3cba6c5611b9826ff988f97a4929638a91875f6" + integrity sha512-B+g0/KTKmN3+NeMKPljQxdrih6Q6lyDF5O2e/Ofd0JQsTLojJD/BSTTN04iw6OVc0yBiHeypu5hoBNV6ag44Zw== dependencies: - "@babel/runtime" "^7.20.6" + "@babel/runtime" "^7.23.2" iconv-lite@^0.4.24: version "0.4.24" From 93cd44cc0efab162f4fcc384e5ad574b48c46167 Mon Sep 17 00:00:00 2001 From: danhmaigts Date: Tue, 22 Oct 2024 09:40:39 +0700 Subject: [PATCH 2/2] fix: update type of params in getString --- template/src/locale/I18nConfig.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/template/src/locale/I18nConfig.ts b/template/src/locale/I18nConfig.ts index 21dd3a5..e3b8b00 100644 --- a/template/src/locale/I18nConfig.ts +++ b/template/src/locale/I18nConfig.ts @@ -38,7 +38,9 @@ type TranslateStr, Key extends keyof O> = Key exte : never}` : Key -export const getString = (key: TranslateStr, params: object = {}) => - getI18n() ? getI18n().t(key, params) : '' +export const getString = ( + key: TranslateStr, + params: Record = {}, +) => (getI18n() ? getI18n().t(key, params) : '') export default i18n