storybook-i18n 2.0.4 → 2.0.6
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/README.md +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ import type { Renderer, ProjectAnnotations } from '@storybook/types';
|
|
|
23
23
|
import i18n from 'storybook-i18n/preview';
|
|
24
24
|
import { withYourI18nDecorator } from './withYourDecorator';
|
|
25
25
|
|
|
26
|
+
// @ts-ignore
|
|
26
27
|
const i18nDecorators = i18n?.decorators || [];
|
|
27
28
|
|
|
28
29
|
const preview: ProjectAnnotations<Renderer> = {
|
|
@@ -33,6 +34,8 @@ const preview: ProjectAnnotations<Renderer> = {
|
|
|
33
34
|
export default preview;
|
|
34
35
|
```
|
|
35
36
|
|
|
37
|
+
Due to an issue with Storybook (pending resolution), you will need that `@ts-ignore` above the decorators line.
|
|
38
|
+
|
|
36
39
|
The currently selected locale is available in the `locale` global, so you can access it in a decorator using the following snippet:
|
|
37
40
|
|
|
38
41
|
```typscript
|