Skip to content

Commit 2b72070

Browse files
committed
fix: update snapshot methods to include allowLocaleFallback
Update client `getSnapshot` methods to include docs for the `allowLocaleFallback` param. Also adds changelogs to both methods.
1 parent 12af326 commit 2b72070

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

developer/reference/client/get-component-snapshot.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import PagesCatchAllLocalizedExample from "/snippets/pages-router/catch-all-loca
2323
<ParamField query="locale" type="string">
2424
A valid locale string.
2525
</ParamField>
26+
<ParamField query="allowLocaleFallback" type="boolean" default={true}>
27+
Controls whether a request for a localized component should fallback to the default locale if the requested locale is not available.
28+
</ParamField>
2629
</Expandable>
2730
</ParamField>
2831

@@ -77,3 +80,9 @@ const snapshot = await client.getComponentSnapshot(id, {
7780
locale,
7881
});
7982
```
83+
84+
## Changelog
85+
86+
| Version | Changes |
87+
| ------------------------------------------------------------------------------------------------ | ------------------------------------- |
88+
| [`v0.23.0`](https://github.com/makeswift/makeswift/releases/tag/%40makeswift%2Fruntime%400.23.0) | `getComponentSnapshot` method introduced |

developer/reference/client/get-page-snapshot.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import PagesCatchAllLocalizedExample from "/snippets/pages-router/catch-all-loca
2323
<ParamField query="locale" type="string">
2424
A valid locale string (ex. `"en-US"`).
2525
</ParamField>
26+
<ParamField query="allowLocaleFallback" type="boolean" default={true}>
27+
Controls whether a request for a localized page should fallback to the default locale if the requested locale is not available.
28+
</ParamField>
2629
</Expandable>
2730
</ParamField>
2831

@@ -46,3 +49,11 @@ The following example sets up a [catch all route](https://nextjs.org/docs/pages/
4649
The following example uses the `locale` param in `getStaticProps` to fetch a localized snapshot of a page.
4750

4851
<PagesCatchAllLocalizedExample />
52+
53+
## Changelog
54+
55+
| Version | Changes |
56+
| ------------------------------------------------------------------------------------------------ | ------------------------------------- |
57+
| [`v0.24.0`](https://github.com/makeswift/makeswift/releases/tag/%40makeswift%2Fruntime%400.24.0) | Adds `allowLocaleFallback` option |
58+
| [`v0.11.0`](https://github.com/makeswift/makeswift/releases/tag/%40makeswift%2Fruntime%400.11.0) | Adds `locale` option |
59+
| [`v0.2.0`](https://github.com/makeswift/makeswift/releases/tag/%40makeswift%2Fruntime%400.2.0) | `getPageSnapshot` method introduced |

0 commit comments

Comments
 (0)