{"_id":"@cybernetics-works/json2xliff","name":"@cybernetics-works/json2xliff","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@cybernetics-works/json2xliff","version":"1.1.0","description":"a command line and web app utility to convert json key-value translation files into xliff translation files","keywords":["xliff","json","convert","cli","tool","translation","internationalization","localization","tooling","converter","webapp"],"main":"index.js","homepage":"https://json2xliff.cybernetics.works","repository":{"type":"git","url":"git+https://gitlab.com/cybernetics-works/floss/json2xliff.git"},"bugs":{"url":"https://gitlab.com/cybernetics-works/floss/json2xliff/-/issues"},"author":{"name":"Soriyath Straessle","email":"soriyath@cybernetics.works"},"license":"GPL-3.0-only","scripts":{"json2xliff":"yarn node index.js ","build":"browserify src/bundle.js -o public/js/bundle.js","serve":"yarn node server.js","start":"node server.js"},"bin":{"json2xliff":"index.js "},"dependencies":{"fast-xml-parser":"^4.0.11","ramda":"^0.28.0","uuid":"^9.0.0","xml":"^1.0.1","yargs":"^17.6.0"},"packageManager":"yarn@3.2.4","devDependencies":{"@fastify/static":"^6.5.0","browserify":"^17.0.0","fastify":"^4.10.2","standard":"^17.0.0"},"standard":{"ignore":["public/js/bundle.js"]},"engines":{"node":">=16.0.0"},"funding":{"type":"individual","url":"https://donate.cybernetics.works"},"gitHead":"0584bb829813116c52d4ccfc3fc3392f72c79efe","_id":"@cybernetics-works/json2xliff@1.1.0","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-zXjbhO4HtaIoTFCS9lVNQyDrx4I08zk0s5s6AVkVj7tqwOynm877obAwd+83YKGq977qCFdgO2mu9P7aGW7XCQ==","shasum":"cc3202279df7f2b856d218b88306f8046fe5118f","tarball":"https://registry.npmjs.org/@cybernetics-works/json2xliff/-/json2xliff-1.1.0.tgz","fileCount":529,"unpackedSize":18321493,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCAYr3pxZEP/VtdT8Q3BJAph24A9z8xK2q1oKQAen6WZgIgSq7CRgdEmcldpxzc+S2j7Im32ckMGs4CFcU3vob7Lx0="}]},"_npmUser":{"name":"soriyath","email":"soriyath@cybernetics.works"},"directories":{},"maintainers":[{"name":"soriyath","email":"soriyath@cybernetics.works"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/json2xliff_1.1.0_1776130096574_0.1903414129555392"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-14T01:28:16.511Z","1.1.0":"2026-04-14T01:28:17.072Z","modified":"2026-04-14T01:28:17.242Z"},"maintainers":[{"name":"soriyath","email":"soriyath@cybernetics.works"}],"description":"a command line and web app utility to convert json key-value translation files into xliff translation files","homepage":"https://json2xliff.cybernetics.works","keywords":["xliff","json","convert","cli","tool","translation","internationalization","localization","tooling","converter","webapp"],"repository":{"type":"git","url":"git+https://gitlab.com/cybernetics-works/floss/json2xliff.git"},"author":{"name":"Soriyath Straessle","email":"soriyath@cybernetics.works"},"bugs":{"url":"https://gitlab.com/cybernetics-works/floss/json2xliff/-/issues"},"license":"GPL-3.0-only","readme":"# json2xliff\n\n> a utility tool to convert json translation files into xliff translation\n> files, and back\n\n## Usage\n\n### xliff2json\n\nThe tool uses the `srcLang` and `trgLang` attributes of the xliff 2.0 file to\nassess how to transpile into json flat translation file. Please make sure the\narguments to the tool match the xliff file.\nSee also the XSD specification: ./specifications/xliff_core_2.0.xsd .\nSee usage with: `yarn json2xliff -h`.\n\nThe json file will be created in the current working directory with the\nprovided tag and target language. If the file already exists, the tool throws\nan error.\n\nThe tool automatically detects if the XLIFF file has version 2.0, and uses the\ncorrect mapper to convert the texts. If it is not 2.0, it assumes the XLIFF\nfile is compliant with version 1.2 and uses another adapter. Since XLIFF files\ncontains the version of the schema used, using the `--xliff1` flag is not\nnecessary.\n\nWith the `--stdout` / `-o` flag, you can output to `stdout` and pipe into a\ntool like `jq` to format the json string. A further pipe into `pbcopy` puts the\ntext into the clipboard, ready to be pasted where you need it.\ne.g. `yarn json2xliff .... --stdout | jq . | pbcopy`.\n\n```bash\nyarn json2xliff --srcLang \"de-CH\" \\\n                --trgLang \"fr-CH\" \\\n                --tag \"v1.5.1\" \\\n                --xliff fixtures/uneven_example_v1.5.0_de-CH.xlf \\\n                --stdout\n\nyarn json2xliff --srcLang \"fr-CH\" \\\n                --trgLang \"de-CH\" \\\n                --tag \"v1.5.1\" \\\n                --xliff fixtures/uneven_example_v1.5.0_fr-CH.xlf \\\n                --stdout\n```\n\nThe output can be sorted and beautified with the flags `--sort` and `--beautify`.\n\n### json2xliff\n\nXLIFF translation files are XML bitext file containing both the source language\ntexts, as well as the target language texts if they exists (in case of a\ntranslation reviews, or completion of new translations, for example).\nSee [the wikipedia page](https://en.wikipedia.org/wiki/XLIFF).\nSee usage: `yarn json2xliff -h`.\n\nThe XLIFF 2.0 file will be created in the current working directory with the\nprovided tag and target language. If the file already exists, the tool throws\nan error.\n\nThis tool defaults to XLIFF 2.0 . If you need to target version 1.2, you may do\nso by adding the flag `--xliff1`, which defaults to false (i.e. XLIFF 2.0).\n\nWith the `--stdout` / `-o` flag, you can output to `stdout` and pipe into a\ntool like `xq` to format the XML string. A further pipe into `pbcopy` puts the\ntext into the clipboard, ready to be pasted where you need it.\ne.g. `yarn json2xliff .... --stdout | xq | pbcopy`.\n\n```bash\nyarn json2xliff --srcLang \"de-CH\" \\\n                --trgLang \"fr-CH\" \\\n                --srcJson fixtures/uneven_example_de.json \\\n                --trgJson fixtures/uneven_example_fr.json \\\n                --tag \"v1.3.2\" \\\n                --stdout\n```\n\nThe output can be sorted and beautified with the flags `--sort` and `--beautify`.\n\n### web app and docker / containers\n\nFor convenience purpose where nodejs is not available, the tool is also\npackaged as a Docker container.<br>\nBefore version 1.0.0, the container wraps the command line tool, please read\nthe relevant README.md file.\n\nStarting with version 1.0.0, a webapp packages the functionality of the command\nline tool.<br>\nThe webapp does not do anything server side: relevant parts of the conversion\nlogic has been extracted and packaged with Browserify in order to run in the\nbrowser: you can convert your files in your browser directly, without sending\ndata to the cloud.\n\nUsage: `yarn serve` or `yarn node server.js`.<br>\nBy default, the app is served on port `3000`: `http://localhost:3000`.\n\n#### Using Docker\n\nIt was tested with Podman.<br>\n\n```bash\n# pull the image\npodman pull registry.gitlab.com/cybernetics-works/floss/json2xliff\n\npodman run --interactive --rm registry.gitlab.com/cybernetics-works/floss/json2xliff:latest\n```\n\nPlease also note, the example assumes you want to run a transient container and\nremove it after use (`--interactive --rm`), you may want to keep it on your\ndisk with a name (e.g. `--name json2xliff`) and reuse it. This may be useful if\nyour processes regularly require submitting translations for review, for\nexample.\n\n## Validating against the XSD schema\n\nFor practical reasons and limitations, no validation is provided by this tool.\nYou may want to validate your XLIFF 2.0 files against [this online validator](https://dev.maxprograms.com/Validation/).\n\nAn offline solution may be done using [OpenXLIFF](https://github.com/rmraya/OpenXLIFF).\n\n## License\n\nSee LICENSE.\nThis project is meant to be a free, libre and open source software with the\nGPLv3 license.\n\n## Contribute\n\nThis project has been done pro bono and open sourced with a GPLv3 license.<br>\nWe believe that translating apps should be easy and come early in projects.\n\nIf this project could help you, please consider donating to further enable open\nsource development.\n\n- Paypal: https://www.paypal.me/soriyath;\n- BTC: `1EvujVHygPCcN5AhjSrw6Bdw6ahDkkYTD6` ;\n- Ethereum: `0x5d4129b923ee6B9277B57F237084a7C29E15d4Fa` ;\n- BNB / BUSD: `bnb1pzsks0g7semc3c2hre4ty2cmzkjey3ccq376aj` ;\n- XRP: `rJNmikSwahBgiwBpQTJtco7B3huXBBPxj5` ;\n- ADA: `addr1qyru5vlw95n0qcwr8wl53hq3hpwrtqa84p4kxghuk7smxax39sk94h9n9a7r23r7tpesk2ww89hn8uwcxn04ja8qqkaq7643wl` ;\n- DogeCoin: `DKSaFcSS7xWSCgf68iqucPjzF49ebcj23G` ;\n- MATIC: `0xc2231e3c4885803833677e18c488c984a917d980` ;\n- DOT: `13twG4bV4Fg2Ko5xkbvkGGybHokSaLGw1yuRc52n1sirDPdB` ;\n- SHIB: `0x5d4129b923ee6b9277b57f237084a7c29e15d4fa` ;\n- TRX: `TRM87YC5NSHKPmUAw23vdgN48xvqu5Dqgt` ;\n- SOL: `DzJC4mmqt6bshhBUx51psVzQ26beJHtYLhn2WZbKZwit` ;\n- LTC: `LMdDkpT1pcoEvTFxnxvAJjhSsb3HcDkya4` ;\n- AVAX: `0x4b12b80eda79c5c2bf006abfd7a064dac43c9a29` ;\n- ATOM: `cosmos1acqqwls02wfnp3l6hsd3nvdlgqlfgk9tq50q0v` ;\n- XMR: `43B8E4zUi91YK8g4i8mUCEGDMDCN6M2emZMXr2xgsBSQAXumpRsrZbXZ18VVwDdK22VtJpeMVphuEZqQWhxiKNCpRyRebjr` ;\n- NEAR: `0c738432d5bb2535b489e7e43dee9544bc5aeafb3b32eb8ce5ecb1f23c42e3ce` ;\n- HBAR: `1EvujVHygPCcN5AhjSrw6Bdw6ahDkkYTD6` ;\n- RUNE: `thor17252s0t9huj8zetlmfepmjthxtegqdlpsmpgk4` ;\n\n","readmeFilename":"README.md","_rev":"1-0e5be8f9731bcd70e90897e8d38219fb"}