Comments (7)
yes, I mean attributes on <target>
from xliff.
Please check out this example: https://github.com/locize/xliff#additional-attributes-example
something like this:
import jsToXliff12 from 'xliff/jsToXliff12'
const js = {
resources: {
namespace1: {
key1: {
source: '',
target: 'Hallo',
additionalAttributes: {
state: 'new'
}
}
}
}
}
jsToXliff12(js, (err, res) => {
console.log(res)
// <xliff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd" xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
// <file original="namespace1" datatype="plaintext">
// <body>
// <trans-unit id="key1" state="new">
// <source></source>
// <target>Hallo</target>
// </trans-unit>
// </body>
// </file>
// </xliff>
})
from xliff.
Or do you mean attributes on the <target>
element? like this: <target some="attr">
?
// cc: @probertson
from xliff.
I would even extend this need to all elements. I need to add custom attributes to almost everything and it is the only limitation of this library for me which prevents me from using it. And because I need it asap, I need to fork.
from xliff.
I would even extend this need to all elements. I need to add custom attributes to almost everything and it is the only limitation of this library for me which prevents me from using it. And because I need it asap, I need to fork.
If you like you can also contribute with a PR.
from xliff.
I would even extend this need to all elements. I need to add custom attributes to almost everything and it is the only limitation of this library for me which prevents me from using it. And because I need it asap, I need to fork.
If you like you can also contribute with a PR.
I might if I have some spare time. For now I forked and I am just implementing the part that I immediately need and want (jsToXliff12
) and then I will have a look into how hard would it be to implement it for the rest.
from xliff.
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.
from xliff.
Related Issues (20)
- xliff12ToJs ingnoring nested groups HOT 4
- CDATA Sections HOT 3
- Add seamless conversion between XLIFF and i18next JSON HOT 4
- Placeholder elements not inline in XLIFF v1.2 HOT 2
- Add a LICENSE file HOT 1
- When there are XML comments in the XLIFF document, xliff2js throws an error HOT 7
- Could not find a declaration file for module 'xliff'. HOT 10
- Incorrect handling of <ignorable>...</ignorable> sections placed by CAT tools after segments HOT 3
- xliff.jsToXliff12 unexpected parse result with [object Object] HOT 4
- Adding support for metadata module HOT 2
- Place <note> inside <notes> section of the <unit> HOT 7
- Convert JSON to XLIFF without translating HOT 8
- Convert from json to XLIFF with CDATA HOT 3
- targetOfjs does not convert groups HOT 1
- 'State' attribute missing from converted xliff files HOT 5
- Got a TypeError after converting xliff12 to json with empty groups HOT 1
- xliff12ToJs() looses spaces between inline elements HOT 4
- TypeError: Cannot read properties of undefined (reading 'id') HOT 2
- The `jsToXliff12` lib creates xliff with wrong format in case of falsy `source` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xliff.