feat: extract i18n into a package

This commit is contained in:
JimmFly
2023-01-09 14:55:38 +08:00
parent 20e2984c04
commit 047537101c
22 changed files with 172 additions and 170 deletions

50
pnpm-lock.yaml generated
View File

@@ -39,6 +39,7 @@ importers:
packages/app:
specifiers:
'@affine/datacenter': workspace:*
'@affine/i18n': workspace:*
'@blocksuite/blocks': 0.3.1-20230109032243-37ad3ba
'@blocksuite/editor': 0.3.1-20230109032243-37ad3ba
'@blocksuite/icons': ^2.0.2
@@ -65,7 +66,6 @@ importers:
eslint-config-next: 12.3.1
eslint-config-prettier: ^8.5.0
eslint-plugin-prettier: ^4.2.1
i18next: ^21.9.1
lit: ^2.3.1
next: 13.1.0
next-debug-local: ^0.1.5
@@ -76,11 +76,11 @@ importers:
raw-loader: ^4.0.2
react: 18.2.0
react-dom: 18.2.0
react-i18next: ^11.18.4
typescript: 4.8.3
yjs: ^13.5.44
dependencies:
'@affine/datacenter': link:../data-center
'@affine/i18n': link:../i18n
'@blocksuite/blocks': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/editor': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/icons': 2.0.4_w5j4k42lgipnm43s3brx6h3c34
@@ -98,7 +98,6 @@ importers:
cmdk: 0.1.21_7ey2zzynotv32rpkwno45fsx4e
css-spring: 4.1.0
dayjs: 1.11.7
i18next: 21.10.0
lit: 2.4.0
next: 13.1.0_biqbaboplfbrettd7655fr4n2y
next-debug-local: 0.1.5
@@ -107,7 +106,6 @@ importers:
quill-cursors: 4.0.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-i18next: 11.18.6_vfm63zmruocgezzfl2v26zlzpy
yjs: 13.5.44
devDependencies:
'@types/node': 18.7.18
@@ -160,6 +158,17 @@ importers:
fake-indexeddb: 4.0.1
typescript: 4.9.3
packages/i18n:
specifiers:
i18next: ^21.9.1
react-i18next: ^11.18.4
typescript: ^4.8.4
dependencies:
i18next: 21.10.0
react-i18next: 11.18.6_i18next@21.10.0
devDependencies:
typescript: 4.9.3
packages/logger:
specifiers:
'@types/react': ^18.0.21
@@ -1361,6 +1370,7 @@ packages:
engines: {node: '>=6.9.0'}
dependencies:
regenerator-runtime: 0.13.9
dev: false
/@babel/runtime/7.20.7:
resolution: {integrity: sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ==}
@@ -1704,7 +1714,7 @@ packages:
dependencies:
'@babel/helper-module-imports': 7.18.6
'@babel/plugin-syntax-jsx': 7.18.6
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
'@emotion/hash': 0.9.0
'@emotion/memoize': 0.8.0
'@emotion/serialize': 1.1.0
@@ -2586,7 +2596,7 @@ packages:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
'@mui/utils': 5.10.9_react@18.2.0
'@types/react': 18.0.20
prop-types: 15.8.1
@@ -2606,7 +2616,7 @@ packages:
'@emotion/styled':
optional: true
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
'@emotion/cache': 11.10.3
'@emotion/react': 11.10.4_w5j4k42lgipnm43s3brx6h3c34
'@emotion/styled': 11.10.4_yiaqs725o7pcd7rteavrnhgj4y
@@ -2631,7 +2641,7 @@ packages:
'@types/react':
optional: true
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
'@emotion/react': 11.10.4_w5j4k42lgipnm43s3brx6h3c34
'@emotion/styled': 11.10.4_yiaqs725o7pcd7rteavrnhgj4y
'@mui/private-theming': 5.10.9_w5j4k42lgipnm43s3brx6h3c34
@@ -2662,7 +2672,7 @@ packages:
peerDependencies:
react: ^17.0.0 || ^18.0.0
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
'@types/prop-types': 15.7.5
'@types/react-is': 17.0.3
prop-types: 15.8.1
@@ -3704,7 +3714,7 @@ packages:
resolution: {integrity: sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==}
engines: {node: '>=6.0'}
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
'@babel/runtime-corejs3': 7.19.1
dev: true
@@ -3809,7 +3819,7 @@ packages:
resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
engines: {node: '>=10', npm: '>=6'}
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
cosmiconfig: 7.0.1
resolve: 1.22.1
dev: false
@@ -4374,7 +4384,7 @@ packages:
/dom-helpers/5.2.1:
resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
csstype: 3.1.1
dev: false
@@ -4741,7 +4751,7 @@ packages:
peerDependencies:
eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
aria-query: 4.2.2
array-includes: 3.1.5
ast-types-flow: 0.0.7
@@ -4763,7 +4773,7 @@ packages:
peerDependencies:
eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
aria-query: 4.2.2
array-includes: 3.1.5
ast-types-flow: 0.0.7
@@ -5595,7 +5605,7 @@ packages:
/i18next/21.10.0:
resolution: {integrity: sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==}
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
dev: false
/iconv-lite/0.4.24:
@@ -7011,7 +7021,7 @@ packages:
react: 18.2.0
scheduler: 0.23.0
/react-i18next/11.18.6_vfm63zmruocgezzfl2v26zlzpy:
/react-i18next/11.18.6_i18next@21.10.0:
resolution: {integrity: sha512-yHb2F9BiT0lqoQDt8loZ5gWP331GwctHz9tYQ8A2EIEUu+CcEdjBLQWli1USG3RdWQt3W+jqQLg/d4rrQR96LA==}
peerDependencies:
i18next: '>= 19.0.0'
@@ -7024,11 +7034,9 @@ packages:
react-native:
optional: true
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
html-parse-stringify: 3.0.1
i18next: 21.10.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
/react-is/16.13.1:
@@ -7096,7 +7104,7 @@ packages:
react: '>=16.6.0'
react-dom: '>=16.6.0'
dependencies:
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
dom-helpers: 5.2.1
loose-envify: 1.4.0
prop-types: 15.8.1
@@ -8280,7 +8288,7 @@ packages:
'@apideck/better-ajv-errors': 0.3.6_ajv@8.11.2
'@babel/core': 7.20.5
'@babel/preset-env': 7.20.2_@babel+core@7.20.5
'@babel/runtime': 7.19.0
'@babel/runtime': 7.20.7
'@rollup/plugin-babel': 5.3.1_opjstonlpkhafnz76jsxdwq25a
'@rollup/plugin-node-resolve': 11.2.1_rollup@2.79.1
'@rollup/plugin-replace': 2.4.2_rollup@2.79.1