if keys.empty?
hash[key] = value
else
- unless hash.key? key
- hash[key] = {}
- end
+ hash[key] ||= {}
+
add_translation(hash[key], keys, value)
end
hash
msgstr = line[8..-2]
end
- if !path.empty? && !msgstr.empty?
- add_translation(trs, path, msgstr)
- path = []
- msgstr = ''
- end
+ next if path.empty? || msgstr.empty?
+
+ add_translation(trs, path, msgstr)
+ path = []
+ msgstr = ''
end
trs
end