Skip to content

Commit

Permalink
docs: setup crowdin (Yoctol#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin authored Mar 18, 2020
1 parent d522624 commit d0d8fb5
Show file tree
Hide file tree
Showing 6 changed files with 950 additions and 775 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ node_modules/

# Mac OS
.DS_Store

# Docusaurus i18n
website/i18n/*
website/translated_docs
18 changes: 18 additions & 0 deletions crowdin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
project_identifier_env: CROWDIN_BOTTENDER_PROJECT_ID
api_key_env: CROWDIN_BOTTENDER_API_KEY
base_path: './'
preserve_hierarchy: true

files:
- source: '/docs/**/*.md'
translation: '/website/translated_docs/%locale%/**/%original_file_name%'
languages_mapping: &anchor
locale:
'ja': 'ja'
'zh-TW': 'zh-TW'
- source: '/website/versioned_docs/**/*.md'
translation: '/website/translated_docs/%locale%/**/%original_file_name%'
languages_mapping: *anchor
- source: '/website/i18n/en.json'
translation: '/website/i18n/%locale%.json'
languages_mapping: *anchor
19 changes: 19 additions & 0 deletions website/languages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const languages = [
{
enabled: true,
name: 'English',
tag: 'en',
},
{
enabled: false,
name: '日本語',
tag: 'ja',
},
{
enabled: true,
name: '繁體中文',
tag: 'zh-TW',
},
];

module.exports = languages;
4 changes: 3 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"scripts": {
"build": "docusaurus-build",
"crowdin-download": "crowdin --config ../crowdin.yaml download -b master",
"crowdin-upload": "crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"examples": "docusaurus-examples",
"publish-gh-pages": "docusaurus-publish",
"rename-version": "docusaurus-rename-version",
Expand All @@ -9,6 +11,6 @@
"write-translations": "docusaurus-write-translations"
},
"devDependencies": {
"docusaurus": "^1.13.0"
"docusaurus": "^1.14.4"
}
}
2 changes: 2 additions & 0 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ const siteConfig = {
facetFilters: ['language:LANGUAGE', 'version:VERSION'],
},
},

translationRecruitingLink: 'https://crowdin.com/project/bottender',
};

module.exports = siteConfig;
Loading

0 comments on commit d0d8fb5

Please sign in to comment.