Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve ordering of comments in .po files #103

Open
harakka opened this issue Aug 19, 2024 · 1 comment
Open

Preserve ordering of comments in .po files #103

harakka opened this issue Aug 19, 2024 · 1 comment

Comments

@harakka
Copy link

harakka commented Aug 19, 2024

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.

@exsilium
Copy link

I second this, it should be possible to preserve the order as if the .po files are being processed with different tools it would be good to honour the previous order set in the template or existing file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants