@ggdna/dna-translate 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,15 +4,15 @@ The DNA layer that keeps documentation in sync across languages.
4
4
 
5
5
  ## Guides
6
6
 
7
- - `dna/doc/guides/translate-guide.md` — when and how to translate `doc`,
8
- `doc/de`, `README.md` and `README.de.md`, and where blog posts of each
9
- language belong
7
+ - `dna/doc/en/guides/translate-guide.md` — which languages the repo keeps,
8
+ how `doc/<lang>`, `pm/<lang>` and `README.<lang>.md` stay in sync, and
9
+ where blog posts of each language belong
10
10
 
11
- ## Templates
11
+ Every file of `dna/doc/en/` also ships in German and Farsi, with the
12
+ same name:
12
13
 
13
- - `dna/doc/templates/blog-template-de.md` — the structure of a german
14
- blog post; the english one comes from
15
- [dna_blog](https://github.com/ggdna/dna_blog)
14
+ - `dna/doc/de/guides/`
15
+ - `dna/doc/fa/guides/`
16
16
 
17
17
  ## Skills
18
18
 
@@ -21,7 +21,7 @@ The DNA layer that keeps documentation in sync across languages.
21
21
 
22
22
  ## Publishing
23
23
 
24
- `dna/dot-pubignore` keeps `/doc/guides/` and `/doc/templates/` out of the
24
+ `dna/dot-pubignore` keeps `/doc/*/guides/` out of the
25
25
  package `dart pub publish` uploads. helix joins it with the ignore files of the
26
26
  other layers into the project's `.pubignore`.
27
27
 
@@ -33,6 +33,8 @@ other layers by the consuming repo.
33
33
  ## Variables
34
34
 
35
35
  - `dnaCopyrightHolder` — the name in the license header of every file
36
+ - `dnaLanguages` — the languages of the repo as two-letter codes, the
37
+ leading one first, separated by commas; default `en`, e.g. `en,de,fa`
36
38
 
37
39
  ## Usage
38
40
 
@@ -5,7 +5,7 @@
5
5
  "name": "base",
6
6
  "package": "helix",
7
7
  "ecosystem": null,
8
- "resolvedVersion": "1.16.0",
8
+ "resolvedVersion": "1.18.0",
9
9
  "via": null,
10
10
  "hash": "0x6883da335b415f9d"
11
11
  },
@@ -15,7 +15,7 @@
15
15
  "ecosystem": null,
16
16
  "resolvedVersion": null,
17
17
  "via": null,
18
- "hash": "0xdf4b524e06e4d038"
18
+ "hash": "0x5f5ce89a81e1d577"
19
19
  }
20
20
  ],
21
21
  "claude": {
@@ -23,25 +23,30 @@
23
23
  "claudeMdFromDna": false,
24
24
  "blockHash": null
25
25
  },
26
- "baseVersion": "1.16.0",
26
+ "baseVersion": "1.18.0",
27
27
  "baseHash": "0x6883da335b415f9d",
28
28
  "configHash": "0x0d4ac600e4df748f",
29
+ "gitignoreHash": "0x1b0ee74d5e941279",
29
30
  "instances": [
30
31
  {
31
32
  "path": ".claude/skills/translate/SKILL.md",
32
- "hash": "0x3b34cef6c2b790a8"
33
+ "hash": "0xbb48b1ae4460100a"
33
34
  },
34
35
  {
35
36
  "path": ".pubignore",
36
- "hash": "0xf54303d9193038d4"
37
+ "hash": "0x54c2c195dad24fee"
37
38
  },
38
39
  {
39
- "path": "doc/guides/translate-guide.md",
40
- "hash": "0xa677037143b642e7"
40
+ "path": "doc/de/guides/translate-guide.md",
41
+ "hash": "0x44cd95c933fb803d"
41
42
  },
42
43
  {
43
- "path": "doc/templates/blog-template-de.md",
44
- "hash": "0x2758a6e86ff09650"
44
+ "path": "doc/en/guides/translate-guide.md",
45
+ "hash": "0x15ea2b489b490f89"
46
+ },
47
+ {
48
+ "path": "doc/fa/guides/translate-guide.md",
49
+ "hash": "0x97524b2d41a86f79"
45
50
  }
46
51
  ]
47
52
  }
package/dna/_vars.json CHANGED
@@ -1,3 +1,4 @@
1
1
  {
2
- "dnaCopyrightHolder": "ggsuite"
2
+ "dnaCopyrightHolder": "ggsuite",
3
+ "dnaLanguages": "en"
3
4
  }
