fourcube/omnixlf

Support for HTML elements inside i18n tags

Opened this issue · 1 comments

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!

Thank you for reporting this!

I will probably replace the input textarea with something more flexible, so editing of more complex structures will be possible.