module FastGettext # Responsibility: # - store data threadsave # - provide error messages when repositories are unconfigured # - accept/reject locales that are set by the user module Storage class NoTextDomainConfigured < Exception;end [:available_locales,:text_domain,:_locale,:current_cache].each do |method| eval < de_DE return candidate if not available_locales or available_locales.include?(candidate) end return nil#nothing found im sorry :P end #turn off translation if none was defined to disable all resulting errors def silence_errors if not self.current_repository or self.current_repository == NoTextDomainConfigured require 'fast_gettext/translation_repository/base' translation_repositories[text_domain] = TranslationRepository::Base.new('x') end end private def update_current_cache caches[text_domain]||={} caches[text_domain][locale]||={} self.current_cache = caches[text_domain][locale] end end end