Gettext icon indicating copy to clipboard operation
Gettext copied to clipboard

XLIFF gererator trgLang matches srcLang

Open ScottAustin opened this issue 6 years ago • 2 comments

Hi,

When generating XLIFF the Translations language is used as the srcLang & trgLang. the spec states "Target language - the code of the language, in which the Translated text is expressed".

It could be fixed by adding the target language to the options array. $xliff->setAttribute('trgLang', $options['targetLanguage'] ?? $translations->getLanguage());

Any solution would be great

ScottAustin avatar Jun 20 '19 14:06 ScottAustin

Ok, seems good.

My only concern is how to keep this info in both way: load a xliff, export to Po, load the Po, export to xliff.

Maybe we could save the value in a header, like X-Source-Language (not sure if there's a standard header name for this), so this value is present in any other format with headers. What do you think?

If you're ok with that, do you want to work in a PR?

oscarotero avatar Jun 20 '19 15:06 oscarotero

I'm happy to work on the PR for this.

Adding the data to the headers sounds like a good idea.

ScottAustin avatar Jun 21 '19 11:06 ScottAustin