This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Sort your rails locale yamls alphabetically and adds an empty line when indent lowers 2 or more levels | |
# Prints everything to stdout. Watch your yaml anchors and aliases (fix manually, if needed). | |
# usage: | |
# chmod +x ./locale_yaml_formatter.rb | |
# ./locale_yaml_formatter.rb <path/to/locale.yml> | |
# | |
# In a rails project, run | |
# find . -type f -name *.yml | grep -v spec | grep locales | _ |