lib/aigu/ember_pod_exporter.rb in aigu-1.0 vs lib/aigu/ember_pod_exporter.rb in aigu-1.0.1
- old
+ new
@@ -16,13 +16,12 @@
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|")
- 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
end
@@ -33,10 +32,10 @@
Dir[pattern].reduce({}) do |memo, file|
content = read_or_ignore(file, input_directory)
return nil unless content
- base_key = file.gsub(input_directory, '').gsub(/^\//, '').gsub(/\/translations.#{locale}.json$/, '/translations.__LOCALE__.json|')
+ base_key = file.gsub(/^#{input_directory}/, '').gsub(/^\//, '').gsub(/\/translations.#{locale}.json$/, '/translations.__LOCALE__.json|')
content = flattenize_hash(content, base_key)
memo.merge! content
end