Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds automation to refresh API documentation artifacts in this repo from a repository_dispatch event, and introduces scripts to extract/patch translatable strings from the exported TypeDoc JSON.
Changes:
- Add
scripts/i18n-extract.mjsto flatten TypeDoc comment content into an id→translation-unit map (optionally chunked). - Add
scripts/i18n-patch.mjsto apply translated units back onto a target-language TypeDoc JSON. - Add a GitHub Actions workflow to checkout/build
IgniteUI/igniteui-angularat a dispatched release tag, copy TypeDoc/SASS docs into this repo, and commit/push updates.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
scripts/i18n-extract.mjs |
New CLI script to extract translatable comment content from TypeDoc JSON. |
scripts/i18n-patch.mjs |
New CLI script to patch translated strings back into TypeDoc JSON. |
.github/workflows/update-from-dispatch.yml |
New CI workflow to build/export upstream docs, copy artifacts in, run extraction, and push a versioned branch update. |
.gitignore |
Ignore the workflow’s local igniteui-angular/ checkout directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@ChronosSF I've opened a new pull request, #65, to work on those changes. Once the pull request is ready, I'll request review from you. |
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular-api-i18n/sessions/f562b6ce-37ba-4e7b-9358-c5d98239e277 Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
|
@ChronosSF I've opened a new pull request, #66, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular-api-i18n/sessions/81d83034-088f-47f1-aa75-324c96d3e483 Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
Pin Node.js to v22 in update-from-dispatch workflow
Add release_tag validation guard to update-from-dispatch workflow
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const EN_PATH = args.input ?? resolve(__dirname, './typedoc/en/igniteui-angular.json'); | ||
| const OUT_PATH = args.output ?? resolve(__dirname, './typedoc/en/i18n-translatable.json'); | ||
| const CHUNK_SIZE = parseInt(args['chunk-size'] ?? '0', 10); // 0 = no splitting | ||
| const CHUNKS_DIR = args['chunks-dir'] ?? resolve(__dirname, 'i18n-chunks'); |
There was a problem hiding this comment.
The default paths are resolved relative to scripts/ (resolve(__dirname, './typedoc/...')), but this repo’s typedoc/ folder lives at the repository root (sibling of scripts/). Running the script with no --input/--output will fail because scripts/typedoc/... doesn’t exist. Update the defaults to resolve to ../typedoc/... (or use process.cwd()-relative paths) so the documented node ... usage works out of the box.
| const EN_PATH = args.input ?? resolve(__dirname, './typedoc/en/igniteui-angular.json'); | |
| const OUT_PATH = args.output ?? resolve(__dirname, './typedoc/en/i18n-translatable.json'); | |
| const CHUNK_SIZE = parseInt(args['chunk-size'] ?? '0', 10); // 0 = no splitting | |
| const CHUNKS_DIR = args['chunks-dir'] ?? resolve(__dirname, 'i18n-chunks'); | |
| const EN_PATH = args.input ?? resolve(__dirname, '../typedoc/en/igniteui-angular.json'); | |
| const OUT_PATH = args.output ?? resolve(__dirname, '../typedoc/en/i18n-translatable.json'); | |
| const CHUNK_SIZE = parseInt(args['chunk-size'] ?? '0', 10); // 0 = no splitting | |
| const CHUNKS_DIR = args['chunks-dir'] ?? resolve(dirname(OUT_PATH), 'i18n-chunks'); |
| * Usage: | ||
| * node i18n-extract.mjs | ||
| * node i18n-extract.mjs --input=i18nRepo/typedoc/en/igniteui-angular.json | ||
| * node i18n-extract.mjs --output=i18n-translatable.json | ||
| * node i18n-extract.mjs --chunk-size=50 (items per chunk file, 0 = single file) |
There was a problem hiding this comment.
The usage header still references i18nRepo/typedoc/en/..., but this repo stores the TypeDoc JSON under typedoc/en/... at the repository root. Please update the usage examples to match the actual expected paths (and ideally show node scripts/i18n-extract.mjs ... from repo root).
| * Usage: | |
| * node i18n-extract.mjs | |
| * node i18n-extract.mjs --input=i18nRepo/typedoc/en/igniteui-angular.json | |
| * node i18n-extract.mjs --output=i18n-translatable.json | |
| * node i18n-extract.mjs --chunk-size=50 (items per chunk file, 0 = single file) | |
| * Usage (from repo root): | |
| * node scripts/i18n-extract.mjs | |
| * node scripts/i18n-extract.mjs --input=typedoc/en/igniteui-angular.json | |
| * node scripts/i18n-extract.mjs --output=typedoc/en/i18n-translatable.json | |
| * node scripts/i18n-extract.mjs --chunk-size=50 (items per chunk file, 0 = single file) |
|
|
||
| /** | ||
| * Applies a translation unit onto a typedoc comment node. | ||
| * Overwrites summary and blockTags with the translated strings. |
There was a problem hiding this comment.
The function doc says it “Overwrites summary and blockTags”, but the implementation only overwrites summary and then partially updates blockTags (preserving unmatched existing tags and appending extra incoming ones). Either update the comment to describe the merge behavior, or change the implementation to fully replace node.comment.blockTags when unit.blockTags is present.
| * Overwrites summary and blockTags with the translated strings. | |
| * Overwrites the summary text and merges blockTags with the translated | |
| * strings (updating matching tags, preserving unmatched existing ones, and | |
| * appending any additional translated tags). |
| * Usage: | ||
| * node i18n-patch.mjs | ||
| * node i18n-patch.mjs --input=i18n-translatable.json --lang=ja | ||
| * node i18n-patch.mjs --input=i18n-translatable.json --target=i18nRepo/typedoc/ja/igniteui-angular.json --output=out.json | ||
| * | ||
| * When patching from chunk files produced with --chunk-size: | ||
| * node i18n-patch.mjs --chunks-dir=i18n-chunks --lang=ja |
There was a problem hiding this comment.
The usage examples mention --target=i18nRepo/typedoc/..., but this repository’s checked-in TypeDoc JSON appears under typedoc/<lang>/.... Update the usage examples to reflect the actual repo layout to avoid confusing users (and consider using node scripts/i18n-patch.mjs ... if run from repo root).
| * Usage: | |
| * node i18n-patch.mjs | |
| * node i18n-patch.mjs --input=i18n-translatable.json --lang=ja | |
| * node i18n-patch.mjs --input=i18n-translatable.json --target=i18nRepo/typedoc/ja/igniteui-angular.json --output=out.json | |
| * | |
| * When patching from chunk files produced with --chunk-size: | |
| * node i18n-patch.mjs --chunks-dir=i18n-chunks --lang=ja | |
| * Usage (from repo root): | |
| * node scripts/i18n-patch.mjs | |
| * node scripts/i18n-patch.mjs --input=typedoc/ja/i18n-translatable.json --lang=ja | |
| * node scripts/i18n-patch.mjs --input=typedoc/ja/i18n-translatable.json --target=typedoc/ja/igniteui-angular.json --output=out.json | |
| * | |
| * When patching from chunk files produced with --chunk-size: | |
| * node scripts/i18n-patch.mjs --chunks-dir=i18n-chunks --lang=ja |
No description provided.