Skip to content

Commit d648a63

Browse files
authored
Update i18n to resolve issues rendering unclosed div tags (#5547)
1 parent a1f7d28 commit d648a63

File tree

8 files changed

+76
-64
lines changed

8 files changed

+76
-64
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727
"events": "^3.0.0",
2828
"formik": "^2.2.6",
2929
"framer-motion": "^6.3.10",
30-
"i18next": "^21.8.9",
31-
"i18next-http-backend": "^1.4.1",
32-
"i18next-multiload-backend-adapter": "^1.0.0",
30+
"i18next": "^25.8.0",
31+
"i18next-http-backend": "^3.0.2",
32+
"i18next-multiload-backend-adapter": "^2.3.0",
3333
"pathe": "^2.0.3",
3434
"qrcode.react": "^1.0.1",
3535
"react": "^16.14.0",
3636
"react-chartjs-2": "^4.2.0",
3737
"react-dom": "npm:@hot-loader/react-dom",
3838
"react-fast-compare": "^3.2.0",
3939
"react-hot-loader": "^4.12.21",
40-
"react-i18next": "^11.2.1",
40+
"react-i18next": "^16.5.4",
4141
"react-router-dom": "^5.1.2",
4242
"react-transition-group": "^4.4.1",
4343
"reaptcha": "^1.7.2",

resources/scripts/components/dashboard/forms/DisableTOTPDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const DisableTOTPDialog = () => {
4848
type={'password'}
4949
variant={Input.Text.Variants.Loose}
5050
value={password}
51-
onChange={(e) => setPassword(e.currentTarget.value)}
51+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.currentTarget.value)}
5252
/>
5353
<Dialog.Footer>
5454
<Button.Text onClick={close}>Cancel</Button.Text>

resources/scripts/components/dashboard/forms/SetupTOTPDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const ConfigureTwoFactorForm = ({ onTokens }: Props) => {
8181
aria-labelledby={'totp-code-description'}
8282
variant={Input.Text.Variants.Loose}
8383
value={value}
84-
onChange={(e) => setValue(e.currentTarget.value)}
84+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setValue(e.currentTarget.value)}
8585
className={'mt-3'}
8686
placeholder={'000000'}
8787
type={'text'}
@@ -97,7 +97,7 @@ const ConfigureTwoFactorForm = ({ onTokens }: Props) => {
9797
className={'mt-1'}
9898
type={'password'}
9999
value={password}
100-
onChange={(e) => setPassword(e.currentTarget.value)}
100+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.currentTarget.value)}
101101
/>
102102
<Dialog.Footer>
103103
<Button.Text onClick={close}>Cancel</Button.Text>

resources/scripts/components/elements/Translate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import { Trans, TransProps, useTranslation } from 'react-i18next';
2+
import { Trans, TransSelectorProps, useTranslation } from 'react-i18next';
33

4-
type Props = Omit<TransProps, 't'>;
4+
type Props = Omit<TransSelectorProps<any, any>, 't'>;
55

