Dump flags after references in PO files #310
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.
Summary
This PR changes the order in which flags and references are dumped into PO files, so that flags are placed after references. This behavior seems to be common among a small sample of non-Elixir PO files I saw.
Background
In of the projects, I'm going to use transifex.com to enable easier management of translations. However, I've noticed that they output comments in PO files in a different order than Elixir's gettext. They first output file references and then flags, while Elixir's gettext does it the other way. This results in some unnecessary churn in git history, because these 2 lines are swapped back and forth. Folks at transifex.com insist that Elixir's gettext is outputing comments in the wrong order:
However, I wasn't able to find any explicit mention of the "standard" comment order in PO files, except for the example PO file in the linked gettext doc. My short GitHub research indicated that indeed PO files with flags (that I've found) had them placed after the references, so that gives some additional credibility to transifex claim.