{"id":21019343,"url":"https://github.com/rmraya/openxliff","last_synced_at":"2026-03-04T00:51:45.523Z","repository":{"id":40504810,"uuid":"156761866","full_name":"rmraya/OpenXLIFF","owner":"rmraya","description":"An open source set of Java filters for creating, merging and validating XLIFF 1.2, 2.0, 2.1 and 2.2 files.","archived":false,"fork":false,"pushed_at":"2025-03-24T14:10:15.000Z","size":85818,"stargazers_count":73,"open_issues_count":1,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T11:02:04.465Z","etag":null,"topics":["java","xliff","xliff-files","xliff-manager","xliff-validation"],"latest_commit_sha":null,"homepage":"https://www.maxprograms.com/products/openxliff.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmraya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"USERNAME"}},"created_at":"2018-11-08T20:01:50.000Z","updated_at":"2025-03-26T07:06:25.000Z","dependencies_parsed_at":"2023-10-04T22:38:46.979Z","dependency_job_id":"efd38b32-b797-4175-8ea7-d1625c6e6930","html_url":"https://github.com/rmraya/OpenXLIFF","commit_stats":null,"previous_names":[],"tags_count":92,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FOpenXLIFF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FOpenXLIFF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FOpenXLIFF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FOpenXLIFF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmraya","download_url":"https://codeload.github.com/rmraya/OpenXLIFF/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036067,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","xliff","xliff-files","xliff-manager","xliff-validation"],"created_at":"2024-11-19T10:31:20.967Z","updated_at":"2026-03-04T00:51:45.491Z","avatar_url":"https://github.com/rmraya.png","language":"Java","funding_links":["https://github.com/sponsors/USERNAME"],"categories":[],"sub_categories":[],"readme":"# OpenXLIFF Filters\n\n![OpenXLIFF FIlters logo](openxliff_128.png)\n\nAn open source set of Java filters for creating, merging and validating XLIFF 1.2, 2.0, 2.1 and 2.2 files.\n\nWith OpenXLIFF Filters you can create XLIFF files that don't use proprietary markup and are compatible with most CAT (Computer Asisted Translation) tools.\n\n- **[Binary Downloads](https://www.maxprograms.com/products/openxliff.html)**\n- **[Filters Configuration](https://github.com/rmraya/OpenXLIFF#filters-configuration)**\n- **[Supported File Formats](https://github.com/rmraya/OpenXLIFF#supported-file-formats)**\n- **[Building OpenXLIFF Filters](https://github.com/rmraya/OpenXLIFF/tree/master?tab=readme-ov-file#building-openxliff-filters)**\n\n## Features\n\n- **[Convert Document to XLIFF](https://github.com/rmraya/OpenXLIFF#convert-document-to-xliff)**  \n- **[Convert XLIFF to Original Format](https://github.com/rmraya/OpenXLIFF#convert-xliff-to-original-format)**\n- **[XLIFF Validation](https://github.com/rmraya/OpenXLIFF#xliff-validation)**\n- **[Convert XLIFF 1.2 to XLIFF 2.x](https://github.com/rmraya/OpenXLIFF#convert-xliff-12-to-xliff-2x)**\n- **[Convert XLIFF 2.x to XLIFF 1.2](https://github.com/rmraya/OpenXLIFF#convert-xliff-2x-to-xliff-12)**\n- **[Recover ICE (In-Context Exact) Matches](https://github.com/rmraya/OpenXLIFF#recover-ice-in-context-exact-matches)**\n- **[Translation Status Analysis](https://github.com/rmraya/OpenXLIFF#translation-status-analysis)**\n- **[Join multiple XLIFF files](https://github.com/rmraya/OpenXLIFF#join-multiple-xliff-files)**\n- **[Pseudo-translate XLIFF file](https://github.com/rmraya/OpenXLIFF#pseudo-translate-xliff-file)**\n- **[Copy Source to Target](https://github.com/rmraya/OpenXLIFF#copy-source-to-target)**\n- **[Approve All Segments](https://github.com/rmraya/OpenXLIFF#approve-all-segments)**\n- **[Remove All Targets](https://github.com/rmraya/OpenXLIFF#remove-all-targets)**\n- **[Export Approved Segments as TMX](https://github.com/rmraya/OpenXLIFF#export-approved-segments-as-tmx)**\n\n## Filters Configuration\n\nXML and JSON filters are configurable\n\n- **[XML Filter Configuration](https://github.com/rmraya/OpenXLIFF/tree/master/src/com/maxprograms/converters/xml#readme)**\n- **[JSON Filter Configuration](https://github.com/rmraya/OpenXLIFF/tree/master/src/com/maxprograms/converters/json#readme)**\n\n## Related Projects\n\n- **[XLIFF Manager](https://github.com/rmraya/XLIFFManager)** implements an easy-to-use user interface for creating, merging, validating, and manipulating XLIFF files in a graphical environment.\n- **[Swordfish](https://github.com/rmraya/Swordfish)** uses OpenXLIFF Filters to extract translatable text from supported formats.\n- **[RemoteTM](https://github.com/rmraya/RemoteTM)** uses OpenXLIFF Filters to handle all TMX processing.\n- **[Stingray](https://github.com/rmraya/Stingray)** uses OpenXLIFF Filters for extracting the text to align from supported monolingual documents.\n- **[XLIFF Validation](https://github.com/rmraya/XLIFFValidation)** web-based XLIFF Validation Service.\n- **[Fluenta](https://github.com/rmraya/Fluenta)** a Translation Manager that uses OpenXLIFF Filters to generate XLIFF from DITA projects.\n- **[JavaPM](https://github.com/rmraya/JavaPM)** a set of scripts for localizing Java `.properties` files using XLIFF.\n\n## Supported Versions\n\n| Version   | Supported          |\n| --------- | ------------------ |\n| Latest    | :white_check_mark: |\n| Any other | :x:                |\n\n## Supported File Formats\n\nOpenXLIFF Filters can generate XLIFF 1.2, 2.0, 2.1 and 2.2 from these formats:\n\n- **General Documentation**\n  - Adobe InCopy ICML\n  - Adobe InDesign Interchange (INX)\n  - Adobe InDesign IDML CS4, CS5, CS6 \u0026 CC\n  - HTML\n  - Microsoft Office (2007 and newer)\n  - Microsoft Visio XML Drawings (2007 and newer)\n  - MIF (Maker Interchange Format)\n  - OpenOffice / LibreOffice / StarOffice\n  - PHP Arrays\n  - Plain Text\n  - QTI (IMS Question and Test Interoperability)\n  - QTI Packages\n  - SDLXLIFF (Trados Studio)\n  - SRT Subtitles\n  - Trados Studio Packages (*.sdlppx)\n  - TXML (GlobalLink/Wordfast PRO)\n  - WPML XLIFF (WordPress Multilingual Plugin)\n  - Wordfast/GlobalLink XLIFF (*.txlf)\n  - XLIFF from Other Tools (.mqxliff, .txlf, .xliff, etc.)\n- **XML Formats**\n  - XML (Generic)\n  - DITA 1.0, 1.1, 1.2 and 1.3\n  - DocBook 3.x, 4.x and 5.x\n  - SVG\n  - Word 2003 ML\n  - XHTML\n- **Software Development**\n  - JavaScript\n  - JSON\n  - Java Properties\n  - PHP Arrays\n  - PO (Portable Objects)\n  - RC (Windows C/C++ Resources)\n  - ResX (Windows .NET Resources)\n  - TS (Qt Linguist translation source)\n\n## Building OpenXLIFF Filters\n\n### Requirements\n\n- JDK 21 or newer is required for compiling and building. Pre-built binaries already include everything you need to run all options.\n- Gradle 8.14.3 or newer. get it from [Gradle Releases](https://gradle.org/releases/).\n\n### Steps for building\n\n- Checkout this repository.\n- Point your JAVA_HOME variable to JDK 21\n- Run `gradle` to generate a binary distribution in `./dist`\n\n``` bash\n  git clone https://github.com/rmraya/OpenXLIFF.git\n  cd OpenXLIFF\n  gradle\n```\n\nA binary distribution will be created in `/dist` folder.\n\n## Convert Document to XLIFF\n\nYou can use the library in your own Java code. Conversion to XLIFF is handled by the class `com.maxprograms.converters.Convert`.\n\nIf you use binaries from the command line, running `.\\convert.cmd` or `./convert.sh` without parameters displays help for XLIFF generation.\n\n```text\nUsage:\n\nconvert.sh [-help] [-version] -file sourceFile -srcLang sourceLang \n        [-tgtLang targetLang] [-skl skeletonFile] [-xliff xliffFile] \n        [-type fileType] [-enc encoding] [-srx srxFile] [-catalog catalogFile] \n        [-divatal ditaval] [-config configFile] [-embed] [-paragraph] \n        [-xmlfilter folder] [-2.0] [-2.1] [-2.2] [-ignoretc] [-ignoresvg] [-strict]\n        [-charsets] [-types]\n\nWhere:\n\n   -help:      (optional) display this help information and exit\n   -version:   (optional) display version \u0026 build information and exit\n   -file:      source file to convert\n   -srcLang:   source language code\n   -tgtLang:   (optional) target language code\n   -xliff:     (optional) XLIFF file to generate\n   -skl:       (optional) skeleton file to generate\n   -type:      (optional) document type\n   -enc:       (optional) character set code for the source file\n   -srx:       (optional) SRX file to use for segmentation\n   -catalog:   (optional) XML catalog to use for processing\n   -ditaval:   (optional) conditional processing file to use when converting DITA maps\n   -config:    (optional) configuration file to use when converting JSON documents\n   -embed:     (optional) store skeleton inside the XLIFF file\n   -paragraph: (optional) use paragraph segmentation\n   -xmlfilter: (optional) folder containing configuration files for the XML filter\n   -ignoretc:  (optional) ignore tracked changes from Oxygen XML Editor in XML files\n   -ignoresvg: (optional) ignore translatable SVG files when parsing DITA maps\n   -2.0:       (optional) generate XLIFF 2.0\n   -2.1:       (optional) generate XLIFF 2.1\n   -2.2:       (optional) generate XLIFF 2.2\n   -strict:    (optional) validate QTI files/packages\n   -charsets:  (optional) display a list of available character sets and exit\n   -types:     (optional) display a list of supported document types and exit\n```\n\nOnly two parameters are absolutely required: `-file` and `-srcLang`. The library tries to automatically detect format and encoding and exits with an error message if it can't guess them. If automatic detection doesn't work, add `-type` and `-enc` parameters.\n\nCharacter sets vary with the operating system. Run the conversion script with `-charsets` to get a list of character sets available in your OS.\n\nBy default, XLIFF and skeleton are generated in the folder where the source document is located. Extensions used for XLIFF and Skeleton are `.xlf` and `.skl`.\n\nThe `XML` type handles multiple document formats, like `XHTML`, `SVG` or `DocBook` files.\n\nDefault XML catalog and SRX file are provided. You can also use custom versions if required.\n\n### Supported document types\n\n```text\n   INX = Adobe InDesign Interchange\n   ICML = Adobe InCopy ICML\n   IDML = Adobe InDesign IDML\n   DITA = DITA Map\n   HTML = HTML Page\n   JS = JavaScript\n   JSON = JSON\n   JAVA = Java Properties\n   MIF = MIF (Maker Interchange Format)\n   OFF = Microsoft Office 2007 Document\n   OO = OpenOffice Document\n   PHPA = PHP Array\n   PO = PO (Portable Objects)\n   QTI = IMS Question and Test Interoperability\n   QTIP = QTI Package\n   RC = RC (Windows C/C++ Resources)\n   RESX = ResX (Windows .NET Resources)\n   SDLPPX = Trados Studio Package\n   SDLXLIFF = SDLXLIFF Document\n   SRT = SRT Subtitle\n   TEXT = Plain Text\n   TS = TS (Qt Linguist translation source)\n   TXLF = Wordfast/GlobalLink XLIFF\n   TXML = TXML Document\n   WPML = WPML XLIFF\n   XLIFF = XLIFF Document\n   XML = XML Document\n   XMLG = XML (Generic)\n```\n\n## Convert XLIFF to Original Format\n\nYou can convert XLIFF files created with OpenXLIFF Filters to original format using class `com.maxprograms.converters.Merge` in your Java code.\n\nIf you use binaries from the command line, running `.\\merge.cmd` or `./merge.sh` without parameters will display the information you need to merge an XLIFF file.\n\n```text\nUsage:\n\n   merge.cmd [-help] [-version] -xliff xliffFile -target targetFile [-catalog catalogFile] [-unapproved] [-export]\n\nWhere:\n\n   -help:       (optional) Display this help information and exit\n   -version:    (optional) Display version \u0026 build information and exit\n   -xliff:      XLIFF file to merge\n   -target:     translated file or folder where to store translated files\n   -catalog:    (optional) XML catalog to use for processing\n   -unapproved: (optional) accept translations from unapproved segments\n   -export:     (optional) generate TMX file from approved segments\n   -getTarget:  (optional) display a potential target file name and exit\n```\n\n## Recover ICE (In-Context Exact) Matches\n\nYou can recover previous translations stored in an XLIFF file and apply them as ICE (In-Context Exact) Matches to another XLIFF file using class `com.maxprograms.converters.ICEMatches` in your Java code.\n\nIf you use binaries from the command line, running `.\\iceMatches.cmd` or `./iceMatches.sh` without parameters displays help for recovering ICE Matches.\n\n```text\nUsage:\n\niceMatches.sh [-help] -old oldXliff -new newXliff [-catalog catalogFile]\n\nWhere:\n\n    -help:    (optional) Display this help information and exit\n    -old:     XLIFF file with previous translations\n    -new:     XLIFF file that receives previous translations\n    -catalog: (optional) XML catalog to use for processing\n```\n\n## XLIFF Validation\n\nThe original [XLIFFChecker code](http://sourceforge.net/p/xliffchecker/code/) supports XLIFF 1.0, 1.1 and 1.2. The new version incorporated in OpenXLIFF Filters also supports XLIFF 2.0, 2.1 and 2.2.\n\nStandard XML Schema validation does not detect the use of duplicated 'id' attributes, wrong language codes and other constraints written in the different XLIFF specifications.\n\nAll XLIFF 2.0 modules are validated using XML Schema validation in a first pass. Extra validation is then performed using Java code for XLIFF 2.0 Core and for Metadata, Matches and Glossary modules.\n\nYou can validate XLIFF files using your own Java code. Validation of XLIFF files is handled by the class `com.maxprograms.validation.XliffChecker`.\n\nIf you use binaries from the command line, running `.\\xliffchecker.cmd` or `./xliffchecker.sh` without parameters displays help for XLIFF validation.\n\n```text\nUsage:\n\n   xliffchecker.cmd [-help] -file xliffFile [-catalog catalogFile]\n\nWhere:\n\n   -help:      (optional) Display this help information and exit\n   -file:      XLIFF file to validate\n   -catalog:   (optional) XML catalog to use for processing\n```\n\n### Convert XLIFF 1.2 to XLIFF 2.x\n\nYou can convert XLIFF 1.2 files to XLIFF 2.0, 2.1 or 2.2 using class `com.maxprograms.xliff2.ToXliff2` from your Java code or using the provided scripts.\n\n```text\nUsage:\n\ntoxliff2.sh [-help] -source sourceFile -target targetFile [-2.0] [-2.1] [-2.2] [-catalog catalogFile] \n\nWhere:\n\n   -help:      (optional) display this help information and exit\n   -source:    XLIFF 1.2 file to convert\n   -target:    XLIFF 2.x to generate\n   -2.0:       (optional) generate XLIFF 2.0\n   -2.1:       (optional) generate XLIFF 2.1\n   -2.2:       (optional) generate XLIFF 2.2\n   -catalog:   (optional) XML catalog to use for processing\n```\n\n### Convert XLIFF 2.x to XLIFF 1.2\n\nYou can convert XLIFF 2.0, 2.1 or 2.2 files to XLIFF 1.2 using class `com.maxprograms.xliff2.FromXliff2` from your Java code or using the provided scripts.\n\n```text\nUsage:\n\nfromxliff2.sh [-help] -source sourceFile -target targetFile [-catalog catalogFile] \n\nWhere:\n\n   -help:      (optional) display this help information and exit\n   -source:    XLIFF 2.x file to convert\n   -target:    XLIFF 1.2 to generate\n   -catalog:   (optional) XML catalog to use for processing\n```\n\n### XLIFF Validation Service\n\nYou can validate your XLIFF files online at [https://dev.maxprograms.com/Validation/](https://dev.maxprograms.com/Validation/)\n\n## Translation Status Analysis\n\nThis library lets you produce an HTML file with word counts and segment status statistics from an XLIFF file.  \n\nIf you use binaries from the command line, running `.\\analysis.cmd` or `./analysis.sh` without parameters displays help for statistics generation.\n\nYou can generate statistics using your own Java code. Statistics generation is handled by the class `com.maxprograms.stats.RepetitionAnalysis`.\n\n```text\nUsage:\n\n   analysis.sh [-help] -file xliffFile [-catalog catalogFile]\n\nWhere:\n\n   -help:      (optional) Display this help information and exit\n   -file:      XLIFF file to analyze\n   -catalog:   (optional) XML catalog to use for processing\n```\n\nThe HTML report is generated in the folder where the XLIFF file is located and its name is the name of the XLIFF plus `.log.html`.\n\n## Join multiple XLIFF files\n\nYou can combine several XLIFF files into a larger one using class `com.maxprograms.converters.Join` from your Java code or using the provided scripts.\n\nRunning `.\\join.cmd` or `./join.sh` without parameters displays help for joining files.\n\n```text\nUsage:\n\n   join.sh [-help] -target targetFile -files file1,file2,file3...\n\n Where:\n\n   -help:     (optional) Display this help information and exit\n   -target:   combined output XLIFF file\n```\n\nThe merge process automatically splits the files when converting back to original format.\n\n## Pseudo-translate XLIFF file\n\nYou can pseudo-translate  all untranslated segments using class `com.maxprograms.converters.PseudoTranslation` from your Java code or using the provided scripts.\n\nRunning `.\\pseudotranslate.cmd` or `./pseudotranslate.sh` without parameters displays help for pseudo-translating an XLIFF file.\n\n```text\nUsage:\n\n   pseudotranslate.cmd [-help] -xliff xliffFile [-catalog catalogFile]\n\nWhere:\n\n   -help:      (optional) Display this help information and exit\n   -xliff:     XLIFF file to pseudo-translate\n   -catalog:   (optional) XML catalog to use for processing\n```\n\n## Copy Source to Target\n\nYou can copy the content of `\u003csource\u003e` elements to new `\u003ctarget\u003e` elements for all untranslated segments using class `com.maxprograms.converters.CopySources` from your Java code or using the provided scripts.\n\nRunning `.\\copysources.cmd` or `./copysources.sh` without parameters displays help for copying source to target in an XLIFF file.\n\n```text\nUsage:\n\n   copysources.cmd [-help] -xliff xliffFile [-catalog catalogFile]\n\nWhere:\n\n   -help:      (optional) Display this help information and exit\n   -xliff:     XLIFF file to process\n   -catalog:   (optional) XML catalog to use for processing\n```\n\n## Approve All Segments\n\nYou can set all `\u003ctrans-unit\u003e` or `\u003csegment\u003e` elements as `approved` or `final` if they contain target text using class `com.maxprograms.converters.ApproveAll` from your Java code or using the provided scripts.\n\nRunning `.\\approveall.cmd` or `./approveall.sh` without parameters displays help for approving or confirming all segments in an XLIFF file.\n\n```text\nUsage:\n\n   approveall.cmd [-help] -xliff xliffFile [-catalog catalogFile]\n\nWhere:\n\n   -help:      (optional) Display this help information and exit\n   -xliff:     XLIFF file to process\n   -catalog:   (optional) XML catalog to use for processing\n```\n\n## Remove All Targets\n\nYou can remove`\u003ctarget\u003e` elements from all `\u003csegment\u003e` or `\u003ctrans-unit\u003e` elements using class `com.maxprograms.converters.RemoveTargets` from your Java code or using the provided scripts.\n\nRunning `.\\removetargets.cmd` or `./removetargets.sh` without parameters displays help for removing targets from an XLIFF file.\n\n```text\nUsage:\n\n   removetargets.cmd [-help] -xliff xliffFile [-catalog catalogFile]\n\nWhere:\n\n   -help:      (optional) Display this help information and exit\n   -xliff:     XLIFF file to process\n   -catalog:   (optional) XML catalog to use for processing\n```\n\n## Export Approved Segments as TMX\n\nYou can export all aproved segments from an XLIFF file as TMX using class `com.maxprograms.converters.TmxExporter` from your Java code or using the provided scripts.\n\nRunning `.\\exporttmx.cmd` or `./exporttmx.sh` without parameters displays help for exporting approved segments from an XLIFF file.\n\n```text\nUsage:\n\nexporttmx.sh [-help] -xliff xliffFile [-tmx tmxFile] [-catalog catalogFile]\n\nWhere:\n\n    -help:      (optional) Display this help information and exit\n    -xliff:     XLIFF file to process\n    -tmx:       (optional) TMX file to generate\n    -catalog:   (optional) XML catalog to use for processing\n```\n\nIf the optional `-tmx` parameter is not provided, the TMX file will be generated in the same folder as the XLIFF file and its name will be the same as the XLIFF file plus `.tmx`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmraya%2Fopenxliff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmraya%2Fopenxliff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmraya%2Fopenxliff/lists"}