我是i18n的新手,我需要使用单个id转换整个div,但似乎找不到任何可以帮助我将html标记转换为xliff的指南。
我已经看过本指南https://docs.oasis-open.org/xliff/v1.2/xliff-profile-html/xliff-profile-html-1.2-cd02.html,但是我还不能转换任何东西,那是我的代码
<div i18n="@@abl1">
<h2>hello</h2>
<h3>how are you</h3>
</div>
这就是我尝试过的:
<trans-unit id="abl1" datatype="html">
<source>
<x id="START_TAG_H2" ctype="x-h2" equiv-text="<h2>"/>
Hello
<x id="CLOSE_TAG_H2" ctype="x-h2" equiv-text="</h2>"/>
<x id="START_TAG_H3" ctype="x-h3" equiv-text="<h3>"/>
How are you?
<x id="CLOSE_TAG_H3" ctype="x-h3" equiv-text="</h3>"/>
</source>
<target>
<x id="START_TAG_H2" ctype="x-h2" equiv-text="<h2>"/>
Salut
<x id="CLOSE_TAG_H2" ctype="x-h2" equiv-text="</h2>"/>
<x id="START_TAG_H3" ctype="x-h3" equiv-text="<h3>"/>
Comment vas tu?
<x id="CLOSE_TAG_H3" ctype="x-h3" equiv-text="</h3>"/>
</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/propos/propos.component.html
</context>
</context-group>
</trans-unit>
当我使用跨度和强度尝试此方法时,它工作得很好,但是当我将其与h2和h3一起使用时,出现以下错误:
ERROR in Unknown placeholder "START_TAG_H2" (" [ERROR ->]
<x id="START_TAG_H2" ctype="x-h2" equiv-text="<h2>"/>
Salut
<x id="CLOSE_"): i18n@1:10
Unknown placeholder "CLOSE_TAG_H2" ("
<x id="START_TAG_H2" ctype="x-h2" equiv-text="<h2>"/>
Salut
[ERROR ->]<x id="CLOSE_TAG_H2" ctype="x-h2" equiv-text="</h2>"/>
<x id="START_TAG_H3" ctype="x-"): i18n@3:10
Unknown placeholder "START_TAG_H3" ("
Salut<x id="CLOSE_TAG_H2" ctype="x-h2" equiv-text="</h2>"/>
[ERROR ->]<x id="START_TAG_H3" ctype="x-h3" equiv-text="<h3>"/>
Comment vas tu?<x "): i18n@4:10
Unknown placeholder "CLOSE_TAG_H3" ("
<x id="START_TAG_H3" ctype="x-h3" equiv-text="<h3>"/>
Comment vas tu?[ERROR ->]
<x id="CLOSE_TAG_H3" ctype="x-h3" equiv-text="</h3>"/>"): i18n@6:10
我该如何进行?