Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
44ea598f
Unverified
Commit
44ea598f
authored
Nov 03, 2020
by
Aral Roca Gomez
Committed by
GitHub
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update next-translate example to support Next 10 with i18n routing (#18480)
Co-authored-by:
Joe Haddad
<
joe.haddad@zeit.co
>
parent
4620dcc7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
index.js
examples/with-next-translate/_pages/index.js
+3
-3
i18n.json
examples/with-next-translate/i18n.json
+2
-2
next.config.js
examples/with-next-translate/next.config.js
+8
-0
package.json
examples/with-next-translate/package.json
+4
-4
No files found.
examples/with-next-translate/_pages/index.js
View file @
44ea598f
import
Link
from
'next
-translate/L
ink'
import
Link
from
'next
/l
ink'
import
Trans
from
'next-translate/Trans'
import
useTranslation
from
'next-translate/useTranslation'
import
Layout
from
'../components/Layout'
...
...
@@ -22,14 +22,14 @@ export default function Home() {
<
/p
>
<
div
className
=
"grid"
>
<
Link
href
=
"/"
l
ang
=
"en"
>
<
Link
href
=
"/"
l
ocale
=
"en"
>
<
div
className
=
"card"
>
<
h3
>
{
t
(
'home:english'
)}
<
/h3
>
<
p
>
{
t
(
'home:change-english'
)}
<
/p
>
<
/div
>
<
/Link
>
<
Link
href
=
"/"
l
ang
=
"ca"
>
<
Link
href
=
"/"
l
ocale
=
"ca"
>
<
div
className
=
"card"
>
<
h3
>
{
t
(
'home:catalan'
)}
<
/h3
>
<
p
>
{
t
(
'home:change-catalan'
)}
<
/p
>
...
...
examples/with-next-translate/i18n.json
View file @
44ea598f
{
"
allLanguag
es"
:
[
"en"
,
"ca"
],
"defaultL
anguag
e"
:
"en"
,
"
local
es"
:
[
"en"
,
"ca"
],
"defaultL
ocal
e"
:
"en"
,
"currentPagesDir"
:
"_pages"
,
"finalPagesDir"
:
"pages"
,
"localesPath"
:
"locales"
,
...
...
examples/with-next-translate/next.config.js
0 → 100644
View file @
44ea598f
const
{
locales
,
defaultLocale
}
=
require
(
'./i18n.json'
)
module
.
exports
=
{
i18n
:
{
locales
,
defaultLocale
,
},
}
examples/with-next-translate/package.json
View file @
44ea598f
...
...
@@ -6,10 +6,10 @@
"start"
:
"next start"
},
"dependencies"
:
{
"next"
:
"
9.4.4
"
,
"next-translate"
:
"0.1
6.1
"
,
"react"
:
"1
6.13
.1"
,
"react-dom"
:
"1
6.13
.1"
"next"
:
"
10.0.0
"
,
"next-translate"
:
"0.1
9.0
"
,
"react"
:
"1
7.0
.1"
,
"react-dom"
:
"1
7.0
.1"
},
"license"
:
"MIT"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment