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

Avoid large language file diffs on different filesystems by sorting translatable files #171

Closed
1 task done
l3ku opened this issue Jul 15, 2019 · 1 comment
Closed
1 task done
Assignees

Comments

@l3ku
Copy link
Contributor

l3ku commented Jul 15, 2019

Feature Request

Describe your use case and the problem you are facing

When working on translations with developers that have different operating systems,
the wp i18n makepot command causes large diffs that make reviewing language changes more challenging. The reason for this is that the command relies on the order the files are returned by the filesystem, and different filesystem implementations on the different operating systems of developers return the files in an arbitrary order.

A verbose example of the situation:

  1. The first developer on e.g. Mac OS X runs wp i18n makepot on his/her machine, creating the source code files are traversed in the order returned by the OS
  2. The first developer commits to git
  3. The second developer on Ubuntu clones the git repo, creates a new branch and adds a single translatable line
  4. The second developer regenerates the .pot file with wp i18n makepot, adds a translation with Poedit and pushes his/her branch

The strings in the.pot file will be reordered totally, and as a result also the actual translations in the .po files will follow this same new order. Reviewing the translation will be difficult.

Describe the solution you'd like

Always sort the translatable file paths in alphabetic order so the file order will be identical on all machines.

@swissspidy
Copy link
Member

Thanks for raising this!

Sounds like a reasonable thing to do.

@swissspidy swissspidy self-assigned this Jul 15, 2019
l3ku pushed a commit to l3ku/i18n-command that referenced this issue Jul 19, 2019
l3ku added a commit to l3ku/i18n-command that referenced this issue Jul 19, 2019
l3ku added a commit to l3ku/i18n-command that referenced this issue Jul 19, 2019
l3ku added a commit to l3ku/i18n-command that referenced this issue Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants