Closed kaidjohnson closed 2 years ago
Currently there is/was no need for this. Do you have an idea how a json file could look like? Btw: if you want to contribute, feel free to suggest a PR
I just stumbled over this in a project. What do you think about this?
<unit id="foo">
<segment>
<source>some source paragraph</source>
<target>some target paragraph</target>
</segment>
<segment>
<source>another source paragraph</source>
<source>another target paragraph</target>
</segment>
</unit>
through xliff2js
and targetOfjs
this could produce
foo: [
"some target paragraph",
"another target paragraph",
]
This would allow to use this e.g. in React like this:
<div>{t('foo').map(t => <p>{t}</p>)}</div>
Feel free to try a PR.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Thanks for this library! Very useful!
I noticed a few features in the XLIFF 2.0 spec (http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html) that do not appear to be implemented, namely the use of multiple
<segment>
entries. Any thoughts around if this feature may be supported in the future?As a workaround for now, we can combine our
<segment>
s into a single<segment>
, but would be nice to continue to maintain multiple in the future.