@@ -0,0 +1,50 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) dnaCopyrightHolder
4
+
5
+ Use of this source code is governed by terms that can be
6
+ found in the LICENSE file in the root of this package.
7
+ -->
8
+
9
+ # Übersetzungsleitfaden
10
+
11
+ ## @languages Die Sprachen kennen <a id="know-the-languages"></a>
12
+
13
+ - Dieses Repo führt seine Dokumentation in diesen Sprachen, die Leitsprache
14
+ zuerst: `dnaLanguages`. Ändere sie in den `vars` von `dna/_dna.json`,
15
+ unter dem Schlüssel `dna` + `Languages` in einem Wort, als
16
+ Zwei-Buchstaben-Codes durch Kommas getrennt, z. B. `"en,de,fa"`
17
+ - Jede Sprache hat eigene Ordner: `doc/<lang>` für die Dokumentation, die
18
+ zu keinem Quartal gehört, `pm/<lang>/<yyyy>-Q<n>` für das, was in einem
19
+ Quartal geplant und geschrieben wird, z. B. den Blog
20
+ - `README.md` ist Englisch, jede andere Sprache hat `README.<lang>.md`
21
+ - Bei nur einer Sprache gibt es nichts zu übersetzen
22
+
23
+ ## @sync Die Sprachen synchron halten <a id="keep-the-languages-in-sync"></a>
24
+
25
+ - Lege zu jeder Datei einer Sprache die entsprechende Datei in jeder
26
+ anderen Sprache an, mit gleichem Pfad unter `doc/<lang>` oder
27
+ `pm/<lang>` und gleichem Dateinamen
28
+ - Stelle sicher, dass eine Änderung in einer Sprache in alle anderen
29
+ übersetzt wird
30
+ - Nutze vorhandene übersetzte Dateien
31
+ - Beginne Dokumentation in der Leitsprache; auch wenn der Nutzer eine
32
+ andere Sprache spricht, schreibe zuerst die Leitsprache
33
+ - Übersetze kurz vor dem Veröffentlichen
34
+ - Übersetze inhaltlich und strukturell gleich
35
+ - Übersetze keine Befehle, keinen Code, keine Pfade, APIs, IDs oder
36
+ Dateinamen
37
+ - Übersetze nicht wörtlich
38
+ - Übersetze nie die Leitfäden und Vorlagen unter `doc/<lang>/guides` und
39
+ `doc/<lang>/templates`: Die DNA-Schichten liefern sie in jeder Sprache
40
+ aus
41
+
42
+ ## @blog Blogbeiträge <a id="blog-posts"></a>
43
+
44
+ - Beginne einen Beitrag in der Leitsprache, siehe den
45
+ [Blog-Leitfaden](./blog-guide.md)
46
+ - Lege jede Übersetzung in `pm/<lang>/<yyyy>-Q<n>/blog` ihrer Sprache ab,
47
+ im gleichen Quartal und mit dem gleichen Dateinamen wie das Original
48
+ - Kopiere für einen neuen Beitrag `doc/<lang>/templates/blog-template.md`
49
+ der jeweiligen Sprache
50
+ - Folge für alles andere dem [Blog-Leitfaden](./blog-guide.md)
@@ -0,0 +1,46 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) dnaCopyrightHolder
4
+
5
+ Use of this source code is governed by terms that can be
6
+ found in the LICENSE file in the root of this package.
7
+ -->
8
+
9
+ # Translate Guide
10
+
11
+ ## @languages Know the languages
12
+
13
+ - This repo keeps its documentation in these languages, the leading one
14
+ first: `dnaLanguages`. Change them in the `vars` of `dna/_dna.json`,
15
+ under the key `dna` + `Languages` written as one word, as two-letter
16
+ codes separated by commas, e.g. `"en,de,fa"`
17
+ - Every language has its own folders: `doc/<lang>` for the documentation
18
+ that belongs to no quarter, `pm/<lang>/<yyyy>-Q<n>` for what is planned
19
+ and written in a quarter, e.g. the blog
20
+ - `README.md` is English, every other language has `README.<lang>.md`
21
+ - With one language only, there is nothing to translate
22
+
23
+ ## @sync Keep the languages in sync
24
+
25
+ - Create for each file of one language the corresponding file in every
26
+ other language, same path below `doc/<lang>` or `pm/<lang>` and same
27
+ file name
28
+ - Make sure a change in one language is translated into all others
29
+ - Use existing translated files
30
+ - Start documentation in the leading language; when the user talks another
31
+ language, still write the leading language first
32
+ - Translate shortly before publishing
33
+ - Translate content- and structure-equal
34
+ - Do not translate commands, code, paths, APIs, IDs or file names
35
+ - Do not translate literally
36
+ - Never translate the guides and templates under `doc/<lang>/guides` and
37
+ `doc/<lang>/templates`: the DNA layers ship them in every language
38
+
39
+ ## @blog Blog posts
40
+
41
+ - Start a post in the leading language, see the [Blog Guide](./blog-guide.md)
42
+ - Put each translation into `pm/<lang>/<yyyy>-Q<n>/blog` of its language,
43
+ the same quarter and the same file name as the original
44
+ - Copy `doc/<lang>/templates/blog-template.md` of the language for a new
45
+ post
46
+ - Follow the [Blog Guide](./blog-guide.md) for everything else
@@ -0,0 +1,45 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) dnaCopyrightHolder
4
+
5
+ Use of this source code is governed by terms that can be
6
+ found in the LICENSE file in the root of this package.
7
+ -->
8
+
9
+ # راهنمای ترجمه
10
+
11
+ ## @languages زبان‌ها را بشناسید <a id="know-the-languages"></a>
12
+
13
+ - این مخزن مستندات خود را به این زبان‌ها نگه می‌دارد، با زبان اصلی در
14
+ ابتدا: `dnaLanguages`. آن‌ها را در `vars` فایل `dna/_dna.json` تغییر
15
+ دهید، زیر کلید `dna` + `Languages` که پیوسته نوشته می‌شود، به صورت
16
+ کدهای دوحرفی که با ویرگول جدا شده‌اند، مثلاً `"en,de,fa"`
17
+ - هر زبان پوشه‌های خودش را دارد: `doc/<lang>` برای مستنداتی که به هیچ
18
+ فصلی تعلق ندارند، `pm/<lang>/<yyyy>-Q<n>` برای آنچه در یک فصل برنامه‌ریزی
19
+ و نوشته می‌شود، مثلاً وبلاگ
20
+ - `README.md` انگلیسی است، هر زبان دیگر `README.<lang>.md` دارد
21
+ - با فقط یک زبان، چیزی برای ترجمه وجود ندارد
22
+
23
+ ## @sync زبان‌ها را هم‌گام نگه دارید <a id="keep-the-languages-in-sync"></a>
24
+
25
+ - برای هر فایلِ یک زبان، فایل متناظر را در همه‌ی زبان‌های دیگر بسازید، با
26
+ همان مسیر زیر `doc/<lang>` یا `pm/<lang>` و همان نام فایل
27
+ - مطمئن شوید که تغییری در یک زبان به همه‌ی زبان‌های دیگر ترجمه می‌شود
28
+ - از فایل‌های ترجمه‌شده‌ی موجود استفاده کنید
29
+ - مستندات را به زبان اصلی شروع کنید؛ حتی اگر کاربر به زبان دیگری صحبت
30
+ می‌کند، ابتدا زبان اصلی را بنویسید
31
+ - کمی پیش از انتشار ترجمه کنید
32
+ - از نظر محتوا و ساختار یکسان ترجمه کنید
33
+ - فرمان‌ها، کد، مسیرها، APIها، شناسه‌ها (IDs) یا نام فایل‌ها را ترجمه نکنید
34
+ - تحت‌اللفظی ترجمه نکنید
35
+ - هرگز راهنماها و قالب‌های زیر `doc/<lang>/guides` و `doc/<lang>/templates`
36
+ را ترجمه نکنید: لایه‌های DNA آن‌ها را به همه‌ی زبان‌ها ارائه می‌کنند
37
+
38
+ ## @blog پست‌های وبلاگ <a id="blog-posts"></a>
39
+
40
+ - یک پست را به زبان اصلی شروع کنید، ببینید [راهنمای وبلاگ](./blog-guide.md)
41
+ - هر ترجمه را در `pm/<lang>/<yyyy>-Q<n>/blog` زبان خودش قرار دهید، در همان
42
+ فصل و با همان نام فایلِ نسخه‌ی اصلی
43
+ - برای پست جدید، `doc/<lang>/templates/blog-template.md` همان زبان را کپی
44
+ کنید
45
+ - برای بقیه‌ی موارد از [راهنمای وبلاگ](./blog-guide.md) پیروی کنید
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: translate
3
- description: Checks whether documentation is out of sync between English and German and translates what is missing. Use when the user says "/translate" or asks whether anything needs translating.
3
+ description: Checks whether documentation is out of sync between the languages of the repo and translates what is missing. Use when the user says "/translate" or asks whether anything needs translating.
4
4
  ---
