class LocalesToys::Template

Define toys for locales

Public Instance Methods

compare_locales(locale, other_locale) click to toggle source
# File lib/locales_toys/template.rb, line 35
def compare_locales(locale, other_locale)
        puts "#{locale.code.upcase} -> #{other_locale.code.upcase}:\n\n"
        puts locale.diff(other_locale).to_yaml
end
run() click to toggle source
# File lib/locales_toys/template.rb, line 17
def run
        require 'yaml'
        require 'json'

        locales = Locale.load(context_directory)

        locales.each_with_index do |locale, ind|
                locales[ind..-1].each do |other_locale|
                        next if locale == other_locale

                        compare_locales(locale, other_locale)
                        compare_locales(other_locale, locale)
                end
        end
end