Skip to content

Commit 511b47a

Browse files
author
Robert Bjarnason
committed
Added function to show you what locales are not ready for a given version
1 parent e4449e5 commit 511b47a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

locales.thor

+16
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ class Locales < Thor
9292
locales.sort
9393
end
9494

95+
desc 'not_ready_for VERSION', 'List locales not ready for a VERSION of Rails.'
96+
def not_ready_for(version)
97+
locales = []
98+
Dir.glob(File.dirname(__FILE__) + '/rails/locale/*.{rb,yml}') do |filename|
99+
if md = filename.match(/([\w\-]+)\.(rb|yml)$/)
100+
locale = md[1]
101+
missing_keys, broken_keys = KeyStructure.check(locale, version)
102+
if not missing_keys.empty? or not broken_keys.empty?
103+
locales << locale
104+
end
105+
end
106+
end
107+
puts locales.sort.join(', ')
108+
locales.sort
109+
end
110+
95111
desc 'copy_rails3_ready_to FOLDER','Copy rails 3 ready locales to a folder'
96112
def copy_rails3_ready_to(folder)
97113
puts "Folder #{folder}"

0 commit comments

Comments
 (0)