lib/aigu/ember_pod_exporter.rb in aigu-1.0.1 vs lib/aigu/ember_pod_exporter.rb in aigu-1.0.2
- old
+ new
@@ -15,11 +15,11 @@
Dir[pattern].reduce({}) do |memo, file|
content = read_or_ignore(file, input_directory)
return nil unless content
- root_key = file.match(/translations\.([a-z]+)\.json/)[1]
- base_key = file.gsub(/^#{input_directory}/, '').gsub(/^\//, '').gsub(/[a-z]+\/translations\.[a-z]+\.json$/, "__LOCALE__/translations.#{root_key}.json|")
+ root_key = file.match(/translations\.([a-z_]+)\.json/)[1]
+ base_key = file.gsub(/^#{input_directory}/, '').gsub(/^\//, '').gsub(/[a-z]+\/translations\.[a-z_]+\.json$/, "__LOCALE__/translations.#{root_key}.json|")
content = flattenize_hash(content, base_key)
memo.merge! content
end