Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix(i18n): finish Arabic catalog copy and coverage

tt-a1i1a6414834b7f
diff --git a/README.md b/README.md
index 221ec423..9699193c 100644
--- a/README.md
+++ b/README.md
@@ -400,7 +400,7 @@ Settings:
}
```
-`meta.locale` localizes page title, Legend, states/errors, a11y, HTML/SVG `lang`—never authored content. `en`, `zh-CN`, `zh-TW`, `es`, and `ko` are bundled and need only `meta.locale`; `meta.translations` (canonical message key → translated string) overrides individual keys and keeps the rest of the language. Other languages supply their catalog there (see `archify/examples/locales/`), or the renderer falls back to English and discloses it. Static omits `animation`; `classic` defaults.
+`meta.locale` localizes page title, Legend, states/errors, a11y, HTML/SVG `lang`—never authored content. `en`, `zh-CN`, `zh-TW`, `es`, `ko`, and `ar` are bundled and need only `meta.locale`; `meta.translations` (canonical message key → translated string) overrides individual keys and keeps the rest of the language. Other languages supply their catalog there (see `archify/examples/locales/`), or the renderer falls back to English and discloses it. Static omits `animation`; `classic` defaults.
</details>
diff --git a/README_EN.md b/README_EN.md
index 221ec423..9699193c 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -400,7 +400,7 @@ Settings:
}
```
-`meta.locale` localizes page title, Legend, states/errors, a11y, HTML/SVG `lang`—never authored content. `en`, `zh-CN`, `zh-TW`, `es`, and `ko` are bundled and need only `meta.locale`; `meta.translations` (canonical message key → translated string) overrides individual keys and keeps the rest of the language. Other languages supply their catalog there (see `archify/examples/locales/`), or the renderer falls back to English and discloses it. Static omits `animation`; `classic` defaults.
+`meta.locale` localizes page title, Legend, states/errors, a11y, HTML/SVG `lang`—never authored content. `en`, `zh-CN`, `zh-TW`, `es`, `ko`, and `ar` are bundled and need only `meta.locale`; `meta.translations` (canonical message key → translated string) overrides individual keys and keeps the rest of the language. Other languages supply their catalog there (see `archify/examples/locales/`), or the renderer falls back to English and discloses it. Static omits `animation`; `classic` defaults.
</details>
diff --git a/README_JA.md b/README_JA.md
index 677dff40..d9c9e3f3 100644
--- a/README_JA.md
+++ b/README_JA.md
@@ -366,7 +366,7 @@ node bin/archify.mjs deliver workflow examples/agent-tool-call.workflow.json /tm
}
```
-`meta.locale=en|zh-CN|zh-TW|es|ko` はページタイトル、Legend、状態/エラー、アクセシビリティ、HTML/SVG の `lang` をローカライズします(記述された内容自体は変更しません)。該当しない場合は省略し、要求された言語の文言はそのまま維持し、英語へフォールバックした場合はその旨を明示してください。静止出力では `animation` は省略され、`classic` が既定になります。
+`meta.locale=en|zh-CN|zh-TW|es|ko|ar` はページタイトル、Legend、状態/エラー、アクセシビリティ、HTML/SVG の `lang` をローカライズします(記述された内容自体は変更しません)。該当しない場合は省略し、要求された言語の文言はそのまま維持し、英語へフォールバックした場合はその旨を明示してください。静止出力では `animation` は省略され、`classic` が既定になります。
</details>
diff --git a/README_ZH.md b/README_ZH.md
index fd6aed13..fc8218bd 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -401,7 +401,7 @@ node bin/archify.mjs deliver workflow examples/agent-tool-call.workflow.json /tm
}
```
-不设置 `animation` 时结果完全静态;`classic` 始终是默认视觉预设。设计评审、发布说明和技术文档可以显式选择 `editorial`,获得暖纸张与深墨色的编辑风格,同时保持几何完全不变。将 `meta.locale` 设为任意合法语言标签,可选择 `<html lang>`、默认图例、无障碍文案和所有固定 Viewer UI。`en`、`zh-CN`、`zh-TW`、`es` 与 `ko` 已内置,只需设置 `meta.locale`;`meta.translations`(规范消息键到译文字符串的映射)可逐键覆盖,其余文案保持所选语言。其他语言需在该字段中提供完整目录(参见 `archify/examples/locales/`),否则渲染器回退为英文并在 stderr 中说明。作者编写的标题、节点、关系和卡片不会被机器翻译。未带该字段的旧文件仍然有效,并默认使用英文。对于既未内置也未提供 `meta.translations` 的创作语言,应省略 `meta.locale`、保持 authored content 使用用户要求的语言,并主动告知用户固定 Viewer UI 与 `<html lang>` 回退为英文,因此该成品不属于完整本地化。
+不设置 `animation` 时结果完全静态;`classic` 始终是默认视觉预设。设计评审、发布说明和技术文档可以显式选择 `editorial`,获得暖纸张与深墨色的编辑风格,同时保持几何完全不变。将 `meta.locale` 设为任意合法语言标签,可选择 `<html lang>`、默认图例、无障碍文案和所有固定 Viewer UI。`en`、`zh-CN`、`zh-TW`、`es`、`ko` 与 `ar` 已内置,只需设置 `meta.locale`;`meta.translations`(规范消息键到译文字符串的映射)可逐键覆盖,其余文案保持所选语言。其他语言需在该字段中提供完整目录(参见 `archify/examples/locales/`),否则渲染器回退为英文并在 stderr 中说明。作者编写的标题、节点、关系和卡片不会被机器翻译。未带该字段的旧文件仍然有效,并默认使用英文。对于既未内置也未提供 `meta.translations` 的创作语言,应省略 `meta.locale`、保持 authored content 使用用户要求的语言,并主动告知用户固定 Viewer UI 与 `<html lang>` 回退为英文,因此该成品不属于完整本地化。
</details>
diff --git a/archify.zip b/archify.zip
index 03d46d0e..776666e0 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/locales/README.md b/archify/locales/README.md
index 4735b1fa..07941272 100644
--- a/archify/locales/README.md
+++ b/archify/locales/README.md
@@ -25,10 +25,16 @@ never collapsed onto another catalog.
| `zh-TW` | kevinlincg | Complete; OpenCC `s2twp` conversion hand-reviewed for Taiwan terminology; not independently native-reviewed |
| `es` | Juan Pablo Tamayo (#457, moved to data in #586) | Complete; not independently native-reviewed |
| `ko` | uygnoey (#457) | Complete; not independently native-reviewed |
-| `ar` | jahfaliabdulrahman-dev | Complete: 486/486 keys with placeholder parity checked mechanically; right-to-left rendering inspected in Chrome at 1440×900 and 2048×1320. Not independently native-reviewed |
+| `ar` | jahfaliabdulrahman-dev | Complete: 486/486 keys with placeholder parity checked mechanically; not independently native-reviewed |
Completeness checks prove key and placeholder coverage, not native wording,
plural grammar, right-to-left layout, or glyph coverage.
+The Arabic catalog localizes copy only. Reader text/chrome direction and scene
+geometry are unchanged; full RTL support is tracked in [#935](https://github.com/tt-a1i/archify/issues/935).
+Route/reach export summaries and reach controls use count-neutral labels within
+the existing `.one`/`.other` model. Other counted messages still have that
+model's Arabic plural limitations.
+
Other reusable, unenrolled examples live in `../examples/locales/`; supply
them through `meta.translations`.
diff --git a/archify/locales/ar.json b/archify/locales/ar.json
index cbbc3b37..edfe36c9 100644
--- a/archify/locales/ar.json
+++ b/archify/locales/ar.json
@@ -152,15 +152,15 @@
"viewer.export.downloadedReach": "نُزّلت بطاقة مشاركة امتداد",
"viewer.export.downloadedWebm": "نُزّل WebM",
"viewer.export.recording": "يُسجّل ٦ ثوانٍ من الحركة…",
- "viewer.export.card.routeSummary.one": "المسار: من {source} إلى {target} · {count} خطوة",
- "viewer.export.card.routeSummary.other": "المسار: من {source} إلى {target} · {count} خطوات",
- "viewer.export.card.reachSummary": "المُؤَلَّف {direction} من {origin} · {nodes} · {links} · أقصى {hops}",
- "viewer.export.card.node.one": "{count} عقدة",
- "viewer.export.card.node.other": "{count} عقدة",
- "viewer.export.card.link.one": "{count} رابط",
- "viewer.export.card.link.other": "{count} روابط",
- "viewer.export.card.hop.one": "{count} قفزة",
- "viewer.export.card.hop.other": "{count} قفزات",
+ "viewer.export.card.routeSummary.one": "المسار: من {source} إلى {target} · عدد الخطوات: {count}",
+ "viewer.export.card.routeSummary.other": "المسار: من {source} إلى {target} · عدد الخطوات: {count}",
+ "viewer.export.card.reachSummary": "الامتداد المُؤَلَّف نحو {direction} من {origin} · {nodes} · {links} · {hops} كحد أقصى",
+ "viewer.export.card.node.one": "عدد العُقد: {count}",
+ "viewer.export.card.node.other": "عدد العُقد: {count}",
+ "viewer.export.card.link.one": "عدد الروابط: {count}",
+ "viewer.export.card.link.other": "عدد الروابط: {count}",
+ "viewer.export.card.hop.one": "عدد القفزات: {count}",
+ "viewer.export.card.hop.other": "عدد القفزات: {count}",
"viewer.export.card.routeBadge": "ARCHIFY · مسار · {hops}",
"viewer.export.card.reachBadge": "ARCHIFY · امتداد {direction}",
"viewer.export.direction.upstream": "المنبع",
@@ -282,13 +282,13 @@
"viewer.passport.repository.open": "افتح التزام المستودع المُتحقَّق منه {revision}",
"viewer.passport.source.open": "افتح المصدرَ المُتحقَّق منه {path} عند الالتزام {revision}",
"viewer.passport.source.openLink": "افتح ↗",
- "viewer.passport.reach.upstream.one": "تتبّع {count} عقدةً مُؤَلَّفة نحو المنبع",
- "viewer.passport.reach.upstream.other": "تتبّع {count} عقدةً مُؤَلَّفة نحو المنبع",
- "viewer.passport.reach.downstream.one": "تتبّع {count} عقدةً مُؤَلَّفة نحو المصبّ",
- "viewer.passport.reach.downstream.other": "تتبّع {count} عقدةً مُؤَلَّفة نحو المصبّ",
+ "viewer.passport.reach.upstream.one": "تتبّع العُقد المُؤَلَّفة نحو المنبع (العدد: {count})",
+ "viewer.passport.reach.upstream.other": "تتبّع العُقد المُؤَلَّفة نحو المنبع (العدد: {count})",
+ "viewer.passport.reach.downstream.one": "تتبّع العُقد المُؤَلَّفة نحو المصبّ (العدد: {count})",
+ "viewer.passport.reach.downstream.other": "تتبّع العُقد المُؤَلَّفة نحو المصبّ (العدد: {count})",
"viewer.passport.reach.noUpstream": "لا عُقدَ مُؤَلَّفة نحو المنبع",
"viewer.passport.reach.noDownstream": "لا عُقدَ مُؤَلَّفة نحو المصبّ",
- "viewer.passport.reach.status": "{direction} · {nodes} عقدة · {links} رابطًا · أقصى {hops} قفزة",
+ "viewer.passport.reach.status": "{direction} · عدد العُقد: {nodes} · عدد الروابط: {links} · أقصى عدد للقفزات: {hops}",
"viewer.route.eyebrow": "مسار",
"viewer.route.start": "انقر حيث يبدأ المسار",
"viewer.route.start.find": "ابحث عن بداية",
@@ -374,7 +374,7 @@
"viewer.lens.relationship.one": "{count} علاقةٌ ملامسة",
"viewer.lens.relationship.other": "{count} علاقةٌ ملامسة",
"viewer.radar.title": "رادار دلالي",
- "viewer.radar.building": "يُبني المنظر العام",
+ "viewer.radar.building": "جارٍ إنشاء النظرة العامة",
"viewer.radar.openFull": "افتح الرادار الدلالي الكامل",
"viewer.radar.open": "افتح الرادار",
"viewer.radar.close": "أغلق الرادار الدلالي",
@@ -386,7 +386,7 @@
"viewer.radar.focus": "أبرِز {label} من الرادار الدلالي",
"viewer.radar.status": "{count} عقدة · {viewport}",
"viewer.radar.fullMap": "{count} عقدة · الخريطة كاملة",
- "viewer.radar.compacted": "طُوي الرادار لئلّا يغطّي جوازَ المخطّط أو أدوات الخريطة.",
+ "viewer.radar.compacted": "طُوي الرادار لئلّا يغطّي الجواز الدلالي أو أدوات الخريطة.",
"viewer.radar.cancelWaiting": "ألغِ انتظار الرادار الدلالي مساحةَ خريطةٍ أكبر",
"viewer.radar.needsSpace": "الرادار الدلالي يحتاج مساحةَ خريطةٍ مرئية أكبر",
"viewer.radar.viewport.full": "الخريطة كاملة",
diff --git a/archify/references/authoring-contract.md b/archify/references/authoring-contract.md
index 3e4ffb63..1e821f24 100644
--- a/archify/references/authoring-contract.md
+++ b/archify/references/authoring-contract.md
@@ -80,7 +80,7 @@ chooses one primary locale for the Viewer; follow an explicit primary-language
request, then prompt order or conversation dominance.
Bundled Viewer catalogs are enrolled in `locales/manifest.json`: currently
-`en`, `zh-CN`, `zh-TW`, `es`, and `ko`. For these, `meta.locale` alone selects the full
+`en`, `zh-CN`, `zh-TW`, `es`, `ko`, and `ar`. For these, `meta.locale` alone selects the full
catalog. Tags match case-insensitively (`zh-cn` selects `zh-CN`), but region
and script variants are distinct: `zh-Hant`, `es-MX`, or `ko-KR` select no
bundled catalog.
diff --git a/archify/schemas/README.md b/archify/schemas/README.md
index d3d29811..151f7c7e 100644
--- a/archify/schemas/README.md
+++ b/archify/schemas/README.md
@@ -30,7 +30,7 @@ It also accepts `locale`, any well-formed language tag (schema pattern
`^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$`). The field selects the fixed Viewer UI,
renderer-owned default legend and accessibility copy, document-title suffix,
and `<html lang>` value; it does not translate authored strings. The bundled
-catalogs enrolled in `locales/manifest.json` (`en`, `zh-CN`, `zh-TW`, `es`, `ko`) are
+catalogs enrolled in `locales/manifest.json` (`en`, `zh-CN`, `zh-TW`, `es`, `ko`, `ar`) are
selected by tag, case-insensitively; region and script variants are distinct
tags. Any other tag needs a matching `translations` object (see below) or the
renderer falls back to English and discloses it.
diff --git a/test/erd-i18n.test.mjs b/test/erd-i18n.test.mjs
index c2c9f08e..01ff9359 100644
--- a/test/erd-i18n.test.mjs
+++ b/test/erd-i18n.test.mjs
@@ -72,9 +72,30 @@ test('ERD accepts partial translations through validate, render and deliver', t
}
});
+test('ERD renders the bundled Arabic cardinality legend and preserves authored names', t => {
+ const directory = workspace(t);
+ const document = fixture(undefined, 'ar');
+ document.entities.push({
+ id: 'accounts', label: 'Authored accounts', pos: [440, 80],
+ attributes: [{ name: 'account_id', type: 'int', key: 'pk' }],
+ });
+ document.relationships = [{
+ id: 'users_accounts', from: 'users', to: 'accounts',
+ fromCardinality: 'many', toCardinality: 'one',
+ }];
+ const result = run(directory, document);
+ assert.equal(result.status, 0, result.stderr);
+ const artifact = html(directory);
+ assert.equal(messages(artifact).locale, 'ar');
+ assert.match(artifact, />واحد<\/text>/);
+ assert.match(artifact, />متعدّد<\/text>/);
+ assert.match(artifact, />Authored users<\/text>/);
+ assert.match(artifact, />Authored accounts<\/text>/);
+});
+
test('ERD empty translations preserve locale-only artifacts byte for byte', t => {
const directory = workspace(t);
- for (const locale of ['en', 'zh-CN', 'zh-TW', 'es', 'ko']) {
+ for (const locale of ['en', 'zh-CN', 'zh-TW', 'es', 'ko', 'ar']) {
const baseline = run(directory, fixture(undefined, locale));
assert.equal(baseline.status, 0, baseline.stderr);
const before = html(directory);
diff --git a/test/i18n-browser.test.mjs b/test/i18n-browser.test.mjs
index d90137f4..ca8bbbd0 100644
--- a/test/i18n-browser.test.mjs
+++ b/test/i18n-browser.test.mjs
@@ -157,6 +157,21 @@ const BROWSER_LOCALES = {
},
shareCardFailure: '공유 카드에 2D 캔버스 컨텍스트를 만들 수 없습니다',
},
+ ar: {
+ title: (type) => `API Gateway · مخطّط-${type}`,
+ toolbarLabel: 'أدواتُ عرض المخطّط',
+ finder: { hidden: false, title: 'ابحث عن عقدة', searchLabel: 'ابحث في عُقد المخطّط' },
+ route: { hidden: false, title: 'انقر حيث يبدأ المسار', label: 'امسح مسبار المسار' },
+ exportLabel: 'تصدير المخطّط',
+ exportMenuLabel: 'تصدير',
+ exportMenuText: /انسخ المخطّط/,
+ presetBadges: {
+ 'signal-flow': { header: 'تدفّق الإشارة', plate: 'none' },
+ blueprint: { header: 'مخطّط هندسي / إصدار ٠١', plate: '' },
+ editorial: { header: 'تحريري / ملاحظة ميدانية', plate: 'ARCHIFY / لوحة ٠٤' },
+ },
+ shareCardFailure: 'سياقُ لوحة الرسم ثنائيِّ الأبعاد غير متاح لـبطاقة مشاركة',
+ },
};
@@ -302,3 +317,14 @@ test('real Chrome keeps ko Finder, Route, Export, and accessibility UI localized
await browser.close();
}
});
+
+test('real Chrome keeps Arabic UI localized with mixed-script authored titles in all five modes', {
+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser localization regression.',
+}, async () => {
+ const browser = new ChromeVisualBrowser(chromePath);
+ try {
+ await assertLocalizedViewer(browser, 'ar', BROWSER_LOCALES.ar);
+ } finally {
+ await browser.close();
+ }
+});
diff --git a/test/i18n.test.mjs b/test/i18n.test.mjs
index dd024fc6..f8b7dfe8 100644
--- a/test/i18n.test.mjs
+++ b/test/i18n.test.mjs
@@ -257,7 +257,7 @@ function embeddedMessages(html) {
return JSON.parse(embedded[1]);
}
-test('bundled es and ko render from meta.locale alone in all five modes, identical to supplying the full catalog', () => {
+test('bundled es, ko, and ar render from meta.locale alone in all five modes, identical to supplying the full catalog', () => {
const cases = {
es: {
catalog: ES_TRANSLATIONS, legend: 'Leyenda', focus: 'Enfocar', exportLabel: 'Exportar diagrama',
@@ -267,6 +267,11 @@ test('bundled es and ko render from meta.locale alone in all five modes, identic
catalog: KO_TRANSLATIONS, legend: '범례', focus: '포커스', exportLabel: '다이어그램 내보내기',
titleSuffix: ' 다이어그램', description: /<desc id="archify-diagram-description">Archify로 생성한/,
},
+ ar: {
+ catalog: JSON.parse(fs.readFileSync(path.join(skillRoot, 'locales/ar.json'), 'utf8')),
+ legend: 'المفتاح', focus: 'إبراز', exportLabel: 'تصدير المخطّط',
+ titleSuffix: ' — مخطّط', description: /<desc id="archify-diagram-description">مخطّط/,
+ },
};
for (const [locale, expected] of Object.entries(cases)) {
assert.equal(validateTranslations(expected.catalog).coverage, 1);
@@ -694,3 +699,35 @@ test('Share Card and export failures use catalog messages instead of fixed Engli
assert.ok(!template.includes(hardcoded), hardcoded);
}
});
+
+test('Arabic route and reach summaries use count-neutral labels and preserve direction and maximum depth', () => {
+ // The existing one/other API cannot select Arabic dual/few/many forms.
+ // Label/value wording keeps these summaries correct without changing it.
+ for (const count of [0, 1, 2, 3, 10, 11, 100]) {
+ const nodes = translateCount('ar', 'viewer.export.card.node', count);
+ const links = translateCount('ar', 'viewer.export.card.link', count);
+ const hops = translateCount('ar', 'viewer.export.card.hop', count);
+ assert.equal(nodes, `عدد العُقد: ${count}`);
+ assert.equal(links, `عدد الروابط: ${count}`);
+ assert.equal(hops, `عدد القفزات: ${count}`);
+ assert.equal(
+ translateCount('ar', 'viewer.export.card.routeSummary', count, { source: 'API Gateway', target: 'قاعدة البيانات' }),
+ `المسار: من API Gateway إلى قاعدة البيانات · عدد الخطوات: ${count}`,
+ );
+ for (const direction of ['upstream', 'downstream']) {
+ const label = translateMessage('ar', `viewer.export.direction.${direction}`);
+ assert.equal(
+ translateCount('ar', `viewer.passport.reach.${direction}`, count),
+ `تتبّع العُقد المُؤَلَّفة نحو ${label} (العدد: ${count})`,
+ );
+ assert.equal(
+ translateMessage('ar', 'viewer.export.card.reachSummary', { direction: label, origin: 'API Gateway', nodes, links, hops }),
+ `الامتداد المُؤَلَّف نحو ${label} من API Gateway · ${nodes} · ${links} · ${hops} كحد أقصى`,
+ );
+ assert.equal(
+ translateMessage('ar', 'viewer.passport.reach.status', { direction: label, nodes: count, links: count, hops: count }),
+ `${label} · عدد العُقد: ${count} · عدد الروابط: ${count} · أقصى عدد للقفزات: ${count}`,
+ );
+ }
+ }
+});