Skip to content

Commit

Permalink
Add lang into getInitialProps (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Mar 24, 2020
1 parent 9edd820 commit 8ac764f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cli/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) : ''}
Expand Down
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.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": [
Expand Down

0 comments on commit 8ac764f

Please sign in to comment.