lib/fast_gettext/storage.rb in fast_gettext-0.5.10 vs lib/fast_gettext/storage.rb in fast_gettext-0.5.11
- old
+ new
@@ -57,11 +57,11 @@
@@default_text_domain
end
# if overwritten by user( FastGettext.pluralisation_rule = xxx) use it,
- # otherwise fall back to repo or to default lambda
+ # otherwise fall back to repo or to default lambda
def pluralisation_rule
Thread.current[:fast_gettext_pluralisation_rule] || current_repository.pluralisation_rule || lambda{|i| i!=1}
end
def current_cache
@@ -120,11 +120,11 @@
# like locale=(), whoes behavior cannot be changed
def set_locale(new_locale)
self.locale = new_locale
locale
end
-
+
@@default_locale = nil
def default_locale=(new_locale)
@@default_locale = best_locale_in(new_locale)
update_current_cache
end
@@ -147,11 +147,11 @@
end
#turn off translation if none was defined to disable all resulting errors
def silence_errors
require 'fast_gettext/translation_repository/base'
- translation_repositories[text_domain] = TranslationRepository::Base.new('x')
+ translation_repositories[text_domain] ||= TranslationRepository::Base.new('x', :path => 'locale')
end
private
# de-de,DE-CH;q=0.9 -> ['de_DE','de_CH']
@@ -187,6 +187,6 @@
caches[text_domain][locale] ||= {}
caches[text_domain][locale][""] = false #ignore gettext meta key when translating
self.current_cache = caches[text_domain][locale]
end
end
-end
\ No newline at end of file
+end