@graphcommerce/docs 4.6.3 → 4.6.4

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 CHANGED
@@ -1,5 +1,48 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1443](https://github.com/graphcommerce-org/graphcommerce/pull/1443) [`c4c86df1e`](https://github.com/graphcommerce-org/graphcommerce/commit/c4c86df1e8c74956b2ae76ab1a88c496fced4790) Thanks [@timhofman](https://github.com/timhofman)! - Missing or outdated resolutions results in build errors
8
+
9
+ * [#1451](https://github.com/graphcommerce-org/graphcommerce/pull/1451) [`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061) Thanks [@paales](https://github.com/paales)! - Removed all occurences of @lingui/macro and moved to @lingui/macro / @lingui/core in preparation to move to swc.
10
+
11
+ Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
12
+
13
+ All occurences of `<Trans>` and `t` need to be replaced:
14
+
15
+ ```tsx
16
+ import { Trans, t } from '@lingui/macro'
17
+
18
+ function MyComponent() {
19
+ const foo = 'bar'
20
+ return (
21
+ <div aria-label={t`Account ${foo}`}>
22
+ <Trans>My Translation {foo}</Trans>
23
+ </div>
24
+ )
25
+ }
26
+ ```
27
+
28
+ Needs to be replaced with:
29
+
30
+ ```tsx
31
+ import { Trans } from '@lingui/react'
32
+ import { i18n } from '@lingui/core'
33
+
34
+ function MyComponent() {
35
+ const foo = 'bar'
36
+ return (
37
+ <div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
38
+ <Trans key='My Translation {foo}' values={{ foo }}></Trans>
39
+ </div>
40
+ )
41
+ }
42
+ ```
43
+
44
+ [More examples for Trans](https://lingui.js.org/ref/macro.html#examples-of-jsx-macros) and [more examples for `t`](https://lingui.js.org/ref/macro.html#examples-of-js-macros)
45
+
3
46
  ## 4.6.3
4
47
 
5
48
  ### Patch Changes
package/feature-list.md CHANGED
@@ -218,7 +218,7 @@ Black checkbox is a feature unaffected by GraphCommerce
218
218
  average order value.
219
219
  - [ ] Show pricing tiers. — [Todo]
220
220
  - [x] Present product ratings and reviews.
221
- - [ ] Provide an option to add products to a wish list. — [Todo]
221
+ - [x] Provide an option to add products to a wish list.
222
222
  - [ ] Add Facebook, Twitter, and email links to share products. — [Todo]
223
223
 
224
224
  ### Checkout
@@ -26,12 +26,12 @@ msgstr "cancelado"
26
26
 
27
27
  The msgid is the message being translated. In
28
28
  /node_modules/@graphcommerce/magento-cart/components/EmptyCart/EmptyCart.tsx,
29
- you can see a the first msgid is passed as a propped, wrapped in the `<Trans>`
29
+ you can see that the first msgid is passed as a the id prop to the <Trans>
30
30
  component:
31
31
 
32
- ```ts
32
+ ```tsx
33
33
  <FullPageMessage
34
- title={<Trans>Your cart is empty</Trans>}
34
+ title={<Trans id="Your cart is empty" />}
35
35
  ...
36
36
  >
37
37
  ```
@@ -57,20 +57,31 @@ Refresh to see your changes updated
57
57
  ## Adding translations to custom component
58
58
 
59
59
  If you're building a component, you can wrap the strings you want to translate
60
- in the `<Trans>` jsx macro:
60
+ in the `<Trans>` component:
61
61
 
62
- ```ts
62
+ ```tsx
63
63
  <Typography variant='h3'>
64
- <Trans>Call us now</Trans>
64
+ <Trans id='Call us now' />
65
65
  </Typography>
66
66
  ```
67
67
 
68
+ To translate a string:
69
+
70
+ ```tsx
71
+ <PageMeta title={i18n._(/* i18n */ `Blog`)} />
72
+ ```
73
+
74
+ _The `/* i18n */` comment is required for `lingui extract` to work properly_
75
+
68
76
  Add Linqui to the component's imports:
69
77
 
70
- ```ts
71
- import { t, Trans } from '@lingui/macro'
78
+ ```tsx
79
+ import { Trans } from '@lingui/react'
80
+ import { i18n } from '@lingui/core'
72
81
  ```
73
82
 
83
+ ## Generating translation files with all translations
84
+
74
85
  Run `yarn lingui`. All new (missing) translations will be added to translations
75
86
  files:
76
87
 
@@ -184,11 +195,12 @@ msgstr ""
184
195
 
185
196
  ```
186
197
 
187
- 5. Add your translations ins the newly created .po file. Run the app and use the
198
+ 5. Add your translations in the newly created .po file. Run the app and use the
188
199
  store switcher to navigate to your new storeview.
189
- [Github copilot ↗](https://copilot.github.com/) provides very accurate
190
- suggestions in VS Code with the
191
- [Github copilot extention ↗](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot).
200
+
201
+ > Tip: [Github copilot ↗](https://copilot.github.com/) provides very accurate
202
+ > suggestions in VS Code with the
203
+ > [Github copilot extention ↗](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot).
192
204
 
193
205
  ### Magento Locale codes
194
206
 
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "@graphcommerce/docs",
3
3
  "homepage": "https://www.graphcommerce.org/docs",
4
4
  "repository": "github:graphcommerce-org/graphcommerce/docs",
5
- "version": "4.6.3",
5
+ "version": "4.6.4",
6
6
  "sideEffects": true,
7
7
  "devDependencies": {
8
- "@graphcommerce/prettier-config-pwa": "^4.0.5"
8
+ "@graphcommerce/prettier-config-pwa": "^4.0.6"
9
9
  },
10
10
  "prettier": "@graphcommerce/prettier-config-pwa"
11
11
  }
package/roadmap.md CHANGED
@@ -10,7 +10,6 @@ The following overview contains the status of items on the GraphCommerce roadmap
10
10
  ## In progress
11
11
 
12
12
  - [ ] Adyen payment service (Braintree, Mollie, already implemented)
13
- - [ ] Wishlist
14
13
  - [ ] PageBuilder support
15
14
  - [ ] Fetch Magento image sizes (probe-image-size)
16
15
 
package/upgrading.md CHANGED
@@ -74,7 +74,8 @@ Compare your local /package.json with the example's
74
74
  [remove PSP's](./getting-started/create.md#remove-unused-psps) your backend
75
75
  doesn't support.
76
76
  2. Replace your local `devDependencies` with the example's `devDependencies`
77
- 3. Replace your local `scripts` with the example's `scripts_local`
77
+ 3. Replace your local `resolutions` with the example's `resolutions`
78
+ 4. Replace your local `scripts` with the example's `scripts_local`
78
79
 
79
80
  After updating the package.json file, run the following to install the latest
80
81
  packages: