lib/i18n_screwdriver.rb in i18n_screwdriver-9.0 vs lib/i18n_screwdriver.rb in i18n_screwdriver-9.1
- old
+ new
@@ -94,15 +94,17 @@
def self.gather_translations
texts = []
symbols = []
Dir.glob("**/*.{haml,erb,slim,rb}").each do |file|
+ next unless File.file?(file)
input = File.read(file)
texts.concat(grab_texts_to_be_translated(input))
symbols.concat(grab_symbols_to_be_translated(input))
end
Dir.glob("**/*.{js,coffee,hamlc,ejs,erb}").each do |file|
+ next unless File.file?(file)
input = File.read(file)
texts.concat(grab_js_texts_to_be_translated(input))
end
translations = Hash[texts.uniq.map{ |text| [generate_key(text), extract_text(text)] }]