You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If redirect option is `true`, `/` or `/page-2` will be redirected to the user's preferred language router. e.g) `/ko` or `/ko/page-2`. Otherwise, the pages will render `defaultLangugage` language. You can also specify additional component to be rendered on redirection page by adding `redirectComponent` option.
| defaultLanguage | string | default language when visiting `/page` instead of `ko/page`|
136
-
| redirect | boolean | if the value is `true`, `/` or `/page-2` will be redirected to the user's preferred language router. e.g) `/ko` or `/ko/page-2`. Otherwise, the pages will render `defaultLangugage` language. |
137
-
| redirectComponent | string (optional) | additional component file path to be rendered on with a redirection component for SEO. |
137
+
Option | Type | Description
138
+
-- | -- | --
139
+
path | string | language JSON resource path
140
+
languages | string[] | supported language keys
141
+
defaultLanguage | string | default language when visiting `/page` instead of `ko/page`
142
+
redirect | boolean | if the value is `true`, `/` or `/page-2` will be redirected to the user's preferred language router. e.g) `/ko` or `/ko/page-2`. Otherwise, the pages will render `defaultLangugage` language.
143
+
redirectComponent | string (optional) | additional component file path to be rendered on with a redirection component for SEO.
144
+
138
145
139
146
## Components
140
147
141
148
To make it easy to handle i18n with multi-language url routes, the plugin provides several components.
142
149
143
150
To use it, simply import it from `gatsby-plugin-intl`.
| Link | component | This is a wrapper around @gatsby’s Link component that adds useful enhancements for multi-language routes. All props are passed through to @gatsby’s Link component. |
148
-
| navigate | function | This is a wrapper around @gatsby’s navigate function that adds useful enhancements for multi-language routes. All options are passed through to @gatsby’s navigate function. |
149
-
| changeLocale | function | A function that replaces your locale. `changeLocale(locale, to = null)`|
150
-
| IntlContextConsumer | component | A context component to get plugin configuration on the component level. |
| and more... ||https://github.com/yahoo/react-intl/wiki/Components|
152
+
Component | Type | Description
153
+
-- | -- | --
154
+
Link | component | This is a wrapper around @gatsby’s Link component that adds useful enhancements for multi-language routes. All props are passed through to @gatsby’s Link component.
155
+
navigate | function | This is a wrapper around @gatsby’s navigate function that adds useful enhancements for multi-language routes. All options are passed through to @gatsby’s navigate function.
156
+
changeLocale | function | A function that replaces your locale. `changeLocale(locale, to = null)`
157
+
IntlContextConsumer | component | A context component to get plugin configuration on the component level.
0 commit comments