Git Product home page Git Product logo

omnixlf's Introduction

OmniXLF

OmniXLF provides a simple translation tool for editing Angular 2 XLIFF 1.2 translation files.

Building

To build the project for all supported platforms, run npm run build:electron. You will find the built packages inside the ./packages folder.

omnixlf's People

Contributors

fourcube avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

omnixlf's Issues

failed to save xlf file

problem

An exception will be issued and save will fail.
The xlf file generated by the latest ng x18n seems to have no <target/> element.

error xlf code (initial generate)

  <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>

cause

There seems to be an exception when saving the translation because there is no target element.

desired action

I will send you a pull request so that it can be saved.

error occurs if there is no attribute in <target>.

problem

An error occurs if there is no attribute in .

sucess xlf code

<source> souce message </source>
<target state = "new"> target message </target>

error xlf code

<source> souce message </source>
<target> target message </target>

cause

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.

desired action

The element without attribute also needs to work properly

Missing Interpolated Text

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]。

Support for HTML elements inside i18n tags

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.