Skip to content

Commit b18274d

Browse files
committed
multilanguage support
1 parent e794145 commit b18274d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+119
-8
lines changed

img/llama-1.png

220 KB

middleware.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { locales as middleware } from 'nextra/locales'

next.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ const withNextra = require('nextra')({
33
themeConfig: './theme.config.tsx',
44
})
55

6-
module.exports = withNextra()
6+
module.exports = withNextra({
7+
i18n: {
8+
locales: ['en', 'zh'],
9+
defaultLocale: 'en'
10+
}
11+
})
File renamed without changes.

pages/_meta.zh.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"index": "Prompt Engineering (ZH)",
3+
"introduction": "Introduction",
4+
"techniques": "Techniques",
5+
"applications": "Applications",
6+
"models": "Models",
7+
"risks": "Risks & Misuses",
8+
"papers": "Papers",
9+
"tools": "Tools",
10+
"notebooks": "Notebooks",
11+
"datasets": "Datasets",
12+
"readings": "Additional Readings",
13+
"about": {
14+
"title": "About",
15+
"type": "page"
16+
},
17+
"contact": {
18+
"title": "Contact ↗",
19+
"type": "page",
20+
"href": "https://twitter.com/dair_ai",
21+
"newWindow": true
22+
}
23+
}
24+

pages/applications.mdx renamed to pages/applications.en.mdx

Lines changed: 1 addition & 1 deletion
File renamed without changes.

pages/index.zh.mdx

Lines changed: 3 additions & 0 deletions
File renamed without changes.

pages/models/_meta.en.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"flan": "Flan",
3+
"chatgpt": "ChatGPT",
4+
"llama": "LLaMA",
5+
"gpt-4": "GPT-4",
6+
"collection": "Model Collection"
7+
}
8+

pages/models/_meta.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

pages/models/collection.en.mdx

Lines changed: 27 additions & 0 deletions

pages/models/llama.en.mdx

Lines changed: 39 additions & 0 deletions

pages/papers.mdx renamed to pages/papers.en.mdx

Lines changed: 1 addition & 0 deletions

pages/readings.mdx renamed to pages/readings.en.mdx

Lines changed: 3 additions & 0 deletions
File renamed without changes.
File renamed without changes.

pages/techniques/fewshot.mdx renamed to pages/techniques/fewshot.en.mdx

Lines changed: 2 additions & 0 deletions

theme.config.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const config: DocsThemeConfig = {
1515
</span>
1616
</>
1717
),
18+
i18n: [
19+
{ locale: 'en', text: 'English' },
20+
{ locale: 'zh', text: '中文' }
21+
],
1822
head: function UseHead() {
1923
const { title } = useConfig()
2024
return (

0 commit comments

Comments
 (0)