You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Host translations in gitbook, using monorepo approach (#578)
* Remove the main gitbook yaml file. Need to be sure that config is picked up from subfolders.
* Change config of the en book
* Change config of the ja book
* Change config of the zh book
* Generate the TOCs for all books in a GHA matrix build
* Change commit messsage in book.yaml workflow run to make clear which file was changed and why
* Improve documentation
Copy file name to clipboardExpand all lines: book/README.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,9 @@ We use the [gitbook.com](https://www.gitbook.com) service to host our book.
20
20
21
21
The `/book` folder contains generator scripts and extra content required to create the gitbook.
22
22
23
-
-`.github/workflows/book.yml` - A GitHub Action that triggers scripts to generate the book.
24
-
-`/book/scripts/generate_toc.rb` - Generates the table of contents (ToC) for the book. It takes patterns of maturity **Structured** and **Validated**, extracts title and patlet, and injects this info into `/book/en/toc_template.md`. The output is written to `/book/en/toc.md`. The ToC is what you see on the left-hand-side menu in the gitbook.
25
-
-`/book/en/.gitbook.yaml` - Holds basic configuration for the gitbook service. This file is copied to the root of the repo, if the English book is generated.
23
+
-`.github/workflows/book.yml` - A GitHub Action that triggers `generate_toc.rb`.
24
+
-`/book/scripts/generate_toc.rb` - Generates the table of contents (ToC) for the book. It takes patterns of maturity **Structured** and **Validated**, extracts title and patlet, and injects this info into `/book/en/toc_template.md`. The output is written to `/book/en/toc.md`. The ToC is what you see in the menu on the left in the gitbook.
25
+
-`/book/en/.gitbook.yaml` - Holds basic configuration for the gitbook service.
26
26
-`/book/en/introduction.md` - The introduction to our book. This is what the reader sees first when they open the book. *Note:* The current content is based on [README.md](../README.md).
27
27
-`/book/en/contribute.md` - Explains how to contribute to this book.
28
28
-`/book/en/explore-patterns.md` - Shows the mind map of all patterns. Allows readers to link to the mind map directly.
@@ -42,10 +42,13 @@ For more on the translation process see [these translation instructions](../tran
42
42
43
43
The book is generated in multiple languages.
44
44
45
-
Depending on which **branch** a change is merged into, a different book is generated:
45
+
gitbook takes care of the markdown to HTML rendering for us.
46
+
To do so, we need to provide a full list of all patterns that should be dipslayed in the book.
46
47
47
-
* changes merged to `main` branch: triggers the book generation for the **English** book.
48
-
* changes merged to `book-<YOUR_LANGUAGE>`[^1] branch: triggers the book generation for the book in the given language e.g. `book-jp` for the **Japanese** book.
48
+
As the list of patterns grows over time, we generate the list automatically using `/book/scripts/generate_toc.rb`.
49
+
The script is triggered by the [.github/workflows/book.yml](https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/.github/workflows/book.yml) workflow, which contains a hard-coded list of all languages for which we need to generate `toc.md` files.
50
+
51
+
If a new language is added, you need to modify [this line](https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/monorepo-test/.github/workflows/book.yml#L17) in `.github/workflows/book.yml` and add the 2-letter language code of the language that you are adding.
Copy file name to clipboardExpand all lines: translation/README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,20 +22,20 @@ Please note that this document contains recommendations, aimed at removing barri
22
22
- Please make your changes to the respective `.md` file.
23
23
- Once you are ready, send us a Pull Request.
24
24
25
-
### Translating a new InnerSource Patterns
25
+
### Adding a new InnerSource Pattern to an Existing Translation
26
26
27
27
- Copy the pattern that you want to translate from `/patterns/2-structured/<file>.md` to `/translation/<YOUR_LANGUAGE>/patterns/<file>.md`.[^1] Make sure to keep the file name the same.
28
28
- Then start your translation in that new file.
29
29
- Once you are ready, send us a Pull Request.
30
30
31
-
### Starting the Translation of a New Language
31
+
### Starting the Translation of an Entirely New Language
32
32
33
33
That is awesome! We welcome your passion. When implementing InnerSource practices in your region, there can be language barriers. There is great value in getting people in your organization to understand InnerSource in their own language.
34
34
35
35
Before starting a new translation please talk to us in Slack (in the `#innersource-patterns` channel). Alternatively open an issue on this GitHub repo to start an async conversation about your translation project.
36
36
37
-
The translation should begin by creating a `book-<YOUR_LANGUAGE>` branch to work on.[^1]
38
-
e.g. `book-jp` is used for the Japanese translation.
37
+
The translation should begin by creating a new `translation-<YOUR_LANGUAGE>` branch to work on.[^1]
38
+
e.g. `translation-de` would be used for the German translation.
39
39
40
40
There are a few things you should prepare before starting a translation project.
41
41
@@ -56,7 +56,8 @@ In particular, for special terms, such as "Trusted Committer", please review not
56
56
The patterns books is published in multiple languages, including English, Japanese and Chinese (as of August/2023).
57
57
Find the full list of available languages in the [patterns books](https://patterns.innersourcecommons.org/).
58
58
59
-
Trusted Committers in this repository will also be onboarded during the translation process.
59
+
When publishing an entirely new language to our book, we also like to add at least one of the translators as a Trusted Committer to the project.
60
+
They will then get notified on any fixes/additions to the translation in the future, and can greatly help us by providing reviews.
60
61
61
62
When you complete a translation under `/translation/<YOUR_LANGUAGE>/`, a GitHub Actions pipeline will run to generate the output for publication in the gitbook. The process is described in detail in [/book/README.md](/book/README.md).
0 commit comments