Skip to content

Commit ef9b930

Browse files
committed
feat: reformat locales task
1 parent e507072 commit ef9b930

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tasks/reformat_yaml.rake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
require 'yaml'
44

5+
desc 'Reformat all locales'
6+
task :reformat_locales do
7+
path = File.absolute_path(File.join(__dir__, '..', 'lib', 'locales', '**', '*.yml'))
8+
locales = Dir[path]
9+
10+
locales.each do |locale_path|
11+
reformat_file(locale_path)
12+
rescue StandardError => e
13+
puts "Error reformatting #{locale_path}: #{e.message}"
14+
end
15+
end
16+
517
desc 'Reformat a yaml file into a common format'
618
task :reformat_yaml, [:filename] do |_, args|
719
args.with_defaults(filename: nil)

0 commit comments

Comments
 (0)