5
5
 
6
6
  <!--
@@ -13,31 +13,29 @@ found in the LICENSE file in the root of this package.
13
13
 
14
14
  # Translate
15
15
 
16
- Read `doc/guides/translate-guide.md` and follow it.
16
+ Read `doc/en/guides/translate-guide.md` and follow it.
17
17
 
18
18
  ## @sync 1. Find what is out of sync
19
19
 
20
- List the English documentation (`doc`, `README.md`) and the German one
21
- (`doc/de`, `README.de.md`).
20
+ Take the languages of the repo from the guide, the leading one first. List
21
+ the documentation of each language: `doc/<lang>`, `pm/<lang>` and
22
+ `README.md` or `README.<lang>.md`. Leave out `doc/<lang>/guides` and
23
+ `doc/<lang>/templates`, they come from the DNA.
22
24
 
23
25
  Report three groups:
24
26
 
25
- - English files without a German counterpart
26
- - German files without an English counterpart
27
+ - files of one language without a counterpart in another language
28
+ - counterparts that exist only in a language that is not one of the repo
27
29
  - pairs whose newer side changed after the older one, from `git log -1`
28
30
 
29
- Cover the blog the same way: `doc/blog/<yyyy>` against
30
- `doc/de/blog/<yyyy>`, in a project management repo `doc/<yyyy>-Q<n>/blog`
31
- against `doc/de/<yyyy>-Q<n>/blog`.
32
-
33
- Stop here and report when every pair is complete and current — there is
34
- nothing to translate.
31
+ Stop here and report when every language is complete and current — there
32
+ is nothing to translate.
35
33
 
