lib/review/i18n.rb in review-1.6.0 vs lib/review/i18n.rb in review-1.7.0
- old
+ new
@@ -36,11 +36,11 @@
I18n.setup(locale)
end
end
class << self
- alias v t ## for EPUBMaker backward compatibility
+ alias_method :v, :t ## for EPUBMaker backward compatibility
end
def self.update(user_i18n, locale = nil)
@i18n.update(user_i18n, locale)
end
@@ -63,10 +63,14 @@
def update_localefile(path)
user_i18n = YAML.load_file(path)
locale = user_i18n["locale"]
if locale
user_i18n.delete("locale")
- @store[locale].merge!(user_i18n)
+ if @store[locale]
+ @store[locale].merge!(user_i18n)
+ else
+ @store[locale] = user_i18n
+ end
else
user_i18n.each do |key, values|
raise KeyError, "Invalid locale file: #{path}" unless values.kind_of? Hash
@store[key].merge!(values)
end