Laying the Foundation for Better File Handling in Transifex
Language files sit at the heart of Transifex and how you translate your content. Every day, tens of thousands of files are uploaded, downloaded, and updated on Transifex. To make file handling better, we’ve released two important behind-the-scenes changes to how we work with files.
OpenFormats
Each time you upload or download a file, strings are run through what we call a file handler. When you upload a file, the handler reads the strings in the file and saves them to our database. And when you request a file, the handler compiles translated strings into a single file. With OpenFormats, we’re open sourcing the file handlers for each of our supported file formats.
Now, it’ll be easier to:
- Debug issues with files. Within OpenFormats, there’s a real-time testbed which lets you input content and see how it’ll be parsed and compiled. Any issues will be explained to you so that you can fix them in your source file.
- Add support for additional file formats. For example, if you have a proprietary file format you’d like to use with Transifex, you can create a new handler with the help of OpenFormats, send us a pull request on GitHub, and we’ll review and merge it into the OpenFormats repo.
To learn more about OpenFormats or contribute to it, check out the documentation.
File Handler Versioning
For a long time, it was difficult to work on any code related to our file handlers due to the risk of breaking backward compatibility. But now, we’ve added versioning support for our file handlers. When you upload a file, we’ll automatically associate it to the latest version of the handler. As we update our file handlers, your file will continue to work with Transifex because it’s always associated with the handler that was in place when you originally uploaded the file. To upgrade to the latest version of the handler, you simply need to delete your original file and re-upload it.
Versioning works with the following file formats, and we’ll be adding support for additional file formats over the next weeks and months:
- Android
- PO
- HTML
- YML
- KEYVALUEJSON
Dealing with file formats is a tricky business. Our hope is that by making file handling more transparent with OpenFormats, and working on file handlers with Versioning, we’re laying a strong foundation for better file handling in Transifex going forward.