66
export default ({ ns, children, ...props }: Props) => {
77
const { t } = useTranslation(ns);

resources/scripts/components/elements/inputs/InputField.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@ enum Variant {
88
Loose,
99
}
1010

11-
interface InputFieldProps extends React.ComponentProps<'input'> {
12-
variant?: Variant;
13-
}
14-
15-
const Component = forwardRef<HTMLInputElement, InputFieldProps>(({ className, variant, ...props }, ref) => (
16-
<input
17-
ref={ref}
18-
className={classNames(
19-
'form-input',
20-
styles.text_input,
21-
{ [styles.loose]: variant === Variant.Loose },
22-
className
23-
)}
24-
{...props}
25-
/>
26-
));
11+
const Component = forwardRef<HTMLInputElement, React.ComponentProps<'input'> & { variant?: Variant }>(
12+
({ className, variant, ...props }, ref) => (
13+
<input
14+
ref={ref}
15+
className={classNames(
16+
'form-input',
17+
styles.text_input,
18+
{ [styles.loose]: variant === Variant.Loose },
19+
className
20+
)}
21+
{...props}
22+
/>
23+
)
24+
);
2725

2826
const InputField = Object.assign(Component, { Variants: Variant });
2927

resources/scripts/i18n.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
3-
import I18NextHttpBackend, { BackendOptions } from 'i18next-http-backend';
3+
import I18NextHttpBackend, { HttpBackendOptions } from 'i18next-http-backend';
44
import I18NextMultiloadBackendAdapter from 'i18next-multiload-backend-adapter';
55

66
// If we're using HMR use a unique hash per page reload so that we're always
@@ -21,7 +21,7 @@ i18n.use(I18NextMultiloadBackendAdapter)
2121
loadPath: '/locales/locale.json?locale={{lng}}&namespace={{ns}}',
2222
queryStringParams: { hash },
2323
allowMultiLoading: true,
24-
} as BackendOptions,
24+
} as HttpBackendOptions,
2525
} as Record<string, any>,
2626
interpolation: {
2727
// Per i18n-react documentation: this is not needed since React is already

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"target": "es2015",
44
"module": "es2020",
5-
"jsx": "react",
5+
"jsx": "react-jsx",
66
"moduleResolution": "node",
77
"lib": [
88
"es2015",

yarn.lock

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@
10901090
"@babel/helper-plugin-utils" "^7.10.4"
10911091
"@babel/plugin-transform-typescript" "^7.12.1"
10921092

1093-
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
1093+
"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.4.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2":
10941094
version "7.18.3"
10951095
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4"
10961096
integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==
@@ -1102,6 +1102,11 @@
11021102
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.28.4.tgz#a70226016fabe25c5783b2f22d3e1c9bc5ca3326"
11031103
integrity sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==
11041104

1105+
"@babel/runtime@^7.28.4":
1106+
version "7.28.6"
1107+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.28.6.tgz#d267a43cb1836dc4d182cce93ae75ba954ef6d2b"
1108+
integrity sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==
1109+
11051110
"@babel/template@^7.10.4":
11061111
version "7.16.7"
11071112
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155"
@@ -3753,12 +3758,12 @@ cross-env@^7.0.2:
37533758
dependencies:
37543759
cross-spawn "^7.0.1"
37553760

3756-
cross-fetch@3.1.5:
3757-
version "3.1.5"
3758-
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
3759-
integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==
3761+
cross-fetch@4.0.0:
3762+
version "4.0.0"
3763+
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983"
3764+
integrity sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==
37603765
dependencies:
3761-
node-fetch "2.6.7"
3766+
node-fetch "^2.6.12"
37623767

37633768
cross-spawn@^7.0.1, cross-spawn@^7.0.2:
37643769
version "7.0.3"
@@ -5224,11 +5229,12 @@ html-escaper@^2.0.0:
52245229
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
52255230
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
52265231

5227-
html-parse-stringify2@2.0.1:
5228-
version "2.0.1"
5229-
resolved "https://registry.yarnpkg.com/html-parse-stringify2/-/html-parse-stringify2-2.0.1.tgz#dc5670b7292ca158b7bc916c9a6735ac8872834a"
5232+
html-parse-stringify@^3.0.1:
5233+
version "3.0.1"
5234+
resolved "https://registry.yarnpkg.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2"
5235+
integrity sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==
52305236
dependencies:
5231-
void-elements "^2.0.1"
5237+
void-elements "3.1.0"
52325238

52335239
html-tags@^3.1.0:
52345240
version "3.3.1"
@@ -5296,24 +5302,24 @@ hyperdyperid@^1.2.0:
52965302
resolved "https://registry.yarnpkg.com/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b"
52975303
integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==
52985304

5299-
i18next-http-backend@^1.4.1:
5300-
version "1.4.1"
5301-
resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-1.4.1.tgz#d8d308e7d8c5b89988446d0b83f469361e051bc0"
5302-
integrity sha512-s4Q9hK2jS29iyhniMP82z+yYY8riGTrWbnyvsSzi5TaF7Le4E7b5deTmtuaRuab9fdDcYXtcwdBgawZG+JCEjA==
5305+
i18next-http-backend@^3.0.2:
5306+
version "3.0.2"
5307+
resolved "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-3.0.2.tgz#7c8daa31aa69679e155ec1f96a37846225bdf907"
5308+
integrity sha512-PdlvPnvIp4E1sYi46Ik4tBYh/v/NbYfFFgTjkwFl0is8A18s7/bx9aXqsrOax9WUbeNS6mD2oix7Z0yGGf6m5g==
53035309
dependencies:
5304-
cross-fetch "3.1.5"
5310+
cross-fetch "4.0.0"
53055311

5306-
i18next-multiload-backend-adapter@^1.0.0:
5307-
version "1.0.0"
5308-
resolved "https://registry.yarnpkg.com/i18next-multiload-backend-adapter/-/i18next-multiload-backend-adapter-1.0.0.tgz#3cc3ea102814273bb9059a317d04a3b6e4316121"
5309-
integrity sha512-rZd/Qmr7KkGktVgJa78GPLXEnd51OyB2I9qmbI/mXKPm3MWbXwplIApqmZgxkPC9ce+b8Jnk227qX62W9SaLPQ==
5312+
i18next-multiload-backend-adapter@^2.3.0:
5313+
version "2.3.0"
5314+
resolved "https://registry.yarnpkg.com/i18next-multiload-backend-adapter/-/i18next-multiload-backend-adapter-2.3.0.tgz#d3a0249671b560c186ccf74c15869f781af81b28"
5315+
integrity sha512-k52N4CImVEDeA+jJo16EJIDdlemSIsWmX6MuBPyR5V8Ig1vQSqVG1acXiQkKE+txLxD8LnR6WKYhkcxTcR86kw==
53105316

5311-
i18next@^21.8.9:
5312-
version "21.8.9"
5313-
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.8.9.tgz#c79edd5bba61e0a0d5b43a93d52e2d13a526de82"
5314-
integrity sha512-PY9a/8ADVmnju1tETeglbbVQi+nM5pcJQWm9kvKMTE3GPgHHtpDsHy5HQ/hccz2/xtW7j3vuso23JdQSH0EttA==
5317+
i18next@^25.8.0:
5318+
version "25.8.0"
5319+
resolved "https://registry.yarnpkg.com/i18next/-/i18next-25.8.0.tgz#8b4ac516db016ebba70d2b68f5ba17e6ffcd4935"
5320+
integrity sha512-urrg4HMFFMQZ2bbKRK7IZ8/CTE7D8H4JRlAwqA2ZwDRFfdd0K/4cdbNNLgfn9mo+I/h9wJu61qJzH7jCFAhUZQ==
53155321
dependencies:
5316-
"@babel/runtime" "^7.17.2"
5322+
"@babel/runtime" "^7.28.4"
53175323

53185324
iconv-lite@0.4.24:
53195325
version "0.4.24"
@@ -6679,10 +6685,10 @@ node-emoji@^1.11.0:
66796685
dependencies:
66806686
lodash "^4.17.21"
66816687

6682-
node-fetch@2.6.7:
6683-
version "2.6.7"
6684-
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
6685-
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
6688+
node-fetch@^2.6.12:
6689+
version "2.7.0"
6690+
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
6691+
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
66866692
dependencies:
66876693
whatwg-url "^5.0.0"
66886694

@@ -7601,12 +7607,14 @@ react-hot-loader@^4.12.21:
76017607
shallowequal "^1.1.0"
76027608
source-map "^0.7.3"
76037609

7604-
react-i18next@^11.2.1:
7605-
version "11.2.1"
7606-
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.2.1.tgz#a56d9f1f52d003eb4fa8f1c7d6752123827160f0"
7610+
react-i18next@^16.5.4:
7611+
version "16.5.4"
7612+
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-16.5.4.tgz#4f458b1baab274dca439ab67629c854203bf97c6"
7613+
integrity sha512-6yj+dcfMncEC21QPhOTsW8mOSO+pzFmT6uvU7XXdvM/Cp38zJkmTeMeKmTrmCMD5ToT79FmiE/mRWiYWcJYW4g==
76077614
dependencies:
7608-
"@babel/runtime" "^7.3.1"
7609-
html-parse-stringify2 "2.0.1"
7615+
"@babel/runtime" "^7.28.4"
7616+
html-parse-stringify "^3.0.1"
7617+
use-sync-external-store "^1.6.0"
76107618

76117619
react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0:
76127620
version "16.13.1"
@@ -9103,6 +9111,11 @@ use-sync-external-store@^1.2.0:
91039111
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a"
91049112
integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==
91059113

9114+
use-sync-external-store@^1.6.0:
9115+
version "1.6.0"
9116+
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz#b174bfa65cb2b526732d9f2ac0a408027876f32d"
9117+
integrity sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==
9118+
91069119
util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
91079120
version "1.0.2"
91089121
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
@@ -9141,9 +9154,10 @@ vary@~1.1.2:
91419154
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
91429155
integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==
91439156

9144-
void-elements@^2.0.1:
9145-
version "2.0.1"
9146-
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec"
9157+
void-elements@3.1.0:
9158+
version "3.1.0"
9159+
resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09"
9160+
integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==
91479161

91489162
walker@^1.0.8:
91499163
version "1.0.8"

0 commit comments

Comments
 (0)