chore(i18n,docs): update translations (#43567)

This commit is contained in:
camperbot
2021-09-27 10:50:01 -07:00
committed by GitHub
parent eac0a395a1
commit af4ead336a
15 changed files with 361 additions and 90 deletions

View File

@@ -1,7 +1,7 @@
- **Getting Started**
- [Introduction](index.md "Contribute to the freeCodeCamp.org Community")
- [Frequently Asked Questions](FAQ.md)
- **Code Contribution**
- **はじめに**
- [イントロダクション](index.md "freeCodeCamp.org コミュニティに貢献する")
- [よくある質問](FAQ.md)
- **コードのコントリビューション**
- [Set up freeCodeCamp locally](how-to-setup-freecodecamp-locally.md)
- [Codebase best practices](codebase-best-practices.md)
- [Open a pull request](how-to-open-a-pull-request.md)
@@ -10,9 +10,9 @@
- [Work on the news theme](how-to-work-on-the-news-theme.md)
- [Work on the docs theme](how-to-work-on-the-docs-theme.md)
- [Work on practice projects](how-to-work-on-practice-projects.md)
- **Translation Contribution**
- [Work on translating resources](how-to-translate-files.md)
- [Work on proofreading translations](how-to-proofread-files.md)
- **翻訳のコントリビューション**
- [リソースを翻訳する](how-to-translate-files.md)
- [翻訳を校正する](how-to-proofread-files.md)
- **Optional Guides**
- [Set up freeCodeCamp on Windows (WSL)](how-to-setup-wsl.md)
- [Add Cypress tests](how-to-add-cypress-tests.md)

View File

@@ -126,6 +126,60 @@ CLIENT_LOCALE="dothraki"
CURRICULUM_LOCALE="dothraki"
```
## Enabling Localized Videos
For the video challenges, you need to change a few things. First add the new locale to the GraphQL query in the `client/src/templates/Challenges/video/Show.tsx` file. For example, adding Dothraki to the query:
```tsx
query VideoChallenge($slug: String!) {
challengeNode(fields: { slug: { eq: $slug } }) {
videoId
videoLocaleIds {
espanol
italian
portuguese
dothraki
}
...
```
Then add an id for the new language to any video challenge in an audited block. For example, if `auditedCerts` in `all-langs.js` includes `scientific-computing-with-python` for `dothraki`, then you must add a `dothraki` entry in `videoLocaleIds`. The frontmatter should then look like this:
```yml
videoLocaleIds:
espanol: 3muQV-Im3Z0
italian: hiRTRAqNlpE
portuguese: AelGAcoMXbI
dothraki: new-id-here
dashedName: introduction-why-program
---
```
Update the `VideoLocaleIds` interface in `client/src/redux/prop-types` to include the new language.
```ts
export interface VideoLocaleIds {
espanol?: string;
italian?: string;
portuguese?: string;
dothraki?: string;
}
```
And finally update the challenge schema in `curriculum/schema/challengeSchema.js`.
```js
videoLocaleIds: Joi.when('challengeType', {
is: challengeTypes.video,
then: Joi.object().keys({
espanol: Joi.string(),
italian: Joi.string(),
portuguese: Joi.string(),
dothraki: Joi.string()
})
}),
```
## Loading Translations
Because the language has not been approved for production, our scripts are not automatically downloading the translations yet. Only staff have the access to directly download the translations - you are welcome to reach out to us in our [contributors chat room](https://chat.freecodecamp.org/channel/contributors), or you can translate the English markdown files locally for testing purposes.