I\'ve been trying to sort an i18n translations YAML file with Ruby so I can manage new translations in a better and organized way, but I\'ve been wondering if there is something
Unfortunately YAML::quick_emit
has been deprecated and is no longer available in newer builds of the Psych gem. If you want your hash keys to be sorted when serialized to yaml, you'll have to use the following monkey patch instead:
class Hash
def to_yaml opts={}
return Psych.dump(self.clone.sort.to_h)
end
end