Sort locale files list alphabetically #56
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.
See fnando/i18n-js#239 for explanation, investigation and discussion.
In short: list of files with translations should be always the same (including order).
Dir[]
may produce list of file paths with different order on different machines.For example: In case of i18n-js gem it need to produce always equal translation data. If it's not equal and Rails Asset Pipeline is used, it will lead to generating assets with different hashsums on different servers and link to asset in generated page and in the web server will be different, and site will become broken.
There is probably no good solution possible on the side of i18n or i18n-js gems. So every app and every gem should push to
I18n.load_path
sorted list of filenames.That's it.