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

Grammalecte install guide, improve and fix contributing guide #219

Merged
merged 4 commits into from
Dec 16, 2023
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
1 change: 1 addition & 0 deletions .remarkignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CONTRIBUTING.md
CONTRIBUTING_GRAMMALECTE.md
README.md
MAINTAINERS.md
tmp
Expand Down
21 changes: 13 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Please note that no attempt is made to translate content for older versions of t
If it's your first contribution, fork this repository from GitHub interface, then on your machine:
```
git clone <your fork's url>
git remote add upstream https://github.com/ember-learn/guides-source.git
git remote add upstream https://github.com/DazzlingFugu/ember-fr-guides-source.git
```

As you tackle new issues, you'll want to be sure that you always start by working on the most recent code. The second command sets an upstream. By pulling from it, you can sync up your fork's `master` branch with its upstream repository's `master` branch. For this to work, make sure you're always committing to a different branch, not `master`.
Expand All @@ -36,17 +36,22 @@ git switch --create some-branch-name

### 3. Translate and lint the page

Here is the journey to submit a PR:
1. Translate the `.md` page of your choice.
2. Once the file is in French, add the path of the page to the `.remarkignore` file (in alphabetical order)
3. Run `npm run lint`

The command `npm run lint` runs the tools that will spellcheck your page. If all files are green and the command ends without error, you are good! If there are warnings, you need to fix them. The three most common errors are a misspelled French word, a commonly used English term that you haven't translated on purpose, and a word repeated twice.

If there are errors because you kept an English term commonly used in French, add this word to the `.local.dic` file (in alphabetical order, lowercase words are below uppercase acronyms).

If there are errors such as "a word is repeated twice" but it's expected in French (“Je vais vous "faire faire" une jolie traduction”), make sure to fix all the other errors of the same paragraph before adding `<!-- spell ignore -->` above the paragraph.

Each PR should have:
- **1 commit** (keep the commit stack clean with one commit, and make the message clear enough to identify the issue number or the file at first glance)
- **2~3 files changed** (`[some-page].md`, `.remarkignore`, optionally `.local.dic`)

Once you have translated the `.md` page of your choice, you need to run the linter to make sure there's no typo:
- Add the path to your page in `.remarkignore` (respect the alphabetical order for readability)
- Run `npm run lint`

If there are errors such as "a word is written twice" but it's expected in French (“Je vais vous "faire faire" une jolie traduction”), make sure to fix all the other errors of the same paragraph before adding `<!-- spell ignore -->` above the paragraph.

If there are errors because you kept an English term commonly used in French, add this word to the `.local.dic` file (respect the alphabetical order for readability, lowercase words are below uppercase acronyms).
**Grammalecte**: if you use Visual Studio Code, you can improve the spellchecking tools that will assist you in writing a perfect file in French. Check out how to [install Grammalecte plugin in Visual Studio Code](./CONTRIBUTING_GRAMMALECTE.md).

### 4. Label your PR

Expand Down
21 changes: 21 additions & 0 deletions CONTRIBUTING_GRAMMALECTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Installing Grammalecte in Visual Studio Code

## Motivation

This project has a linter which can be run with `npm run lint`. This linter consists of a series of [Unified](https://unifiedjs.com/) plugins that spellcheck the files in French, and it relies on a French dictionary. It essentially checks words exist, among other little things. It's not able to evaluate the grammar like an actual spellchecker. In other words, just because you run `npm run lint` doesn't mean your grammar and conjugation are correct.

To answer this problem, the current recommendation is to add an actual spellcheck plugin to your code editor. If you use Visual Studio Code, then you can use Grammalecte.

## Download Grammalecte

Visit https://grammalecte.net/#download and select "CLI & Serveur". Once the zip file is downloaded, decompress it and move it wherever you want on your system. Take good note of the path you choose, you'll need it to configure the plugin in the next step.

## Add the plugin to Visual Studio Code

Open Visual Studio Code and open the "Extensions" panel. In the search bar, type in "grammalecte", you should find this plugin: https://marketplace.visualstudio.com/items?itemName=jenselme.grammalecte .

Install the plugin and read carefully the instructions. First, it requires Python3. Then it explains how to let Visual Studio Code know where to find the Grammalecte script.

Access the plugin settings by clicking the cog icon next to the uninstall button. In the input "Path To Grammalecte Cli", indicate the path you choose for the Grammalecte folder and point to `grammalecte-cli.py`, as required by the installation instructions. Eventually, have a look at the other options to see what you wish to activate.

By default, `.md` extension is already present in the list of extensions that Grammalecte can run, so you are good to go! If you have configured everything correctly, you should see Grammalecte underlining things in the documentation files. Don't consider every syntax detail, Grammalecte is not familiar with markdown specifics. Focus on French grammar and conjugation.
66 changes: 0 additions & 66 deletions LISEZMOI.md

This file was deleted.

Loading