Skip to content

Commit

Permalink
chore: move translations from crowdin to repo (#91)
Browse files Browse the repository at this point in the history
* chore: move translations from crowdin to repo

1. move translations to i18n folder.
2. modify the `editUrl` in `docusaurus.config.js`.
3. modify GitHub Action.
4. modify the netlify preview build configuration to build all langs.

* fix: wrong editUrl in docusaurus config
  • Loading branch information
Selflocking committed Jun 10, 2023
1 parent 5448687 commit 24b333b
Show file tree
Hide file tree
Showing 130 changed files with 9,247 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install and Build 🔧
run: |
yarn install
yarn crowdin:sync
# yarn crowdin:sync
yarn build
- name: Build PDF prerequisites 🔨
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pr_ci.yml
Expand Up @@ -19,6 +19,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Init Website
run: |
yarn install && yarn build --locale en
- name: Install dependencies
run: yarn install

- name: Build Website
run: yarn install
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -3,7 +3,6 @@

# Production
/build
/i18n

# Generated files
.docusaurus
Expand Down
12 changes: 4 additions & 8 deletions docusaurus.config.js
Expand Up @@ -216,11 +216,9 @@ var _hmt = _hmt || [];
editUrl: ({locale, docPath}) => {
if (locale === "en") {
return `https://github.com/casnode/casnode-website/edit/master/docs/${docPath}`;
} else {
return `https://github.com/casnode/casnode-website/edit/master/i18n/${locale}/docusaurus-plugin-content-docs/current/${docPath}`;
}
if (locale === "zh") {
return "https://crowdin.com/project/casnode-website/zh-CN";
}
return `https://crowdin.com/project/casnode-website/${locale}`;
},
},
blog: {
Expand All @@ -229,11 +227,9 @@ var _hmt = _hmt || [];
editUrl: ({locale, blogDirPath, blogPath}) => {
if (locale === "en") {
return `https://github.com/casnode/casnode-website/edit/master/${blogDirPath}/${blogPath}`;
} else {
return `https://github.com/casnode/casnode-website/edit/master/i18n/${locale}/docusaurus-plugin-content-blog/${blogPath}`;
}
if (locale === "zh") {
return "https://crowdin.com/project/casnode-website/zh-CN";
}
return `https://crowdin.com/project/casnode-website/${locale}`;
},
},
theme: {
Expand Down

0 comments on commit 24b333b

Please sign in to comment.