Add basic support for XLIFF 1.2 file format #79
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
📚 #21
Feature
This is a basic implementation of the XLIFF 1.2 format. This format is used heavily in a lot of translations related tool (and in XCode) so I may have missed some of the implementation details. But it’s a good start for someone who want to contribute to Accent 😉
Refactor
This format is a bit trickier than other since it required the master language to export the targets. We needed to refactor some module to use the master language in the serialization process. Also, not needed but cleaner, we wrap the document’s key
top_of_the_file_comment
andheader
inside a new structLanguage.Document
. This will become handy if we ever need to add an attribute to the document OR if we add a different attribute to the serialization input.Next steps
This format includes 2 new dependencies to handle XML encode and decode. Why not use the same XML library used for the XML Android format? Because… *drum roll* The
<source>
XML tag when encoded by themochiweb_html
module is a self closing tag (per the HTML spec) 🥇Since those 2 new deps are required for the XLIFF format and can pretty print XML, we should use them instead of
mochiweb
🎉