Skip to content

Commit 0ebc0bd

Browse files
spierWillemJianghncslwxsunzhh02gzchenyong
authored
Publishing patterns book in Chinese (zh) (#515)
* [translation] Added Chinese translations for all Structured patterns * [scripts] Enable generation of book in Chinese (zh). * [docs] Make documentation of the translation process more generic, to apply to other languages as well (like Chinese). Co-authored-by: Willem Jiang <WillemJiang@users.noreply.github.com> Co-authored-by: Wenxuan Long <hncslwx@users.noreply.github.com> Co-authored-by: Zhenhua Sun <sunzhh02@users.noreply.github.com> Co-authored-by: Yong Chen <gzchenyong@users.noreply.github.com> Co-authored-by: Jerry Tan <tanzhongyi003@users.noreply.github.com> Co-authored-by: Xu An <anzipomelo@users.noreply.github.com> Co-authored-by: spier <spier@users.noreply.github.com>
1 parent 22e6a1b commit 0ebc0bd

36 files changed

+2660
-12
lines changed

.gitbook.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
root : ./
22

33
structure:
4-
readme: book/en/introduction.md
5-
summary: book/en/toc.md
4+
readme: book/zh/introduction.md
5+
summary: book/zh/toc.md

.github/workflows/book.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Determine book language
2525
run: |
26-
[[ "$GITHUB_REF_NAME" =~ ^book-ja.*$ ]] && book_language="ja" || book_language="en"
26+
[[ "$GITHUB_REF_NAME" =~ ^book-.*$ ]] && book_language=${GITHUB_REF_NAME:5:2} || book_language="en"
2727
echo "BOOK_LANGUAGE=$book_language" >> $GITHUB_ENV
2828
2929
- name: Generate ToC

book/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ The `/book` folder contains generator scripts and extra content required to crea
2828
- `/book/en/explore-patterns.md` - Shows the mind map of all patterns. Allows readers to link to the mind map directly.
2929
- patterns content:
3030
- The English patterns are in `/patterns`
31-
- The translated patterns (e.g. for Japanese) are in `/translation/ja`
31+
- The translated patterns are in `/translation/<YOUR_LANGUAGE>`[^1]
3232

3333
The book is generated in multiple languages.
3434

3535
The descriptions above are for the English book. You find the English content in `/book/en`.
3636

37-
For other languages (e.g. for Japanese), the content is mirrored and translated to folders like `/book/ja`.
37+
For other languages the content is mirrored and translated to folders like `/book/<YOUR_LANGUAGE>`[^1].
3838

3939
For more on the translation process see [these translation instructions](../translation/README.md).
4040

@@ -45,7 +45,7 @@ The book is generated in multiple languages.
4545
Depending on which **branch** a change is merged into, a different book is generated:
4646

4747
* changes merged to `main` branch: triggers the book generation for the **English** book.
48-
* changes merged to `book-ja` branch: triggers the book generation for the **Japanese** 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.
4949

5050
## Objectives of the book
5151

@@ -64,3 +64,5 @@ There are a couple of good reasons to publish the InnerSource patterns as a gitb
6464
[InnerSourcePatterns]: https://github.com/InnerSourceCommons/InnerSourcePatterns
6565
[book_production]: https://patterns.innersourcecommons.org
6666
[book_staging]: https://innersourcecommons.gitbook.io/innersource-patterns-staging/
67+
68+
[^1]: Replace `<YOUR_LANGUAGE>` with the [2-letter ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for your language.

book/scripts/generate_toc.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ def generate_patterns_overview(patterns)
7272
puts "Generating ToC for language: #{BOOK_LANGUAGE}"
7373

7474
## Files to be used for the different languages
75-
if (BOOK_LANGUAGE == "ja")
76-
TOC_TEMPLATE_FILE = "../ja/toc_template.md"
77-
TOC_FILE = "../ja/toc.md"
78-
PATTERNS = Dir["../../translation/ja/patterns/*.md"]
79-
else
75+
## Note: the folder structure for the patterns is slightly different for 'en' than it is for the other languages,
76+
## hence this slightly complicated logic here.
77+
if (BOOK_LANGUAGE == "en")
8078
TOC_TEMPLATE_FILE = "../en/toc_template.md"
8179
TOC_FILE = "../en/toc.md"
8280
PATTERNS = Dir["../../patterns/2-structured/*.md","../../patterns/2-structured/project-setup/*.md", "../../patterns/3-validated/*.md"]
81+
else
82+
TOC_TEMPLATE_FILE = "../#{BOOK_LANGUAGE}/toc_template.md"
83+
TOC_FILE = "../#{BOOK_LANGUAGE}/toc.md"
84+
PATTERNS = Dir["../../translation/#{BOOK_LANGUAGE}/patterns/*.md"]
8385
end
8486

8587
# Generate list of patterns and sort them by name

book/zh/.gitbook.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root : ./
2+
3+
structure:
4+
readme: book/zh/introduction.md
5+
summary: book/zh/toc.md

book/zh/contribute.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 为本书做贡献
2+
3+
你想让这本书变得更好?那真是太棒了!
4+
5+
《内源模式》这本书本身就是一个[开源项目][repo],欢迎任何形式的贡献。没有什么是微不足道的!
6+
7+
不管你是想帮助我们修正语法/拼写,改进设计,还是根据你在工作场所的内源经验贡献全新的模式。我们喜欢所有这些(贡献)! :)
8+
9+
如果你以前从未为一个开源项目做出过贡献,请知道内源模式社区是一个由友好的人组成的团体,并且有一个安全的地方可以尝试这些贡献。
10+
11+
## 在你开始之前
12+
13+
内源模式和本书的源代码都保存在GitHub上的一个仓库中。因此,你需要一个GitHub用户账户来对本书进行编辑和提交建议。如果你还没有,请前往[github.com](https://github.com),免费创建一个账户。
14+
15+
## 贡献的不同方式
16+
17+
这里有几种你可以做出贡献的方式。
18+
19+
1. 修复你在本书中发现的拼写、格式或其他小问题
20+
2. 改进现有模式的内容(例如,通过添加一个简短的描述,说明你是如何使用一个模式作为_已知实例的)。
21+
3. 贡献一个新的模式,描述你如何在你的组织中克服内源相关的挑战。
22+
23+
对于上述(1)和(2),你可以简单地点击本书每页顶部的**Edit on GitHub**链接。这将使你直接进入我们GitHub仓库中的相应文件,在那里你可以提出你的修改意见。
24+
25+
对于(3),你需要克隆[内源模式][repo]资源库,并将你建议的模式添加到一个新文件中。当对本书做出这种较大的贡献时,请查看我们的[CONTRIBUTING.md](../../CONTRIBUTING.md)和我们的[贡献者手册](../../meta/contributor-handbook.md)
26+
27+
## 贡献的许可
28+
29+
本资源库的内容以[CC-BY-SA-4.0](../../LICENSE.txt)授权。通过向这个资源库贡献,你授予我们(以及其他所有人)根据该许可使用你的贡献的权利。
30+
31+
[repo]: https://github.com/InnerSourceCommons/InnerSourcePatterns
32+
33+
## 翻译校对
34+
35+
* **2022-12-21** 翻译[姜宁](https://github.com/willemjiang)
36+
* **2022-12-28** 校对[龙文选](https://github.com/hncslwx)

book/zh/explore-patterns.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 探索模式
2+
3+
越来越多的模式是由InnerSource Commons社区贡献给本书的。这真是太棒了!
4+
5+
现在,如何让读者更容易发现那些能在特定情况下帮助他们的模式?
6+
7+
为此,我们提供了这个思维导图。它**根据内源项目的不同阶段对模式进行了分类**,以及在各个阶段可能出现的挑战。
8+
9+
![内源模式的思维导图](../../pattern-categorization/innersource-program-mind-map.png)
10+
11+
## 改进这个思维导图
12+
13+
如果你注意到这个思维导图中的任何问题,请[打开一个问题](https://github.com/InnerSourceCommons/InnerSourcePatterns/issues),描述这个问题以及应该做的修正。
14+
15+
此外,如果你有其他想法来提高这些模式的可发现性,或者想让这个思维导图变得更好,请查看我们的[模式归类](https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/pattern-categorization/README.md)方法的文档,也可以查看如何[为本书做贡献](contribute.md)
16+
17+
## 参考文献
18+
19+
像这样对模式进行分类的想法大致是基于Tim Yao、Bob Hanmer和Padma Sudarsan(2018)在[有关内源模式语言的思考](https://drive.google.com/file/d/13AY8glCOdpLOVuz7cVD6QOB8d2xbHCS1/view)中的描述。具体内容见该幻灯片中的第15张幻灯片。
20+
21+
## 翻译校对
22+
23+
* **2022-12-21** 翻译[姜宁](https://github.com/willemjiang)
24+
* **2022-12-28** 校对[龙文选](https://github.com/hncslwx)
266 KB
Loading

book/zh/introduction.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# 介绍
2+
3+
![内源模式](innersource-patterns-book-cover.jpg)
4+
5+
{% hint style="info" %}
6+
你正在阅读《内源模式》的早期版本,可能仍然会发现破碎的链接、拼写错误或其他错误。
7+
请帮助我们解决这些问题,以便尽可能制作出最好的图书:)。了解如何[为这本书做贡献](contribute.md).
8+
{% endhint %}
9+
10+
欢迎来到**内源模式**
11+
12+
这本书包含了内源的最佳实践,并以特定的格式进行编纂,以便于理解、评估和在你的环境中应用它们。我们称这种格式为**模式**
13+
14+
[InnerSource Commons](http://innersourcecommons.org)多年来收集了这些模式,在本书中发布了最成熟的模式,社区成员对每个模式进行了评审,至少有一个已知的模式使用实例。
15+
16+
在这篇介绍中,我们解释了[内源是什么](#内源是什么)[内源模式是什么](#内源模式是什么),以及[如何在你的组织中使用这些模式](#如何使用这些模式)
17+
18+
如果你已经在你的公司使用内源,并想把你的经验贡献给本书,我们很乐意[欢迎你的贡献](contribute.md)!
19+
20+
## 内源是什么?
21+
22+
我们将内源定义为。
23+
24+
> 在一个组织的范围内使用开源的原则和实践进行软件开发。
25+
26+
内源从开发开源软件中吸取经验教训,并将其应用于企业内部开发软件的方式。由于开发人员已经习惯于在世界级的开源软件上工作,人们强烈希望将这些实践带回防火墙内,并将其应用于公司可能不愿意公开发布的软件。
27+
28+
对于那些主要构建闭源软件的公司来说,内源可以成为一个很好的工具,帮助打破孤岛,鼓励和扩大内部协作,加速新工程师的入职成长,并找到机会将软件贡献给开源世界。
29+
30+
## 内源模式是什么?
31+
32+
模式是一种描述在某一背景下对某一问题的可重复的、经过验证的解决方案的方式。模式遵循一种简单的形式,在实施解决方案的过程中,协助你了解问题的限制,了解你需要平衡的限制条件,以及由此产生的结果--应用解决方案所创造的情况。
33+
34+
模式可以为InnerSource Commons的参与者提供一种简明的信息分享方式,改善内源的实践。模式分为标题、问题陈述、背景、约束和解决方案,作为其主要部分。
35+
36+
* ["什么是模式?"Youtube视频](http://bit.ly/innersource_patterns_videos) - 观看一组2-5分钟的Youtube视频,解释内源模式。
37+
* [模式讨论网络研讨会](https://youtu.be/i-0IVhfRVFU) - 我们在2017-03-16举行了一次网络研讨会,现场讨论一个甜甜圈模式(进入24:30的讨论)。这是对我们所遵循的评审过程的说明。也可参见[2017年6月1日O'Reilly网络研讨会上的内源模式](http://www.oreilly.com/pub/e/3884)
38+
* [模式模板](../../meta/pattern-template.md) --查看一个内源模式的骨架,了解新模式的内容!
39+
* [内源模式介绍(2016年秋季峰会演讲)](https://drive.google.com/open?id=0B7_9iQb93uBQbnlkdHNuUGhpTXc) - *Tim Yao和Padma Sudarsan* (PDF)。详细的模式背景和例子 -- 详细了解为什么以及如何与我们的模式互动。也可参见[内源模式介绍(2017年秋季峰会)](https://drive.google.com/open?id=0B7_9iQb93uBQWmYwMFpyaGh4OFU) *Tim Yao和Bob Hanmer* (PDF)。
40+
41+
## 如何使用这些模式?
42+
43+
模式的使用必须经过深思熟虑。它们不能被不加区分地应用。在大多数情况下,你需要根据你的情况来调整给定的解决方案;但模式中给出的信息,定义了背景(不可移动的约束)和力量(可以改变和相互平衡的约束),应该有助于你应用这些模式。请注意,你还需要确定是否有额外的约束(公司背景和公司力量)适用于你的特定公司/组织,必须添加到模式中(作为一种过滤器)。这些额外的制约因素可能需要额外的解决步骤来应用。
44+
45+
模式的形式对于描述成熟的解决方案是很有用的,但它也可以用于*脑力激荡的新解决方案*,创建哪些尚未建立的模式。这是因为模式的解剖提供了一个以结构化方式思考问题的框架。你也可以创建一个*甜甜圈模式*(填写问题、背景、约束和结果等字段,但在解决方案留空),作为向InnerSource Commons社区寻求帮助的一种方式(找到一个成熟的解决方案或做一次集思广益的尝试)。
46+
47+
## 如何贡献?
48+
49+
请参考: [为这本书做贡献](./contribute.md)
50+
51+
## 致谢
52+
53+
本书是世界各地无数[开源贡献者](https://github.com/InnerSourceCommons/InnerSourcePatterns/graphs/contributors)多年工作的成果。他们愿意公开分享他们在公司所面临的挑战,以及内源如何帮助他们解决这些挑战,使本书成为其他人在内源旅程中的宝贵资源。
54+
55+
我们要特别提到内源模式工作组。他们孕育了内源模式的质量,并帮助其他人作出贡献。最后,他们还将一些可用的模式汇编成了这本书。
56+
57+
本书的标题图片由[Sebastian Spier](https://spier.hu)创作,并改编自[Tony Hisgett - Alhambra 6](https://www.flickr.com/photos/hisgett/29345405788/)的图片,可根据[CC BY 2.0](https://creativecommons.org/licenses/by/2.0/)获得。
58+
59+
**感谢所有的贡献者! 并祝内源日快乐 :)**
60+
61+
## Licensing
62+
63+
![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)
64+
65+
InnerSourcePatterns by [InnerSourceCommons.org](http://innersourcecommons.org) is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/) License.
66+
67+
## 翻译校对
68+
69+
* **2022-12-21** 翻译[姜宁](https://github.com/willemjiang)
70+
* **2022-12-28** 校对[龙文选](https://github.com/hncslwx)

0 commit comments

Comments
 (0)