@graphcommerce/lingui-next 2.1.8 → 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +5 -5
- package/utils/withLingui.tsx +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1490](https://github.com/graphcommerce-org/graphcommerce/pull/1490) [`d311ef48b`](https://github.com/graphcommerce-org/graphcommerce/commit/d311ef48bb3e97806d992af5516d6b7f183ec9cb) Thanks [@paales](https://github.com/paales)! - upgraded packages
|
|
8
|
+
|
|
3
9
|
## 2.1.8
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/lingui-next",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.9",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"babel-plugin-macros": "^3.1.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
23
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.8",
|
|
24
24
|
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
25
25
|
"@graphcommerce/typescript-config-pwa": "^4.0.3",
|
|
26
26
|
"@lingui/conf": "^3.13.2",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@lingui/react": "^3.13.2",
|
|
31
31
|
"@lingui/core": "^3.13.2",
|
|
32
32
|
"make-plural": "^6.2.2",
|
|
33
|
-
"next": "12.1.2",
|
|
34
|
-
"react": "^
|
|
35
|
-
"react-dom": "^
|
|
33
|
+
"next": "^12.1.2",
|
|
34
|
+
"react": "^18.0.0",
|
|
35
|
+
"react-dom": "^18.0.0"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/utils/withLingui.tsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core'
|
|
2
2
|
// eslint-disable-next-line @next/next/no-document-import-in-page
|
|
3
|
-
import { DocumentContext } from 'next/document'
|
|
3
|
+
import { DocumentContext, DocumentInitialProps } from 'next/document'
|
|
4
4
|
// eslint-disable-next-line @next/next/no-document-import-in-page
|
|
5
5
|
import type NextDocument from 'next/document'
|
|
6
6
|
import React from 'react'
|
|
7
7
|
import { MessageLoader } from '../types'
|
|
8
8
|
|
|
9
|
+
export type LinguiDocumentProps = { linguiScriptTag: React.ReactNode }
|
|
10
|
+
|
|
9
11
|
export function withLingui(
|
|
10
12
|
Document: typeof NextDocument,
|
|
11
13
|
load: MessageLoader,
|
|
@@ -23,10 +25,9 @@ export function withLingui(
|
|
|
23
25
|
i18n.load(locale, messages)
|
|
24
26
|
i18n.activate(locale)
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
const props: DocumentInitialProps & LinguiDocumentProps = {
|
|
27
29
|
...initial,
|
|
28
|
-
|
|
29
|
-
...(React.Children.toArray(initial.head) as Array<JSX.Element | null>),
|
|
30
|
+
linguiScriptTag: (
|
|
30
31
|
<script
|
|
31
32
|
key='lingui'
|
|
32
33
|
type='application/json'
|
|
@@ -34,9 +35,10 @@ export function withLingui(
|
|
|
34
35
|
lang={locale}
|
|
35
36
|
// eslint-disable-next-line react/no-danger
|
|
36
37
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(messages) }}
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
/>
|
|
39
|
+
),
|
|
39
40
|
}
|
|
41
|
+
return props
|
|
40
42
|
} catch (e) {
|
|
41
43
|
if (process.env.NODE_ENV !== 'production') console.error(e)
|
|
42
44
|
return initial
|