36
34
  ## @missing 2. Translate what is missing
37
35
 
38
36
  Translate content- and structure-equal, never literally.
39
37
 
40
- Do not translate commands, code, paths or API names.
38
+ Do not translate commands, code, paths, IDs or API names.
41
39
 
42
40
  ## @result 3. Show the result
43
41
 
package/dna/dot-pubignore CHANGED
@@ -1,2 +1,2 @@
1
- /doc/guides/
2
- /doc/templates/
1
+ /doc/*/guides/
2
+ /doc/*/templates/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ggdna/dna-translate",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "DNA layer: multi-language rules for guides, docs and README files",
5
5
  "keywords": [
6
6
  "dna",
@@ -1,30 +0,0 @@
1
- <!--
2
- @license
3
- Copyright (c) dnaCopyrightHolder
4
-
5
- Use of this source code is governed by terms that can be
6
- found in the LICENSE file in the root of this package.
7
- -->
8
-
9
- # Translate Guide
10
-
11
- - Keep English documentation in `doc`, German documentation in `doc/de`
12
- - Make sure changes in German documentation
13
- (`doc/de`, `README.de.md`) are translated into English and vice versa
14
- - Use existing translated files
15
- - Create for each file in `doc` a corresponding file in `doc/de` and vice versa
16
- - Start documentation in the language of the prompt
17
- - Translate shortly before publishing
18
- - Translate content- and structure-equal
19
- - Do not translate commands, code, paths, APIS
20
- - Do not translate literally
21
-
22
- ## @blog Blog posts
23
-
24
- - Start a post in the language of the prompt
25
- - Put english posts into `doc/blog/<yyyy>`, german ones into
26
- `doc/de/blog/<yyyy>`; a project management repo keeps them in its
27
- quarter folder: `doc/<yyyy>-Q<n>/blog` and `doc/de/<yyyy>-Q<n>/blog`
28
- - Copy `doc/templates/blog-template-de.md` for a german post
29
- - Keep the file name in english kebab case in both languages
30
- - Follow the [Blog Guide](./blog-guide.md) for everything else
@@ -1,37 +0,0 @@
1
- <!--
2
- @license
3
- Copyright (c) dnaCopyrightHolder
4
-
5
- Use of this source code is governed by terms that can be
6
- found in the LICENSE file in the root of this package.
7
- -->
8
-
9
- # Titel
10
-
11
- ## @motivation Motivation
12
-
13
- - Warum und wozu, aus Sicht dieses Repos — das größere Ziel, nicht nur der
14
- Auslöser.
15
-
16
- ## @strategy Strategie
17
-
18
- - Wie das Ziel erreicht wurde. 3–7 Stichpunkte.
19
-
20
- ## @implementation Realisierung 1
21
-
22
- - Eine fokussierte Sektion pro Umsetzungsschritt / Arbeitspaket.
23
- - 3-7 Stichpunkte
24
-
25
- ## @implementation-2 Realisierung 2
26
-
27
- - ..
28
-
29
- ## @dependencies Aktualisierte Abhängigkeiten
30
-
31
- - Was sich in aktualisierten Abhängigkeiten geändert hat und für dieses Repo
32
- zählt.
33
- - Entfällt, wenn keine Abhängigkeit aktualisiert wurde.
34
-
35
- ## @open-points Offene Punkte
36
-
37
- - Noch nicht fertig, bekannte Einschränkungen, vertagte Entscheidungen.