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

Do not rearrange header #112

Closed
ScreamingDev opened this issue Jun 12, 2016 · 2 comments
Closed

Do not rearrange header #112

ScreamingDev opened this issue Jun 12, 2016 · 2 comments

Comments

@ScreamingDev
Copy link
Contributor

This is a header I recently had:

# Copyright (C) 2015 the WordPress team
# This file is distributed under the GNU General Public License v2 or later.
msgid ""
msgstr ""
"Project-Id-Version: Twenty Sixteen 0.1.20150828\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/twentysixteen\n"
"POT-Creation-Date: 2015-11-20 12:58:54+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

Parsing it, merging some data with MERGE_ADD and then storing the file again rearranges the header:

msgid ""
msgstr ""
"Project-Id-Version: Twenty Sixteen 0.1.20150828\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/twentysixteen\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2015-11-20 12:58:54+00:00\n"
"PO-Revision-Date: 2016-06-12T23:05:19+00:00\n"
"Language: \n"

In addition the comment and the Language field is gone.

This shouldn't be when you merge two translations without the MERGE_HEADER option.
It neither should be when you use the option.

@oscarotero
Copy link
Member

The automatic alphabetic sorting is added to keep the consistency on generate po files with the same headers but in different order. This eases testing because allows to compare two po output independently of the order in which the headers have been added/modified. This is not done on merge translations, but on generate .po output.
I don't see an issue here, because the headers order does not affect to the content.

@oscarotero
Copy link
Member

Included an option to enable the automatic headers sorting (disabled by default)

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