fhir-ig-translation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTranslating a FHIR Implementation Guide
翻译FHIR实施指南
Experimental. This skill has not been verified against a real task since its last change. Verify its output before relying on it.
Produces the translation supplements of an IG-Publisher-based guide and puts them exactly where
the publisher looks for them. The guide's own configuration decides which language is the source and
which are the translations — this skill reads that rather than assuming it.
实验性技能。本技能自上次修改后尚未通过真实任务验证。在依赖其输出之前,请先验证结果。
生成基于IG-Publisher的指南所需的翻译补充包,并将其精准放置在Publisher查找的位置。指南自身的配置会决定源语言和目标语言——本技能会读取该配置而非自行假设。
Preconditions
前置条件
-
Locate the guide. From the working directory, expecttogether with a
input/pagecontent/or ansushi-config.yaml.ig.inichecks this itself and exits 2 with a message if the directory is not an IG project — it deliberately does not report "nothing to translate", which is what a silent failure here looks like.scripts/ig-translate.sh -
Derive the language pair — never assume it. Read the guide's own:
sushi-config.yamlyamlparameters: i18n-default-lang: en # the SOURCE language i18n-lang: - de # the TARGET language(s) translation-sources: - input/translations/de- is the source: the language
i18n-default-langis written in, and the authoritative text.input/pagecontent/ - each entry is a target: a language that gets a rendering under
i18n-lang./<lang>/ - If is absent, the publisher's default applies and the source language is not declared. Report that and ask rather than guessing — a guess here puts every file in the wrong place.
i18n-default-lang - If no is configured, there is no target language yet. Adding one is a change to the guide's configuration and a decision for its maintainer, not for this skill.
i18n-lang
This is the step that must not be skipped. The MII reversed its own default from German to English once; a skill that had hard-coded the old direction would have placed every file wrongly while reporting success. -
Build first. Resource supplements need generated resources: the publisher writesand generates supplement templates per resource on each build. Translating before a green build means inventing
fsh-generated/resources/values, which is fabrication.msgid -
Check whether this is the guide's problem or the template's. Language support is usually split between an IG and the template package it renders with, and the split is about responsibility, not paths:
- This skill covers the guide's own content: supplements and translated pages under
.
input/translations/<lang>/ - A template package owns the language mechanism and policy — language-neutral header/footer/CSS, inherited UI-string catalogues, and the choice of default language.
For the MII KDS module template that template package is https://github.com/forschungsgruppe-digital-health/ig-template-mii-kds, which carries its own skill for those obligations. If the task is "keep the template's overrides language-neutral", that is the template's problem, not this one. - This skill covers the guide's own content: supplements and translated pages under
-
定位指南目录。从工作目录出发,需存在目录,以及
input/pagecontent/或sushi-config.yaml文件。ig.ini会自行检查该条件,若当前目录不是IG项目则会以退出码2终止并给出提示——它不会刻意报告“无内容可翻译”,这是静默失败的表现。scripts/ig-translate.sh -
推导语言对——绝不自行假设。读取指南自身的文件:
sushi-config.yamlyamlparameters: i18n-default-lang: en # 源语言 i18n-lang: - de # 目标语言 translation-sources: - input/translations/de- 为源语言:
i18n-default-lang目录下内容所使用的语言,也是权威文本语言。input/pagecontent/ - 每个条目为目标语言:会在
i18n-lang路径下生成对应语言的版本。/<lang>/ - 若缺失,则使用Publisher的默认设置,且源语言未声明。此时需报告该情况并询问用户,而非自行猜测——错误的猜测会导致所有文件存放位置错误。
i18n-default-lang - 若未配置,则当前无目标语言。添加目标语言属于指南配置变更,需由指南维护者决定,而非本技能处理。
i18n-lang
此步骤不可跳过。MII曾将自身默认语言从德语改为英语;若技能硬编码旧的语言方向,会导致所有文件存放错误却仍报告成功。 -
先完成构建。资源补充包需要已生成的资源:Publisher会生成目录,并在每次构建时为每个资源生成补充包模板。在构建成功前进行翻译意味着自行编造
fsh-generated/resources/值,这属于伪造内容。msgid -
区分问题归属:指南还是模板。语言支持通常分为IG指南和其使用的模板包两部分,区分依据是责任范围而非路径:
- 本技能负责指南自身内容:下的补充包和翻译页面。
input/translations/<lang>/ - 模板包负责语言机制和策略:与语言无关的页眉/页脚/CSS、继承的UI字符串目录,以及默认语言的选择。
针对MII KDS模块模板,对应的模板包为https://github.com/forschungsgruppe-digital-health/ig-template-mii-kds,该包有专门的技能处理相关职责。若任务为“保持模板的覆盖内容与语言无关”,则属于模板包的问题,而非本技能的处理范围。 - 本技能负责指南自身内容:
Procedure
操作步骤
Output language: the target language derived in Preconditions 2. These instructions are English;
what this skill produces is prose in the target language. Neither follows from the other, so it is
stated. The examples below use as the target because that is the common case here; substitute
the language you actually derived.
deResolve the script path first. The commands below name the tool relative to this skill's own directory, not to your working directory — which is the project you are operating on. Setto the directory containing thisSKILL_DIR(you just read it, so you know where it is) and use it in every invocation:SKILL.mdbashSKILL_DIR=<the directory containing this SKILL.md> # e.g. .claude/skills/fhir-ig-translationRunning a barefrom the project root does not merely fail — if the project happens to have its ownscripts/...directory with a same-named file, it silently runs that instead.scripts/
-
Scan to get the target path for every page and resource:bash
bash "$SKILL_DIR/scripts/ig-translate.sh" --scan <lang> # cwd = the guide's root bash "$SKILL_DIR/scripts/ig-translate.sh" --scan <lang> path/to/ig # or point at itThe language argument is required — the script refuses to default it, so no run can silently translate into a language nobody chose. -
Resource supplements. One file per StructureDefinition, CodeSystem or Questionnaire at, where
input/translations/<lang>/<Type>-<id>.pois the exact source text frommsgidandfsh-generated/resources/<Type>-<id>.jsonis the translation. Copy the publisher's generated template rather than hand-writing themsgstr.msgid -
Narrative pages. One translation per page at— the same file name, the same structure, the same links, FHIR identifiers unchanged. Never a
input/translations/<lang>/pagecontent/<same-filename>.mdsibling in<name>-<lang>.md: the toolchain renders that as a separate page, not as a translation.input/pagecontent/ -
Menu, if the guide has one:, mirroring
input/translations/<lang>/includes/menu.xml. Ainput/includes/menu.xmlproperty inmenu:generates one untranslatable menu and competes with this — it must not be used alongside.sushi-config.yaml -
The IG-level catalogue. Not a resource supplement and not optional: without it the
input/translations/<lang>/ImplementationGuide-<ig-id>.po-tree page titles stay in the default language, sopages:renders localized page bodies under default-language breadcrumbs./<lang>/is the<ig-id>ofid; build the unit set from that file'sfsh-generated/resources/ImplementationGuide-<id>.jsontree — the authoritative page set — usingdefinition.pageonly as a wording seed, and emit an emptyinput/includes/menu.xmlplus a review flag for every title left untranslated.msgstrThe siblingskill bundles a generator for exactly this file. It is a precondition, not an assumption: a consumer may have installed this skill alone, in which case the sibling path does not exist. Check first, and when it is absent either install it with the pinned command below or write the units by hand — never proceed on a path that does not resolve. Invoke it through a resolvedmii-ig-migration, never a bare$SKILL_DIR, which the project's ownscripts/…would shadow:scripts/bashGEN="$SKILL_DIR/../mii-ig-migration/scripts/gen-page-title-po.py" if [ -f "$GEN" ]; then python3 "$GEN" --help; else echo "gen-page-title-po.py not installed — install the sibling skill, or write the units by hand:" echo 'npx skills add "https://github.com/forschungsgruppe-digital-health/agent-skills/tree/v0.12.0" --skill mii-ig-migration --agent claude-code codex --yes' fiTheform is what pins;/tree/<ref>does not — in that CLIowner/repo@<ref>introduces a skill name and the command silently installs from the default branch.@Read that script's header before regenerating an existing catalogue: the same file also carries hand-added units (the guide's, per-artifact names) that the generator does not own, and its header states how it treats them.title -
Validate, then build:bash
bash "$SKILL_DIR/scripts/ig-translate.sh" --validate <lang>Findings () exit 1; a run that finds nothing to validate says so explicitly and exits 0 — add[WARN]to make an empty translation set fail too, which is the right wiring for CI.--strict -
Bilingual human review is mandatory before the translated rendering is trusted. Mark every machine translationuntil a human has signed it off.
TODO:REVIEW
输出语言:前置条件2中推导的目标语言。以下说明使用英文,但本技能生成的内容为目标语言的文本。两者相互独立,特此说明。下方示例使用作为目标语言(这是常见场景),请替换为实际推导的语言。
de先确定脚本路径。下方命令中的工具路径是相对于本技能自身目录,而非你的工作目录(即你正在操作的项目目录)。设置为包含此SKILL_DIR的目录(你正在阅读该文件,所以知道其位置),并在每次调用时使用该变量:SKILL.mdbashSKILL_DIR=<包含此SKILL.md的目录> # 示例:.claude/skills/fhir-ig-translation若直接从项目根目录运行,不仅会失败——如果项目恰好有自己的scripts/...目录且包含同名文件,会静默运行项目自身的脚本,而非本技能的脚本。scripts/
-
扫描以获取每个页面和资源的目标路径:bash
bash "$SKILL_DIR/scripts/ig-translate.sh" --scan <lang> # 当前工作目录 = 指南根目录 bash "$SKILL_DIR/scripts/ig-translate.sh" --scan <lang> path/to/ig # 或直接指定指南路径语言参数为必填项——脚本拒绝使用默认值,因此不会出现静默翻译为无人选择的语言的情况。 -
资源补充包。每个StructureDefinition、CodeSystem或Questionnaire对应一个文件,路径为,其中
input/translations/<lang>/<Type>-<id>.po为msgid中的精确源文本,fsh-generated/resources/<Type>-<id>.json为翻译内容。请复制Publisher生成的模板,而非手动编写msgstr。msgid -
叙述性页面。每个页面对应一个翻译文件,路径为——文件名、结构、链接保持一致,FHIR标识符不做修改。绝对不要在
input/translations/<lang>/pagecontent/<相同文件名>.md目录下创建input/pagecontent/同级文件:工具链会将其渲染为独立页面,而非翻译版本。<name>-<lang>.md -
菜单(若指南有菜单):,与
input/translations/<lang>/includes/menu.xml结构一致。若input/includes/menu.xml中有sushi-config.yaml属性,会生成一个不可翻译的菜单并与此方式冲突——请勿同时使用。menu: -
IG级目录文件。这不是资源补充包,且为必填项:若无此文件,
input/translations/<lang>/ImplementationGuide-<ig-id>.po树的页面标题会保持默认语言,导致pages:路径下显示本地化的页面内容,但面包屑仍为默认语言。/<lang>/为<ig-id>中的fsh-generated/resources/ImplementationGuide-<id>.json;需从该文件的id树(权威页面集合)构建单元集——仅将definition.page作为措辞参考,并为每个未翻译的标题生成**空input/includes/menu.xml**及审核标记。msgstr同级的技能包含此文件的生成器。这是一个前置条件而非假设:用户可能仅安装了本技能,此时同级路径不存在该生成器。请先检查,若不存在则使用下方固定命令安装该技能,或手动编写单元集——绝对不要在路径不存在的情况下继续操作。请通过已解析的mii-ig-migration调用,而非直接使用$SKILL_DIR,否则会被项目自身的scripts/…目录覆盖:scripts/bashGEN="$SKILL_DIR/../mii-ig-migration/scripts/gen-page-title-po.py" if [ -f "$GEN" ]; then python3 "$GEN" --help; else echo "gen-page-title-po.py未安装——请安装同级技能,或手动编写单元集:" echo 'npx skills add "https://github.com/forschungsgruppe-digital-health/agent-skills/tree/v0.12.0" --skill mii-ig-migration --agent claude-code codex --yes' fi格式用于固定版本;/tree/<ref>无法固定版本——在该CLI中owner/repo@<ref>用于指定技能名称,命令会静默从默认分支安装。@在重新生成现有目录文件前,请阅读该脚本的头部说明:同一文件还包含手动添加的单元(指南的、每个制品的名称),生成器不会覆盖这些内容,脚本头部说明了其处理方式。title -
验证并构建:bash
bash "$SKILL_DIR/scripts/ig-translate.sh" --validate <lang>检测到问题()会以退出码1终止;若检测到“无内容可验证”会明确提示并以退出码0终止——添加[WARN]参数可使空翻译集也触发失败,这是CI环境的正确配置。--strict -
双语人工审核为强制要求,在信任翻译版本前必须执行。将所有机器翻译内容标记为,直至人工确认通过。
TODO:REVIEW
Harvest mode — adopting an existing rendering
提取模式——采用现有翻译版本
When a rendering in the target language already exists somewhere, harvest it instead of
re-translating:
- Fill in : the source of the target-language text (a parallel rendered guide for narrative; FSH
references/harvest-config.yamlextensions ortranslations for resource texts) and the page/artefact mapping.designation - Resources: move the existing designations or translation extensions into
. The page titles of the existing rendering are a translation seed for the IG-level catalogue (step 5), not a substitute for it.
input/translations/<lang>/<Type>-<id>.po - Narrative: copy the page content into
, citing the source path per page. Invent nothing; mark anything unclear
input/translations/<lang>/pagecontent/<name>.md.TODO:REVIEW - Validate, build and review as above.
当目标语言的版本已在其他位置存在时,请提取该版本而非重新翻译:
- 填写:目标语言文本的来源(叙述性内容可使用平行渲染的指南;资源文本可使用FSH
references/harvest-config.yaml扩展或translations),以及页面/制品的映射关系。designation - 资源:将现有的designations或translation扩展移动至。现有版本的页面标题可作为IG级目录文件(步骤5)的翻译参考,但不能替代该文件。
input/translations/<lang>/<Type>-<id>.po - 叙述性内容:将页面内容复制到,并为每个页面注明来源路径。请勿编造内容;将任何不明确的内容标记为
input/translations/<lang>/pagecontent/<name>.md。TODO:REVIEW - 按上述步骤进行验证、构建和审核。
What the toolchain actually renders
工具链实际渲染逻辑
Verified with IG Publisher 2.2.11 and 0.1.0 (2026-07) unless the row says
otherwise — one row rests on HL7's reference IG, whose live build was produced by publisher
2.0.13, and one row is explicitly unverified. Each row states its own basis; do not read the
heading as covering all of them. This is publisher behaviour and applies to any language pair.
fhir2.base.template| Content | Translatable? | Mechanism |
|---|---|---|
Narrative pages ( | Yes, renders | |
Resource texts of StructureDefinition, CodeSystem, Questionnaire ( | Yes, renders | Supplement |
Menu ( | Yes | |
ImplementationGuide own | Yes, renders — but observed on the 2.0.13 reference build, not on our pin | |
ImplementationGuide | Unverified | Units for these exist in the reference catalogue and belong in the same file; no rendering was observed for them, on either build. |
Breadcrumbs & titles of | Yes, renders | |
ValueSet, | Partial / No — unresolved | Not applied from a plain |
A language in | No — silently | Its |
Treat this table as ground truth, and re-verify it whenever the pinned IG Publisher or base
template version changes. Read the pins from the guide's own build workflow, not from this file.
Obsolete claims, recorded so they are not reintroduced:
- An earlier version of this skill used a sibling for pages and stated that narrative pages were "not yet" renderable. Both were wrong. The correct mechanism is a translation-source folder, as HL7's own
<name>-<lang>.mddemonstrates.FHIR/multi-lang-test-ig - This skill claimed that is "ignored by the Publisher", that there is "no supplement mechanism" for the IG title, and that default-language breadcrumbs on
ImplementationGuide-<id>.po-tree pages are "a toolchain limitation, not a defect" requiring the MII template'spages:workaround. All wrong: it generalizedbreadcrumb-titles-de.txt— which really does restrict resource supplements — to the IG resource, which is translated by a separate load-time import. The page-title mechanism was verified on 2.2.11 (our pin) against an MII KDS module with the template's breadcrumb override deleted; HL7's reference IG ships such aTRANSLATION_SUPPLEMENT_RESOURCE_TYPESand its live build — produced by 2.0.13 — renders.po/esbreadcrumbs from it. That says nothing about since when the publisher supports this: no support floor is claimed, and none should be inferred from those two version numbers. The real cause of "translations do not apply" is usually thenlfootgun in the table above.translation-sources
除非另有说明,以下内容基于IG Publisher 2.2.11和 0.1.0(2026-07)验证——其中一行基于HL7的参考IG,其在线版本由Publisher 2.0.13生成,另一行明确为未验证内容。每行均注明其验证依据;请勿认为标题覆盖所有内容。这是Publisher的行为,适用于任何语言对。
fhir2.base.template| 内容 | 是否可翻译? | 实现机制 |
|---|---|---|
叙述性页面 ( | 是,可渲染 | |
StructureDefinition、CodeSystem、Questionnaire的资源文本( | 是,可渲染 | 补充文件 |
菜单 ( | 是 | |
ImplementationGuide自身的 | 是,可渲染——但仅在2.0.13参考版本中验证,未在我们固定的版本中验证 | |
ImplementationGuide的 | 未验证 | 参考目录中包含这些单元,应放在同一文件中;未在任何版本中观察到渲染效果。 |
| 是,可渲染 | 同一IG级 |
ValueSet的 | 部分支持/不支持——未解决 | 在当前工具链中,普通 |
| 否——静默失效 | 其 |
请将此表格视为事实依据,并在固定的IG Publisher或基础模板版本变更时重新验证。请从指南自身的构建工作流中读取固定版本,而非从此文件中读取。
已过时的错误声明(记录以避免重新引入):
- 本技能早期版本使用同级文件处理页面,并声称叙述性页面“尚未”可渲染。两种说法均错误。正确的机制是使用翻译源文件夹,如HL7自身的
<name>-<lang>.md所示。FHIR/multi-lang-test-ig - 本技能曾声称“被Publisher忽略”、IG标题“无补充机制”,且
ImplementationGuide-<id>.po树页面的默认语言面包屑是“工具链限制而非缺陷”,需要MII模板的pages:workaround。所有说法均错误:它将breadcrumb-titles-de.txt(确实限制资源补充包)的范围泛化到了IG资源,而IG资源是通过单独的加载时导入进行翻译的。页面标题机制已在2.2.11版本(我们固定的版本)中验证:迁移后的MII KDS模块删除了模板的面包屑覆盖内容;HL7的参考IG包含此类TRANSLATION_SUPPLEMENT_RESOURCE_TYPES文件,其在线版本(由2.0.13生成)从中渲染.po/es语言的面包屑。这并未说明Publisher从哪个版本开始支持此机制:未声明最低支持版本,也不应从这两个版本号中推断。“翻译未生效”的真正原因通常是表格中提到的nl陷阱。translation-sources
Verification
验证
bash
bash "$SKILL_DIR/scripts/ig-translate.sh" --validate <lang> # --strict: empty set fails too- Exit 2 with a clear message when run outside an IG, or when the language argument is missing — a silent empty scan is the failure mode this guards against.
- reports
--validateper supplement and per page, and no[OK]; any[WARN]exits 1, and its summary line states how many supplements and pages were actually checked. "Checked: 0" with exit 0 is an explicit nothing to validate, never a claim that translations are valid ([WARN]turns it into a failure).--strict - The script WARNs when is not among the guide's
<lang>targets or wheni18n-langis undeclared — a best-effort echo of Preconditions 2, not a substitute for it.i18n-default-lang - Every filename is
.poand matches a real<Type>-<id>— includingfsh-generated/resources/<Type>-<id>.json, which is a legitimate file, not a naming error.ImplementationGuide-<ig-id>.po - No supplement exists for an unsupported type, and no exists — the publisher ignores both.
menu.po - Every entry has a matching
i18n-langentry; otherwise that language'stranslation-sourcesfiles are ignored silently..po - Every translated page has a source page of the same name under .
input/pagecontent/ - After a build, artefact pages show the translated element texts and
/<lang>/narrative pages render in the target language./<lang>/ - After a build with an IG-level ,
.pobreadcrumbs, the TOC page body and the browser/<lang>/are in the target language, and<title>carries atemp/pages/_data/pages.jsonthat differs from the default-language title for every page in thetitlelangtree. A page whosepages:still equals the source title has no unit, or an emptytitlelang, or the language is missing frommsgstr.translation-sources - The default-language and the FSH sources are unchanged —
input/pagecontent/on them is empty.git diff
bash
bash "$SKILL_DIR/scripts/ig-translate.sh" --validate <lang> # --strict: 空翻译集也会失败- 在IG目录外运行或缺少语言参数时,以退出码2终止并给出明确提示——这是为了防止静默空扫描的失败模式。
- 会为每个补充包和页面报告
--validate,无[OK];若存在[WARN]则以退出码1终止,摘要行说明实际检查的补充包和页面数量。“已检查:0”且退出码0表示明确的“无内容可验证”,而非声称翻译有效([WARN]会将其转为失败)。--strict - 当不在指南的
<lang>目标语言中,或i18n-lang未声明时,脚本会发出警告——这是对前置条件2的尽力检查,而非替代该步骤。i18n-default-lang - 每个文件名均为
.po,且与真实的<Type>-<id>文件匹配——包括fsh-generated/resources/<Type>-<id>.json,这是合法文件,而非命名错误。ImplementationGuide-<ig-id>.po - 不存在不支持类型的补充包,也不存在文件——Publisher会忽略这两种文件。
menu.po - 每个条目都有对应的
i18n-lang条目;否则该语言的translation-sources文件会被静默忽略。.po - 每个翻译页面在下都有同名的源页面。
input/pagecontent/ - 构建完成后,路径下的制品页面显示翻译后的元素文本,
/<lang>/路径下的叙述性页面以目标语言渲染。/<lang>/ - 添加IG级文件并构建后,
.po路径下的面包屑、TOC页面内容和浏览器/<lang>/均为目标语言,且<title>包含temp/pages/_data/pages.json字段,与titlelang树中每个页面的默认语言标题不同。若某个页面的pages:仍与源标题相同,则表示该页面无对应单元、titlelang为空,或该语言未在msgstr中声明。translation-sources - 默认语言的和FSH源文件未被修改——对其执行
input/pagecontent/结果为空。git diff
Guardrails
约束规则
- The default-language source stays leading and binding. A translation is a rendering aid, never
the normative text. Which language that is comes from , not from this file.
i18n-default-lang - Never change the source. Translations are additive under .
input/translations/<lang>/ - FHIR identifiers stay untranslated — ,
name, codes and canonical URLs are not language.id - No invention. Mark every machine translation ; bilingual human review is mandatory.
TODO:REVIEW - Only on confirmation. The default is a dry-run scan.
- Propose, do not merge. Deliver changes as a pull request, and determine the target branch
from the repository's own convention — do not assume one. An earlier version of this skill
hard-coded , which is one repository's convention and wrong everywhere else.
dev
- 默认语言源文件始终为权威版本。翻译仅为渲染辅助,绝非规范性文本。默认语言由决定,而非此文件。
i18n-default-lang - 绝不修改源文件。翻译内容为下的新增内容。
input/translations/<lang>/ - FHIR标识符保持不翻译——、
name、代码和规范URL不属于语言内容。id - 不编造内容。将所有机器翻译内容标记为;双语人工审核为强制要求。
TODO:REVIEW - 仅在确认后执行。默认执行空运行扫描。
- 仅提交建议,不直接合并。将变更作为拉取请求提交,并根据仓库自身约定确定目标分支——不要自行假设。本技能早期版本硬编码分支,这仅适用于某一个仓库的约定,在其他仓库均不适用。
dev
Scope and delimitation
范围与边界
Covers producing and placing a guide's translation supplements, in both directions of
provenance: translating the default-language source, or harvesting an existing rendering.
Deliberately not covered:
- Measuring or comparing guides — see .
fhir-ig-analysis - Migrating a guide onto the MII KDS module template — see , which sets translation up as one step of a migration and then hands over here.
mii-ig-migration - A template package's language mechanism and policy — a different repository's concern; see Preconditions 4.
- Choosing the guide's languages. Adding an entry changes the guide's configuration and is its maintainer's decision.
i18n-lang - Judging whether a translation is good. That is the mandatory human review, not this skill.
If a skill of this name is provided both by this catalog and locally, the local one wins.
涵盖生成并放置指南的翻译补充包,支持两种来源方向:从默认语言源文件翻译,或从现有版本提取。
明确不涵盖的内容:
- 指南的度量或对比——请参考技能。
fhir-ig-analysis - 将指南迁移至MII KDS模块模板——请参考技能,该技能将翻译设置作为迁移的一个步骤,之后移交至本技能处理。
mii-ig-migration - 模板包的语言机制和策略——属于其他仓库的职责;请参考前置条件4。
- 选择指南的语言。添加条目属于指南配置变更,需由指南维护者决定。
i18n-lang - 判断翻译质量。这是强制人工审核的职责,而非本技能的处理范围。
若本技能在本地和技能目录中均存在,优先使用本地版本。
References
参考资料
- — the full mechanics, file conventions and formats.
references/translate-spec.md - — configuration schema for harvest mode.
references/harvest-config.yaml - — the Gate 3 prompt set.
references/triggers.md - — scan and validate; dry-run by design, it writes nothing. It scans for the IG-level catalogue alongside the resource supplements and accepts it in
scripts/ig-translate.sh; genuinely unsupported types still WARN. Validation findings exit 1;--validatealso fails an empty translation set.--strict
- —— 完整的机制、文件约定和格式说明。
references/translate-spec.md - —— 提取模式的配置 schema。
references/harvest-config.yaml - —— Gate 3提示集。
references/triggers.md - —— 扫描和验证工具;默认执行空运行,不写入任何内容。它会扫描IG级目录文件和资源补充包,并在
scripts/ig-translate.sh时接受该文件;真正不支持的类型仍会发出警告。验证到问题会以退出码1终止;--validate参数会使空翻译集也触发失败。--strict
Provenance
来源说明
Derived from in
at commit
, which in turn adapted the skill of
(CC-BY-4.0) and refocused it on the
module side. Both steps of that lineage are recorded deliberately.
skills/ig-translateforschungsgruppe-digital-health/mii-kds-module-templateb5beedb17a66a4397d597429668c7b6d54202c62ig-translateforschungsgruppe-digital-health/mii-kds-sample-ig-inoffiziellReworked on 2026-07-31 for this catalog. Beyond the catalog contract, four substantive changes:
- The helper now ships with the skill. It previously lived in the source repository's and was referenced by parent traversal.
scripts/ - operates on the current working directory and detects whether it is an IG project. It previously did
scripts/ig-translate.sh, assuming it sat incd "$(dirname "$0")/.."; installed as part of a skill that<module-repo>/scripts/reaches the skill directory, and the scan would have reported every page as missing.cd - The branch target was removed from the description and the guardrails, and replaced by discovering the repository's own convention.
dev - The language pair is derived, not assumed. The inherited skill was written for one direction
(→
en) and for MII KDS modules specifically, which made adeprefix on its name an overclaim. It now readsfhir-andi18n-default-langfrom the guide being worked on, the script requires an explicit language argument instead of defaulting toi18n-lang, and the mechanics are stated for any language pair. That is what earns the prefix.de
Revised on 2026-08-01 after the skill's first real-task exercise (a dry run against
): findings now exit 1 and an empty translation set is
reported explicitly (and fails under ) instead of an unconditional exit 0; the script
cross-checks against the guide's i18n parameters with best-effort warnings; the harvest
config's example now covers non-English source page names; and the
grant covers executing the bundled bash script. The dry-run findings live in the
sandbox under .
kerndatensatz-dokument--validate--strict<lang>page_mapallowed-toolsmii-kds-dokument-ig-inoffizielldocs/reports/dry-run-2026-07-31/Revised on 2026-08-05 to retire a documented false claim: that the publisher cannot localize the
titles of -tree pages and that an is ignored. Evidence, and
nothing beyond it:
pages:ImplementationGuide-<id>.po- Our own build on our own pin (IG Publisher 2.2.11) — the migrated MII KDS Dokument guide with
the template's breadcrumb override deleted and 23 units supplied:
page.titlebreadcrumbs German including the root label "Inhaltsverzeichnis", the TOC page body German, the browser/de/German, and<title>temp/pages/_data/pages.jsondiffering en/de for all 23 pages (zero before). Build health unchanged (sushi 0 errors, QA err=7 = the established baseline). The left-hand nav,titlelang,IG.description,IG.publisherand artifact names were not observed on 2.2.11 and are not claimed for it.IG.name - HL7's reference IG , live build produced by publisher 2.0.13 — localized
FHIR/multi-lang-test-ig/esbreadcrumbs, a translated IG title in thenlheader, translated artifact names on/es/, and/es/artifacts.html(infr, absent fromi18n-lang) as a controlled negative. A different publisher version from ours; kept separable in the tables.translation-sources - Prior art in our own organisation: both MII template repos already carry a correct catalogue on
their branch, and
devrecords the same mechanism in the MII's ownig-template-mii-kdsmodule, "verified 2026-07-30".kerndatensatz-basis
Consequences here: the rendering table attributes every row to the build that supports it and marks
the unobserved fields unverified; the breadcrumb override is recorded as shipping in exactly one
release, template v0.5.0 (never v0.4.0 or earlier, never on ), as a misdiagnosis now being
retired; a Procedure step for the IG-level catalogue was added, pointing at the generator bundled
with ; the CodeSystem / conflict between this file and
is flagged as unresolved instead of silently decided; and
no longer WARNs on (nor fails) an — the very
file the procedure now mandates — while genuinely unsupported types still do.
devmii-ig-migrationconcept.displaydefinitionreferences/translate-spec.mdscripts/ig-translate.shImplementationGuide-<id>.poOriginal licence: CC-BY-4.0, as declared by both source repositories. is Apache-2.0,
matching this repository's code licence.
scripts/衍生自中的,提交哈希为,该版本又改编自的技能(CC-BY-4.0许可),并将其重新聚焦于模块侧。该传承的两个步骤均已明确记录。
forschungsgruppe-digital-health/mii-kds-module-templateskills/ig-translateb5beedb17a66a4397d597429668c7b6d54202c62forschungsgruppe-digital-health/mii-kds-sample-ig-inoffiziellig-translate2026-07-31针对本技能目录进行了重写。除符合目录约定外,主要有四项实质性变更:
- 辅助工具现在与技能捆绑发布。此前它位于源仓库的目录中,通过父路径引用。
scripts/ - 在当前工作目录运行,并检测该目录是否为IG项目。此前它执行
scripts/ig-translate.sh,假设它位于cd "$(dirname "$0")/.."目录;作为技能安装后,<module-repo>/scripts/会进入技能目录,扫描会报告所有页面缺失。cd - 描述和约束规则中移除了分支目标,改为根据仓库自身约定确定。
dev - 语言对通过推导获得,而非假设。继承的技能仅针对一个语言方向(→
en),且专门针对MII KDS模块,因此其名称中的de前缀名不副实。现在它会从正在处理的指南中读取fhir-和i18n-default-lang,脚本要求显式指定语言参数而非默认使用i18n-lang,且机制说明适用于任何语言对。这才使其配得上de前缀。fhir-
2026-08-01在本技能首次真实任务演练(针对的空运行)后进行了修订:检测到问题现在会以退出码1终止,空翻译集会被明确报告(在下会失败),而非无条件以退出码0终止;脚本会尽力检查是否与指南的i18n参数匹配并发出警告;提取配置的示例现在支持非英文源页面名称;权限涵盖执行捆绑的bash脚本。空运行结果存放在沙箱的目录下。
kerndatensatz-dokument--validate--strict<lang>page_mapallowed-toolsmii-kds-dokument-ig-inoffizielldocs/reports/dry-run-2026-07-31/2026-08-05修订以纠正已记录的错误声明:即Publisher无法本地化树页面的标题,且被忽略。仅基于以下证据:
pages:ImplementationGuide-<id>.po- 我们固定版本的构建(IG Publisher 2.2.11)——迁移后的MII KDS Dokument指南删除了模板的面包屑覆盖内容,并提供了23个单元:
page.title路径下的面包屑为德语(包括根标签“Inhaltsverzeichnis”),TOC页面内容为德语,浏览器/de/为德语,且<title>中的temp/pages/_data/pages.json在中英文版本中均不同(之前完全一致)。构建状态未变(sushi 0错误,QA err=7 = 既定基线)。左侧导航、titlelang、IG.description、IG.publisher和制品名称未在2.2.11版本中观察到翻译效果,因此不对其做声称。IG.name - HL7的参考IG ,在线版本由Publisher 2.0.13生成——本地化的
FHIR/multi-lang-test-ig/es语言面包屑,nl页眉中的翻译后IG标题,/es/页面上的翻译后制品名称,以及/es/artifacts.html语言(在fr中配置,但未在i18n-lang中声明)作为受控负例。这与我们的版本不同;在表格中单独列出。translation-sources - 我们组织内的既有实践:两个MII模板仓库的分支已包含正确的目录文件,
dev在MII自身的ig-template-mii-kds模块中记录了相同的机制,“已验证2026-07-30”。kerndatensatz-basis
此次修订的影响:渲染表格中每行均注明支持其的构建版本,并将未观察到的字段标记为未验证;面包屑覆盖方案被记录为仅在模板v0.5.0版本中提供(从未在v0.4.0或更早版本中提供,也未在分支中提供),作为已纠正的错误诊断;操作步骤中添加了IG级目录文件的步骤,指向技能捆绑的生成器;本文件与之间关于CodeSystem /的冲突被标记为未解决,而非静默处理;不再对发出警告(或失败)——该文件现在是操作步骤中强制要求的——而真正不支持的类型仍会发出警告。
devmii-ig-migrationreferences/translate-spec.mdconcept.displaydefinitionscripts/ig-translate.shImplementationGuide-<id>.po原始许可:CC-BY-4.0,如两个源仓库所声明。目录下的文件采用Apache-2.0许可,与本仓库的代码许可一致。
scripts/