Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(v1): upgrade v1 Crowdin cli + CI config #4040

Merged
merged 6 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ jobs:
if ! git diff-tree --no-commit-id --name-only -r HEAD | grep -E "(^docs\/.*)|(docusaurus-1\.x\/.*)|(website-1\.x\/.*)"; then
echo "Skipping deploy. No relevant v1 website files have changed"
elif [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then
echo "Deploying website..."
echo "Deploying website v1..."
cd website-1.x

# install Docusaurus and generate file of English strings
cd website-1.x && yarn run write-translations
# install Crowdin
sudo apt-get update
sudo apt-get install default-jre rsync
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
sleep 5
yarn run write-translations

# upload translation strings and download translations
yarn run crowdin-upload
yarn crowdin-upload

# download only enabled languages
for lang in fr ko ru ro pt-BR zh-CN
do
yarn crowdin-download -l $lang
done
yarn crowdin-download
# for lang in fr ko ru ro pt-BR zh-CN
# do
# yarn crowdin-download -l $lang
# done

# publish
GIT_USER=docusaurus-bot USE_SSH=false yarn run publish-gh-pages
else
Expand All @@ -119,4 +119,4 @@ workflows:
- deploy-website:
requires:
- tests
filters: *filter-only-master
filters: *filter-only-master
23 changes: 3 additions & 20 deletions crowdin.yaml → crowdin-v1.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project_identifier_env: CROWDIN_DOCUSAURUS_PROJECT_ID
api_key_env: CROWDIN_DOCUSAURUS_API_KEY
base_path: "./"
project_id: '290988'
api_token_env: 'CROWDIN_PERSONAL_TOKEN'
base_path: "."
preserve_hierarchy: true

files:
Expand All @@ -9,30 +9,13 @@ files:
translation: '/website-1.x/translated_docs/%locale%/**/%original_file_name%'
languages_mapping: &anchor
locale:
'af': 'af'
'ar': 'ar'
'bs-BA': 'bs-BA'
'ca': 'ca'
'cs': 'cs'
'da': 'da'
'de': 'de'
'el': 'el'
'es-ES': 'es-ES'
'fa': 'fa-IR'
'fi': 'fi'
'fr': 'fr'
'he': 'he'
'hu': 'hu'
'id': 'id-ID'
'it': 'it'
'ja': 'ja'
'ko': 'ko'
'mr': 'mr-IN'
'nl': 'nl'
'no': 'no-NO'
'pl': 'pl'
'pt-BR': 'pt-BR'
'pt-PT': 'pt-PT'
'ro': 'ro'
'ru': 'ru'
'sk': 'sk-SK'
Expand Down
10 changes: 10 additions & 0 deletions website-1.x/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# Note: this file's config override the Netlify UI admin config

[build]
base = "/"
command = "yarn workspace docusaurus-1-website netlify:build"
publish = "website-1.x/build/docusaurus"

[context.production]
command = "yarn workspace docusaurus-1-website netlify:build:production"
6 changes: 4 additions & 2 deletions website-1.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"write-translations": "docusaurus-write-translations",
"docusaurus-version": "docusaurus-version",
"rename-version": "docusaurus-rename-version",
"crowdin-upload": "crowdin --config ../crowdin.yaml upload sources --auto-update -b master",
"crowdin-download": "crowdin --config ../crowdin.yaml download -b master"
"crowdin-upload": "cd .. && crowdin upload sources --auto-update -b master --config crowdin-v1.yml",
"crowdin-download": "cd .. && crowdin download -b master --config crowdin-v1.yml",
"netlify:build": "yarn build",
"netlify:build:production": "yarn crowdin download && yarn build"
},
"dependencies": {
"docusaurus": "2.0.0-alpha.70"
Expand Down