/trans-diff

Create a filterable, commentable diff table from XLIFF files

Primary LanguageJavaScriptMIT LicenseMIT

trans-diff

Create a filterable, commentable diff table from XLIFF files

https://shunsakurai.github.io/trans-diff/

Roadmap and update history

  • Support single file

  • Support multiple files (detect file IDs)

  • Save comments

  • Unzip .mqxlz files

  • Implement Transifex URL converter

  • ⏱ Transifex URL converter doesn't directly download the XLIFF file anymore

How to use

Please watch the "How to use" video on YouTube for details:

Trans Diff - How to use

How to generate the diff file

It's pretty straight forward.

  1. Export XLIFF files at the start and the end of the review.
  • For Transifex, click "Download for translation as XLIFF" (or "Download for use" when the source file is an XLIFF file)
  • For memoQ, click "Export" > "Export Bilingual", and unselect "Save a compressed file (.mqxlz)"
  1. Choose XLIFF files (File 1 and File 2) and click "Compare". The diff file will be downloaded automatically.

Supported file types:

Diff specs:

  • The diff is created based on Levenshtein distance
  • The comparison is character-based for full-width characters (e.g. Japanese) and word-based for half-width characters (e.g. English)

Limitations:

  • Basically, the number of segments/strings needs to be the same between File 1 and File 2.

How to use the diff file

  • You can filter the diff table with changed/unchanged status or with text (regular expression is supported) or number range. For details, please hover over the left-most column in each row. For example, you can display only the segments with any comments by putting a dot "." in the regular expression row above the Note column.
  • You can sort the table by columns by clicking the table header.
  • Click in the Note column to add comments. Please remember to resave the file after commenting, by pressing Ctrl/Cmd+S keys or clicking the "Resave File" button.
  • Click the "Save Static View" to save the current filtered view without JavaScript, for reduced file size and for better security. The static file is not commentable or filterable.

Downloading XLIFF files

Trans Diff has a Transifex URL converter. The URL of the editor https://www.transifex.com/{organization}/{project}/translate/#{lang}/{resource}/{stringId}?{query} is converted to https://www.transifex.com/{organization}/{project}/{resource} and you can download the XLIFF file by selecting your language and pressing the "Download for translation as XLIFF" button. It's useful to download the XLIFF files before and after you do translation or review in Tranifex. Please note that this is not an official feature of Transifex.

Usage:

  • Paste the Transifex editor URL in the converter (which looks like Terminal / Command Prompt), move cursor at the end of the line, and press Enter key to download the XLIFF file
  • You can reference the previous input by pressing Arrow Up key

Motivation and inspiration

Originally I wanted to compare .mqxlz files but the project has been dormant because it was tricky to implement the code to unzip files in client JavaScript. It seems .mqxlz is a ZIP64 format. I recently often work with Transifex XLIFF files so I resumed this project. I was highly inspired and motivated by the diff tool by AlissaSabre, not on GitHub though.

License

Anyone can use this tool free of charge.

MIT License

Privacy policy and terms of use

We don't store your data. We physically can't. (Borrowed part from here.) All actions are done on client JavaScript on your computer.

I try my best to maintain the quality and safety of this extension, but please use it at your own risk. The author doesn't take any responsibility for any damage caused by use of this tool.

Feedback and contribution

I'd love to hear from users and developers. Please feel free to post feature requests, bug reports, and questions through the GitHub Issues. I'd also welcome pull requests.