Skip to content

Commit 45c2b14

Browse files
committed
Add defaultLocale
1 parent a346275 commit 45c2b14

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/gatsby-node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ exports.onCreatePage = async ({ page, actions }, pluginOptions) => {
8585
routed,
8686
originalPath: page.path,
8787
redirect,
88+
defaultLanguage,
8889
},
8990
},
9091
}

src/wrap-page.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ const polyfillIntl = language => {
2323
}
2424
}
2525

26-
const withIntlProvider = (intl, defaultLanguage) => children => {
26+
const withIntlProvider = (intl) => children => {
2727
polyfillIntl(intl.language)
2828
return (
2929
<IntlProvider
3030
locale={intl.language}
31-
defaultLocale={defaultLanguage}
31+
defaultLocale={intl.defaultLanguage}
3232
messages={intl.messages}
3333
>
3434
<IntlContextProvider value={intl}>{children}</IntlContextProvider>
@@ -80,5 +80,5 @@ export default ({ element, props }, pluginOptions) => {
8080
preferDefault(require(GATSBY_INTL_REDIRECT_COMPONENT_PATH))
8181
)
8282
: element
83-
return withIntlProvider(intl, defaultLanguage)(renderElement)
83+
return withIntlProvider(intl)(renderElement)
8484
}

0 commit comments

Comments
 (0)