Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Suggestions for a XLIFF converter? #7

Closed
emmenko opened this issue Oct 1, 2015 · 7 comments
Closed

Suggestions for a XLIFF converter? #7

emmenko opened this issue Oct 1, 2015 · 7 comments

Comments

@emmenko
Copy link

emmenko commented Oct 1, 2015

I guess this is not the ideal place to ask such question but it kinda relates to this project I guess.

So after using this plugin we get the JSON files with the extracted messages, which is great. We can also then easily aggregate / transform all those messages into a single file or any other format by running scripts like this one.

In my company, but I guess in general, I'm evaluating the usage of the XLIFF format as it seems to be the preferred choice of translator agencies.
I was wondering if you know any tool to help with that (so JSON -> XLIFF converter) or if you had some experiences with that. If yes, could you provide some hints which xml elements should be used based on the information extracted by the plugin (the XLIFF 2.0 spec)?

Thanks in advance!

@ericf
Copy link
Collaborator

ericf commented Oct 1, 2015

I think this is a good idea. I think it would make sense to create a generic API that could take ICU messages plus metadata and output XLIFF. Then I could imagine an option on this plugin to output the "raw" JSON or XLIFF by passing the data it extracts to that generic ICU message --> XLIFF API.

I started looking a the XLIFF spec about a month ago, but never dug deep enough to come up with a plan on how to implement such a thing. I'm also not a localization expert, so my knowledge of the format is simply that it exists, is widely used, and an industry standard interchange format.

It would be great to get some guidance from people who are localization experts to know whether the 1.0 or 2.0 spec is what should be implemented, and which aspects of the spec are most supported, etc.

@emmenko
Copy link
Author

emmenko commented Oct 1, 2015

@ericf glad to see that my wasn't a dumb question :)
Yeah, it would be great to get some feedback from someone that has some expertise on the topic.

If it can be of any help, this is what I've come up so far to generate the XLIFF files.
https://github.com/emmenko/redux-react-router-async-example/blob/master/scripts/i18nToXliff.js
PS: Of course, any suggestion would be much appreciated :)

@ericf
Copy link
Collaborator

ericf commented Oct 1, 2015

I'm not sure what granularity XLIFF supports for breaking apart messages into their plural, select, etc. segments, but you can use intl-messageformat-parser to get the AST for the defaultMessage.

@bardt
Copy link

bardt commented Oct 22, 2015

Why can't we combine all the messages JSON files into one JSON, then extract message strings into a pure *.txt file and then use XLIFF2ICUConverter? Didn't try it myself though.

@ericf
Copy link
Collaborator

ericf commented Oct 24, 2015

@bardt I want the extraction process to be as loss-less as possible and some build process might take the module which the strings originated into account. For this reason the extraction is 1:1 in terms of files and keeps the file system hierarchy. The files are easily merged into one with a grep + map + reduce step.

@jamuhl
Copy link

jamuhl commented Oct 29, 2017

We now fully support icu format at https://locize.com (and plan to extend based on your feedback / demand):

  • highlighting
  • validation
  • machine translations
  • plural conversion between source and target language
  • prettify of your icu strings

screen shot 2017-10-29 at 14 12 00

Your feedback would be very welcome - also if someone could provide us with a file extracted we could look into supporting that for importing (beside xliff, json, ...)

@longlho
Copy link
Member

longlho commented May 26, 2019

close due to stale

@longlho longlho closed this as completed May 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants