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

docs: include French #11361

Merged
merged 7 commits into from Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -116,6 +116,7 @@
- `[website]` Replace 'Github' with 'GitHub' ([#11279](https://github.com/facebook/jest/pull/11279))
- `[website]` Remove a language code from the link to the Node.js website ([#11282](https://github.com/facebook/jest/pull/11282))
- `[website]` Remove a duplicated word ([#11281](https://github.com/facebook/jest/pull/11281))
- `[website]` Add french to website ([#11361](https://github.com/facebook/jest/pull/11361))

### Performance

Expand Down
1 change: 1 addition & 0 deletions crowdin.yaml
Expand Up @@ -12,6 +12,7 @@ preserve_hierarchy: true
languages_mapping: &languages_mapping
locale:
'es-ES': 'es-ES'
'fr': 'fr'
'ja': 'ja'
'pt-BR': 'pt-BR'
'ro': 'ro'
Expand Down
5 changes: 4 additions & 1 deletion website/i18n.js
Expand Up @@ -7,7 +7,7 @@

// The top-30 locales on Crowdin are enabled
// but we enable only a subset of those
const locales = ['en', 'ja', 'es-ES', 'pt-BR', 'ro', 'ru', 'uk', 'zh-Hans'];
const locales = ['en', 'ja', 'es-ES', 'fr', 'pt-BR', 'ro', 'ru', 'uk', 'zh-Hans'];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the error for Typescript. Why is only 'fr' affected, should it be the case for the others too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not typescript, it's eslint since the line is too long

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just run prettier on the file and it should be happy 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn prettier website/i18n.js --write should do the trick, not sure how you got double quotes 🙈


const localeConfigs = {
en: {
Expand All @@ -19,6 +19,9 @@ const localeConfigs = {
'es-ES': {
label: 'Español',
},
'fr': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add it to the locales array above

BTW it's now not-required to provide a local config, as Docusaurus provide default localized labels for each locale automatically

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops ! i fix it !

label: 'Français',
},
'pt-BR': {
label: 'Português (Brasil)',
},
Expand Down
2 changes: 2 additions & 0 deletions website/static/_redirects
Expand Up @@ -10,6 +10,7 @@
/docs/en/* /docs/:splat
/docs/ja/* /ja/docs/:splat
/docs/es-ES/* /es-ES/docs/:splat
/docs/fr/* /fr/docs/:splat
/docs/pt-BR/* /pt-BR/docs/:splat
/docs/ro/* /ro/docs/:splat
/docs/ru/* /ru/docs/:splat
Expand All @@ -22,6 +23,7 @@

/ja/* /ja/404.html 404
/es-ES/* /es-ES/404.html 404
/fr/* /fr/404.html 404
/pt-BR/* /pt-BR/404.html 404
/ro/* /ro/404.html 404
/ru/* /ru/404.html 404
Expand Down