Skip to content

Commit

Permalink
Add Localization Support for Jest Website (jestjs#3416)
Browse files Browse the repository at this point in the history
* Adds a link to CrowdIn project from language drop down

* Adds comments to generated files

* Modify Circle CI to manually download crowdin cli

* Doc build process only renders pages that are enabled in languages.js

* Added a favicon.ico

* Merging TutorialAsync.md

Adding Bosnian, enabling Espanol

Using ENV variables
  • Loading branch information
ericnakagawa authored and cpojer committed May 2, 2017
1 parent 909da52 commit 62d29f2
Show file tree
Hide file tree
Showing 65 changed files with 1,765 additions and 424 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ types/**
website/build
website/node_modules
website/core/metadata*.js
website/i18n/*.js
website/src/jest/docs
website/src/jest/blog
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
*~
/danger/node_modules/
/examples/*/node_modules/

/integration_tests/*/node_modules
/integration_tests/transform/*/coverage
/integration_tests/transform/*/node_modules

/node_modules

/packages/*/build/
/packages/*/coverage/
/packages/*/node_modules/
Expand All @@ -17,6 +20,47 @@
/website/src/jest/blog
/website/src/jest/docs
/website/yarn.lock

/website/i18n/*
!/website/i18n/en.json

/website/af
/website/ar
/website/ca
/website/cs
/website/da
/website/de
/website/el
/website/es-ES
/website/fa-IR
/website/fi
/website/fr
/website/he
/website/hu
/website/id-ID
/website/it
/website/ja
/website/ko
/website/mr-IN
/website/nl
/website/no-NO
/website/pl
/website/pt-BR
/website/pt-PT
/website/ro
/website/ru
/website/sk-SK
/website/sr
/website/sv-SE
/website/tr
/website/uk
/website/vi
/website/zh-Hans
/website/zh-Hant

/docs/*
!/docs/en

coverage
lerna-debug.log
npm-debug.log
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ test('adds 1 + 2 to equal 3', () => {
Add the following section to your `package.json`:

```json
"scripts": {
"test": "jest"
{
"scripts": {
"test": "jest"
}
}
```

Expand Down
7 changes: 7 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,11 @@ deployment:
- git config --global user.email "jest-bot@users.noreply.github.com"
- git config --global user.name "Website Deployment Script"
- echo "machine github.com login jest-bot password $GITHUB_TOKEN" > ~/.netrc
# WEBSITE DEPLOY
- sudo apt-get install default-jre
- wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
- sudo dpkg -i crowdin.deb
# crowdin install end
- crowdin --config crowdin.yaml upload sources --auto-update -b master
- crowdin --config crowdin.yaml download -b master
- cd website && GIT_USER=jest-bot npm run gh-pages
48 changes: 48 additions & 0 deletions crowdin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
project_identifier_env: CROWDIN_PROJECT_ID
api_key_env: CROWDIN_API_KEY
base_path: "./"

files:
-
source: '/docs/en/*.md'
translation: '/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'
'sr': 'sr'
'sv-SE': 'sv-SE'
'tr': 'tr'
'uk': 'uk'
'vi': 'vi'
'zh-CN': 'zh-Hans'
'zh-TW': 'zh-Hant'
-
source: '/website/i18n/en.json'
translation: '/website/i18n/%locale%.json'
languages_mapping: *anchor
4 changes: 2 additions & 2 deletions docs/CLI.md → docs/en/CLI.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: cli
title: Jest CLI Options
layout: reference
layout: docs
category: API Reference
permalink: docs/cli.html
permalink: docs/en/cli.html
previous: configuration
---

Expand Down
4 changes: 2 additions & 2 deletions docs/Configuration.md → docs/en/Configuration.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: configuration
title: Configuring package.json
layout: reference
layout: docs
category: API Reference
permalink: docs/configuration.html
permalink: docs/en/configuration.html
previous: jest-object
next: cli
---
Expand Down
4 changes: 2 additions & 2 deletions docs/ExpectAPI.md → docs/en/ExpectAPI.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: expect
title: Expect
layout: reference
layout: docs
category: API Reference
permalink: docs/expect.html
permalink: docs/en/expect.html
previous: api
next: mock-function-api
---
Expand Down
2 changes: 1 addition & 1 deletion docs/GettingStarted.md → docs/en/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: getting-started
title: Getting Started
layout: docs
category: Introduction
permalink: docs/getting-started.html
permalink: docs/en/getting-started.html
next: using-matchers
---

Expand Down
4 changes: 2 additions & 2 deletions docs/GlobalAPI.md → docs/en/GlobalAPI.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: api
title: Globals
layout: reference
layout: docs
category: API Reference
permalink: docs/api.html
permalink: docs/en/api.html
next: expect
---

Expand Down
4 changes: 2 additions & 2 deletions docs/JestObjectAPI.md → docs/en/JestObjectAPI.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: jest-object
title: The Jest Object
layout: reference
layout: docs
category: API Reference
permalink: docs/jest-object.html
permalink: docs/en/jest-object.html
previous: mock-function-api
next: configuration
---
Expand Down
2 changes: 1 addition & 1 deletion docs/ManualMocks.md → docs/en/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: manual-mocks
title: Manual Mocks
layout: docs
category: Guides
permalink: docs/manual-mocks.html
permalink: docs/en/manual-mocks.html
previous: timer-mocks
next: webpack
---
Expand Down
4 changes: 2 additions & 2 deletions docs/MigrationGuide.md → docs/en/MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: migration-guide
title: Migrating to Jest
layout: docs
category: Guides
permalink: docs/migration-guide.html
permalink: docs/en/migration-guide.html
previous: webpack
next: testing-frameworks
---
Expand All @@ -30,4 +30,4 @@ To transform your existing tests, navigate to the project containing the tests a
jest-codemods
```

More information can be found at https://github.com/skovhus/jest-codemods.
More information can be found at https://github.com/skovhus/jest-codemods.
4 changes: 2 additions & 2 deletions docs/MockFunctionAPI.md → docs/en/MockFunctionAPI.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: mock-function-api
title: Mock Functions
layout: reference
layout: docs
category: API Reference
permalink: docs/mock-function-api.html
permalink: docs/en/mock-function-api.html
previous: expect
next: jest-object
---
Expand Down
2 changes: 1 addition & 1 deletion docs/MockFunctions.md → docs/en/MockFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: mock-functions
title: Mock Functions
layout: docs
category: Introduction
permalink: docs/mock-functions.html
permalink: docs/en/mock-functions.html
previous: setup-teardown
next: more-resources
---
Expand Down
2 changes: 1 addition & 1 deletion docs/MoreResources.md → docs/en/MoreResources.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: more-resources
title: More Resources
layout: docs
category: Introduction
permalink: docs/more-resources.html
permalink: docs/en/more-resources.html
previous: mock-functions
next: snapshot-testing
---
Expand Down
2 changes: 1 addition & 1 deletion docs/SetupAndTeardown.md → docs/en/SetupAndTeardown.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: setup-teardown
title: Setup and Teardown
layout: docs
category: Introduction
permalink: docs/setup-teardown.html
permalink: docs/en/setup-teardown.html
previous: asynchronous
next: mock-functions
---
Expand Down
2 changes: 1 addition & 1 deletion docs/SnapshotTesting.md → docs/en/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: snapshot-testing
title: Snapshot Testing
layout: docs
category: Guides
permalink: docs/snapshot-testing.html
permalink: docs/en/snapshot-testing.html
next: tutorial-react
---

Expand Down
2 changes: 1 addition & 1 deletion docs/TestingAsyncCode.md → docs/en/TestingAsyncCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: asynchronous
title: Testing Asynchronous Code
layout: docs
category: Introduction
permalink: docs/asynchronous.html
permalink: docs/en/asynchronous.html
previous: using-matchers
next: setup-teardown
---
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/TimerMocks.md → docs/en/TimerMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: timer-mocks
title: Timer Mocks
layout: docs
category: Guides
permalink: docs/timer-mocks.html
permalink: docs/en/timer-mocks.html
previous: tutorial-async
next: manual-mocks
---
Expand Down
4 changes: 3 additions & 1 deletion docs/Troubleshooting.md → docs/en/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ id: troubleshooting
title: Troubleshooting
layout: docs
category: Guides
permalink: docs/troubleshooting.html
permalink: docs/en/troubleshooting.html
previous: testing-frameworks
next: api

---

Uh oh, something went wrong? Use this guide to resolve issues with Jest.
Expand Down
2 changes: 1 addition & 1 deletion docs/TutorialAsync.md → docs/en/TutorialAsync.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: tutorial-async
title: An Async Example
layout: docs
category: Guides
permalink: docs/tutorial-async.html
permalink: docs/en/tutorial-async.html
previous: tutorial-react-native
next: timer-mocks
---
Expand Down
2 changes: 1 addition & 1 deletion docs/TutorialReact.md → docs/en/TutorialReact.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: tutorial-react
title: Testing React Apps
layout: docs
category: Guides
permalink: docs/tutorial-react.html
permalink: docs/en/tutorial-react.html
previous: snapshot-testing
next: tutorial-react-native
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: tutorial-react-native
title: Testing React Native Apps
layout: docs
category: Guides
permalink: docs/tutorial-react-native.html
permalink: docs/en/tutorial-react-native.html
previous: tutorial-react
next: tutorial-async
---
Expand Down
2 changes: 1 addition & 1 deletion docs/TutorialWebpack.md → docs/en/TutorialWebpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
id: tutorial-webpack
title: webpack
layout: redirect
permalink: docs/tutorial-webpack.html
permalink: docs/en/tutorial-webpack.html
destinationUrl: webpack.html
---
2 changes: 1 addition & 1 deletion docs/TutorialjQuery.md → docs/en/TutorialjQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: tutorial-jquery
title: DOM Manipulation
layout: docs
category: Guides
permalink: docs/tutorial-jquery.html
permalink: docs/en/tutorial-jquery.html
next: mock-functions
---

Expand Down
2 changes: 1 addition & 1 deletion docs/UsingMatchers.md → docs/en/UsingMatchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: using-matchers
title: Using Matchers
layout: docs
category: Introduction
permalink: docs/using-matchers.html
permalink: docs/en/using-matchers.html
previous: getting-started
next: asynchronous
---
Expand Down
2 changes: 1 addition & 1 deletion docs/Webpack.md → docs/en/Webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: webpack
title: Using with webpack
layout: docs
category: Guides
permalink: docs/webpack.html
permalink: docs/en/webpack.html
previous: manual-mocks
next: migration-guide
---
Expand Down
Loading

0 comments on commit 62d29f2

Please sign in to comment.