Skip to content

Commit

Permalink
Fix appWithI18n props (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Dec 11, 2019
1 parent d9964bd commit 2c35821
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-translate",
"version": "0.1.5",
"version": "0.1.6",
"description": "Next.js utility to translate pages without the need of a server (static i18n pages generator).",
"license": "MIT",
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions src/appWithI18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default function appWithI18n(AppToTranslate, config = {}) {

AppWithTranslations.getInitialProps = async ({ Component, ctx }) => {
const lang = getLang(ctx, config)
let pageProps = {}
let appProps = { pageProps: {} }

if (AppToTranslate.getInitialProps) {
pageProps = (await AppToTranslate.getInitialProps({
appProps = (await AppToTranslate.getInitialProps({
Component, ctx, lang
})) || {}
}
Expand All @@ -45,7 +45,7 @@ export default function appWithI18n(AppToTranslate, config = {}) {
)

return {
pageProps,
...appProps,
lang,
namespaces: namespaces.reduce((obj, ns, i) => {
obj[ns] = pageNamespaces[i]
Expand Down

0 comments on commit 2c35821

Please sign in to comment.