diff --git a/cli/builder.js b/cli/builder.js index 5c961d4e..9d660b44 100755 --- a/cli/builder.js +++ b/cli/builder.js @@ -126,6 +126,10 @@ export default function Page(p){ Page = Object.assign(Page, { ...C }) +if(C.getInitialProps) { + Page.getInitialProps = ctx => C.getInitialProps({ ...ctx, lang: '${lang}'}) +} + ${isGetStaticProps ? specialMethod('getStaticProps', lang) : ''} ${isGetStaticPaths ? specialMethod('getStaticPaths', lang) : ''} ${isGetServerSideProps ? specialMethod('getServerSideProps', lang) : ''} diff --git a/package.json b/package.json index 441224db..2b973b63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-translate", - "version": "0.13.0-canary.2", + "version": "0.13.0-canary.3", "description": "Next.js utility to translate pages without the need of a server (static i18n pages generator).", "license": "MIT", "keywords": [