OmniXLF provides a simple translation tool for editing Angular 2 XLIFF 1.2 translation files.
To build the project for all supported platforms, run npm run build:electron
. You will find the built packages inside the ./packages
folder.
Simple XLF translation editor powered by electron.
Home Page: http://www.omnixlf.com
An exception will be issued and save will fail.
The xlf file generated by the latest ng x18n
seems to have no <target/>
element.
<trans-unit id="i18nid" datatype="html">
<source> source message </source>
<context-group purpose="location">
<context context-type="sourcefile">./path/to/soucefile.ts</context>
<context context-type="linenumber">0</context>
</context-group>
<note priority="1" from="description">source message</note>
</trans-unit>
There seems to be an exception when saving the translation because there is no target element.
I will send you a pull request so that it can be saved.
reading xlf without results in an error.
angular/angular#18072
xlf where does not exist will not result in an error.
It is necessary to modify the target extraction processing of src/app/model.ts
as correspondence.
An error occurs if there is no attribute in .
<source> souce message </source>
<target state = "new"> target message </target>
<source> souce message </source>
<target> target message </target>
When target is acquired with _mapXliffTransUnitToTranslationUnit
method of src/app/model.ts
, it seems that if there is no attribute in element, it becomes a character string type and becomes an error.
The element without attribute also needs to work properly
Issue:
OmniXlf omits the Angular Interpolation strings from the source and translation fields.
Xliff Trans Unit:
<trans-unit id="labelWaiveFailed" datatype="html">
<source>Waive <x id="INTERPOLATION" equiv-text="{{data.number}}"/> Failed.</source>
<target state="translated">放弃 失败。<x id="INTERPOLATION"/>
</target>
<context-group purpose="location">
<context context-type="sourcefile">app/schedule/message/scheduleMessage.component.ts</context>
<context context-type="linenumber">10</context>
</context-group>
</trans-unit>
OmniXlf shows this trans unit as following:
ID: labelWaiveFailed
Source: Waive Failed.
Translation: 放弃 失败。
In comparison, a tool like Virtaal shows the source and translation as following:
ID: labelWaiveFailed
Source: Waive [INTERPOLATION] Failed.
Translation: 放弃 失败 [INTERPOLATION]。
Hi,
I have a use case where my i18n tag has a HTML tag inside it, like <input>
. I can get the translation working if I manually edit the file. But it looks like omnixlf doesn't support this. Am I doing something wrong or this is really not supported? If so, any plans of implementing this feature?
Example:
<span i18n="Filtro Datetime|Nos ultimos X dias@@datetimeFilterLastXDays">
Nos últimos <input formControlName="days"/> dias
</span>
XLF output for pt-BR, main language: (source and target tags only, for clarity)
<trans-unit id="datetimeFilterLastXDays" datatype="html">
<source>Nos últimos <x id="TAG_INPUT" ctype="x-input"/> dias</source>
<target state="translated">Nos últimos <x id="TAG_INPUT" ctype="x-input"/> dias</target>
[...]
</trans-unit>
XLF desired output for en-US:
<trans-unit id="datetimeFilterLastXDays" datatype="html">
<source>Nos últimos <x id="TAG_INPUT" ctype="x-input"/> dias</source>
<target state="translated">Last <x id="TAG_INPUT" ctype="x-input"/> days</target>
[...]
</trans-unit>
Thanks for this tool by the way, really appreciate it!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.