Skip to content

Commit

Permalink
rename zh to zh-CN for simplified Chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
danielduan committed Jul 23, 2018
1 parent 8832b48 commit 6266892
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
'conclusion',
'contribute',
],
languages: ['en', 'es'],
languages: ['en', 'es', 'zh-CN'],
defaultTranslation: 'react/en',
siteUrl: 'https://learnstorybook.com',
githubUrl: 'https://github.com/hichroma/learnstorybook.com',
Expand Down
11 changes: 9 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,14 @@ const Chapters = styled.ol`
counter-reset: counter;
`;

export default ({ data: { site: { siteMetadata: { toc, defaultTranslation } }, pages } }) => {
export default ({
data: {
site: {
siteMetadata: { toc, defaultTranslation },
},
pages,
},
}) => {
const defaultPages = {
edges: pages.edges.filter(e => e.node.fields.slug.match(defaultTranslation)),
};
Expand Down Expand Up @@ -255,7 +262,7 @@ export default ({ data: { site: { siteMetadata: { toc, defaultTranslation } }, p
<ViewLayerImage src="/logo-react.svg" alt="React" />Español
</Button>
</Link>
<Link isGatsby to={`/react/zh/${firstChapter}`}>
<Link isGatsby to={`/react/zh-CN/${firstChapter}`}>
<Button inverse>
<ViewLayerImage src="/logo-react.svg" alt="React" />中文^.^
</Button>
Expand Down

0 comments on commit 6266892

Please sign in to comment.