diff --git a/docs/images/crowdin/pre-translate1.png b/docs/images/crowdin/pre-translate1.png new file mode 100644 index 00000000000..6cd5fbf1ce1 Binary files /dev/null and b/docs/images/crowdin/pre-translate1.png differ diff --git a/docs/images/crowdin/pre-translate2.png b/docs/images/crowdin/pre-translate2.png new file mode 100644 index 00000000000..a23d4daec2a Binary files /dev/null and b/docs/images/crowdin/pre-translate2.png differ diff --git a/docs/images/crowdin/pre-translate3.png b/docs/images/crowdin/pre-translate3.png new file mode 100644 index 00000000000..f0daa4e66f4 Binary files /dev/null and b/docs/images/crowdin/pre-translate3.png differ diff --git a/docs/language-lead-handbook.md b/docs/language-lead-handbook.md index 176872f069d..e0dc0473081 100644 --- a/docs/language-lead-handbook.md +++ b/docs/language-lead-handbook.md @@ -26,6 +26,152 @@ The original author and the original article are linked automatically adding thi With `link` being the link of the original article. +## How to update trending articles + +> ![TIP] +> Changing the articles in the footer at least once a month means giving a boost to the linked articles on google results. + +There two places in which to change the trending articles. + +- [The curriculum repository](https://github.com/freeCodeCamp/freeCodeCamp/) +- [The CDN repository](https://github.com/freeCodeCamp/cdn) + +For each article you will need to create a shorter title to use in the footer. + +### Change trending articles in the curriculum + +The trending articles in the curriculum footer can be changed by editing the file at `client/i18n/locales//trending.json`. + +This file is a `*.json` file that has the shape of an object with property keys in the shape `article0title` and `article0link`. + +Each number rapresents one of the 30 articles in the footer. Make sure to match the title and the link correctly. + +This is an example of how part of the `trending.json` file has to look. + +```json +{ + "article0title": "Unire CSV con Python", + "article0link": "https://www.freecodecamp.org/italian/news/come-combinare-file-multipli-in-formato-csv-con-8-righe-di-codice/", + "article1title": "Il comando Git push", + "article1link": "https://www.freecodecamp.org/italian/news/il-comando-git-push-spiegato/", + "article2title": "Centrare immagini in CSS", + "article2link": "https://www.freecodecamp.org/italian/news/come-centrare-un-immagine-usando/", + "article3title": "I codici Alt", + "article3link": "https://www.freecodecamp.org/italian/news/codici-alt/", + "article4title": "Tenere a bada il footer", + "article4link": "https://www.freecodecamp.org/italian/news/come-mantenere-il-footer-al-suo-posto/", + "article5title": "Cosa è un'API?", + "article5link": "https://www.freecodecamp.org/italian/news/cose-un-api-in-italiano-per-favore/", + ... +} +``` + +You will want to [build the translated client locally](how-to-test-translations-locally.md) to see if the titles have the right length. Each title must stay on a single line and not go to a new line. + +### How to update the trending articles in the cdn + +The file in the cdn repository is the file `universal/trending/.yaml`. + +This file is shaped differently, for example here the file content for the first 6 articles: + +```yaml +article0title: 'Unire CSV con Python' +article0link: 'https://www.freecodecamp.org/italian/news/come-combinare-file-multipli-in-formato-csv-con-8-righe-di-codice/' +article1title: 'Il comando Git push' +article1link: 'https://www.freecodecamp.org/italian/news/il-comando-git-push-spiegato/' +article2title: 'Centrare immagini in CSS' +article2link: 'https://www.freecodecamp.org/italian/news/come-centrare-un-immagine-usando/' +article3title: 'I codici Alt' +article3link: 'https://www.freecodecamp.org/italian/news/codici-alt/' +article4title: 'Tenere a bada il footer' +article4link: 'https://www.freecodecamp.org/italian/news/come-mantenere-il-footer-al-suo-posto/' +article5title: 'Cosa è API?' +article5link: 'https://www.freecodecamp.org/italian/news/cose-un-api-in-italiano-per-favore/' +``` + +You can convert from one format to the other carefully changing it manually. Or you can use [the script in this repl](https://replit.com/@Ieahleen/convert-json-to-yaml). + +> [!TIP] +> A new workflow is being worked on, there will be only one place to change in the future. + +## How to translate the motivational quotes + +The motivational quotes can be found in the [curriculum repository](https://github.com/freeCodeCamp/freeCodeCamp/) in the `/client/i18n/locales//motivation.json` file. + +This file has a general structure of: + +```json +{ + "compliments": [], + "motivationalQuotes": [] +} +``` + +The compliments are the short sentences that appear at the completion of a challenge. + +You don't need to directly translate the sentences used in English, you can write a set of short sentences that are appropriate to show at the completion of a challenge. + +The `compliments` array is an array of strings, so for example you would write: + +```json +{ + "compliments": ["A tutta birra!", "Pikachu, scelgo te!"], + "motivationalQuotes": [] +} +``` + +> ![TIP] +> You should start with at least a dozen compliments to have some variety when users complete challenges. + +The motivational quotes are the quotes that appear at https://freecodecamp.org/learn. + +The `motivationalQuotes` array is an array of objects, these objects should include a `quote` property and an `author` property. like this: + +```json +{ + "compliments": [], + "motivationalQuotes": [ + { + "quote": "Se i costruttori costruissero come i programmatori programmano, il primo picchio che passa potrebbe distruggere la civiltà.", + "author": "Artur Bloch, Seconda legge di Weinberg" + }, + { + "quote": "I bravi programmatori sanno cosa scrivere. I migliori sanno cosa riscrivere.", + "author": "Eric Steven Raymond" + } + ] +} +``` + +> [!TIP] +> You should start with at least a dozen quotes, to have some variety. A new quote is shown every time the user reload the page. + +## Pre-Translate Workflow on Crowdin + +The Pre-Translate workflow can be used to apply translations from the Translation Memory to strings. + +> [!TIP] +> Really useful to restore a lot of translations from the Translation Memory in bulk when a lot of files have been updated. + +You can find the Pre-Translation workflow at the top of the page in the console of a project. +If you see "Go to console" in the upper right corner, click there first. + +![go to console button](./images/crowdin/pre-translate2.png) + +![pre-translate workflow](./images/crowdin/pre-translate1.png) + +You can choose "From Machine Translation" or "From Translation Memory". Choose "Translation Memory" to recover translations from memory. + +Then there are three steps to complete: + +1. Files. Choose which files to translate, you can do all the project, or specific folders or files. +2. Languages. Set your language here. +3. Existing Translations. The best combination here is "100% match" and "Apply to untranslated strings only". Do not approve automatically, as it's always best to have a human eye on things. + +![pre-translate existing translations](./images/crowdin/pre-translate3.png) + +When you have finished settngs this, press the Pre-Translate button, and wait. It will alert you once it has finished. It will take more or less time depending on how many untranslated strings are present in the files you have choosen. + ## How to update Crowdin Glossary > [!TIP]