@ggdna/dna-translate 0.5.0 → 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 +10 -8
- package/dna/_dna.json +4 -0
- package/dna/_generated.json +17 -10
- package/dna/_vars.json +2 -1
- package/dna/doc/de/guides/translate-guide.md +50 -0
- package/dna/doc/en/guides/translate-guide.md +46 -0
- package/dna/doc/fa/guides/translate-guide.md +45 -0
- package/dna/dot-claude/skills/translate/SKILL.md +14 -16
- package/dna/dot-pubignore +2 -2
- package/package.json +1 -1
- package/dna/doc/guides/translate-guide.md +0 -30
- package/dna/doc/templates/blog-template-de.md +0 -37
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` —
|
|
8
|
-
`doc
|
|
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
|
-
|
|
11
|
+
Every file of `dna/doc/en/` also ships in German and Farsi, with the
|
|
12
|
+
same name:
|
|
12
13
|
|
|
13
|
-
- `dna/doc/
|
|
14
|
-
|
|
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
|
|
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
|
|
package/dna/_dna.json
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
// last layer of its own instantiation.
|
|
4
4
|
"version": 2,
|
|
5
5
|
|
|
6
|
+
// Published as a DNA layer: helix requires a tag on every section of
|
|
7
|
+
// dna/ markdown, so the layers above can override each one.
|
|
8
|
+
"isLayer": true,
|
|
9
|
+
|
|
6
10
|
// No parent DNA. This layer is orthogonal: it carries only its own topic
|
|
7
11
|
// and is combined with dna_dart, dna-ts and other layers by the consumer.
|
|
8
12
|
"layers": [],
|
package/dna/_generated.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "base",
|
|
6
6
|
"package": "helix",
|
|
7
7
|
"ecosystem": null,
|
|
8
|
-
"resolvedVersion": "1.
|
|
8
|
+
"resolvedVersion": "1.18.0",
|
|
9
9
|
"via": null,
|
|
10
10
|
"hash": "0x6883da335b415f9d"
|
|
11
11
|
},
|
|
@@ -15,31 +15,38 @@
|
|
|
15
15
|
"ecosystem": null,
|
|
16
16
|
"resolvedVersion": null,
|
|
17
17
|
"via": null,
|
|
18
|
-
"hash": "
|
|
18
|
+
"hash": "0x5f5ce89a81e1d577"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"claude": {
|
|
22
22
|
"claudeMdInclude": null,
|
|
23
|
-
"claudeMdFromDna": false
|
|
23
|
+
"claudeMdFromDna": false,
|
|
24
|
+
"blockHash": null
|
|
24
25
|
},
|
|
25
|
-
"baseVersion": "1.
|
|
26
|
+
"baseVersion": "1.18.0",
|
|
26
27
|
"baseHash": "0x6883da335b415f9d",
|
|
28
|
+
"configHash": "0x0d4ac600e4df748f",
|
|
29
|
+
"gitignoreHash": "0x1b0ee74d5e941279",
|
|
27
30
|
"instances": [
|
|
28
31
|
{
|
|
29
32
|
"path": ".claude/skills/translate/SKILL.md",
|
|
30
|
-
"hash": "
|
|
33
|
+
"hash": "0xbb48b1ae4460100a"
|
|
31
34
|
},
|
|
32
35
|
{
|
|
33
36
|
"path": ".pubignore",
|
|
34
|
-
"hash": "
|
|
37
|
+
"hash": "0x54c2c195dad24fee"
|
|
35
38
|
},
|
|
36
39
|
{
|
|
37
|
-
"path": "doc/guides/translate-guide.md",
|
|
38
|
-
"hash": "
|
|
40
|
+
"path": "doc/de/guides/translate-guide.md",
|
|
41
|
+
"hash": "0x44cd95c933fb803d"
|
|
39
42
|
},
|
|
40
43
|
{
|
|
41
|
-
"path": "doc/
|
|
42
|
-
"hash": "
|
|
44
|
+
"path": "doc/en/guides/translate-guide.md",
|
|
45
|
+
"hash": "0x15ea2b489b490f89"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"path": "doc/fa/guides/translate-guide.md",
|
|
49
|
+
"hash": "0x97524b2d41a86f79"
|
|
43
50
|
}
|
|
44
51
|
]
|
|
45
52
|
}
|
package/dna/_vars.json
CHANGED
|
@@ -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
|
|
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,32 +13,30 @@ 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
|
-
## 1. Find what is out of sync
|
|
18
|
+
## @sync 1. Find what is out of sync
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
-
|
|
26
|
-
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
against `doc/de/<yyyy>-Q<n>/blog`.
|
|
31
|
+
Stop here and report when every language is complete and current — there
|
|
32
|
+
is nothing to translate.
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
nothing to translate.
|
|
35
|
-
|
|
36
|
-
## 2. Translate what is missing
|
|
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
|
-
## 3. Show the result
|
|
40
|
+
## @result 3. Show the result
|
|
43
41
|
|
|
44
42
|
List every file you wrote, then let the user review before committing.
|
package/dna/dot-pubignore
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/doc
|
|
2
|
-
/doc
|
|
1
|
+
/doc/*/guides/
|
|
2
|
+
/doc/*/templates/
|
package/package.json
CHANGED
|
@@ -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 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
|
|
12
|
-
|
|
13
|
-
- Warum und wozu, aus Sicht dieses Repos — das größere Ziel, nicht nur der
|
|
14
|
-
Auslöser.
|
|
15
|
-
|
|
16
|
-
## Strategie
|
|
17
|
-
|
|
18
|
-
- Wie das Ziel erreicht wurde. 3–7 Stichpunkte.
|
|
19
|
-
|
|
20
|
-
## Realisierung 1
|
|
21
|
-
|
|
22
|
-
- Eine fokussierte Sektion pro Umsetzungsschritt / Arbeitspaket.
|
|
23
|
-
- 3-7 Stichpunkte
|
|
24
|
-
|
|
25
|
-
## Realisierung 2
|
|
26
|
-
|
|
27
|
-
- ..
|
|
28
|
-
|
|
29
|
-
## 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
|
-
## Offene Punkte
|
|
36
|
-
|
|
37
|
-
- Noch nicht fertig, bekannte Einschränkungen, vertagte Entscheidungen.
|