Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove initial locale from yml when converting to json and create a s…

…eperate file for each locale in the file
  • Loading branch information...
commit 3623d8d503266ba2e6cb6fab71c57ecf7b9886cf 1 parent 599f8e4
@kmees authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/guard/i18next.rb
View
7 lib/guard/i18next.rb
@@ -37,8 +37,11 @@ def run_on_change(paths)
locale = YAML.load(input.read)
input.close
- File.open(options[:output] + "/#{filename}.json", "w") do |f|
- f.puts locale.to_json
+ locale.keys.each do |locale_key|
+ locale_filename = (filename.end_with? locale_key) ? filename : "#{filename}.#{locale_key}"
+ File.open(options[:output] + "/#{locale_filename}.json", "w") do |f|
+ f.puts locale[locale_key].to_json
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.