Preserve ordering of comments in .po files
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 169
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
An option to preserve the order of comment fields in the translation data would be very useful for me. This library almost works for my use case, but parsing a .po file with the library, modifying the translation data, and re-compiling the translation data back into a .po file with the library changes the ordering of comment fields. For example:
-#. ~ Snippet in category "tip"
#: data/core/tips.json
+#. ~ Snippet in category "tip"
msgid "Moose may not be your friend."
msgstr "Elche sind vielleicht nicht deine Freunde."
This seems consistent behavior, #. lines are always moved below #: lines. This causes diffs for translation files to become very large and hard to review. This is inconvenient for our workflow. The original translation files are generated with a process that orders the comments like this, which I can't affect.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the library's .po parsing and compilation paths, focusing on how comment fields are stored and emitted. Done means parsing, modifying, and recompiling a .po file preserves the original relative order of comment fields such as #. and #:, avoiding unrelated translation-file diffs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- localization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100