TODO Should the cache be cleared if new translations are stored?
# File lib/i18n/backend/cache.rb, line 71 def fetch(cache_key, &block) result = fetch_storing_missing_translation_exception(cache_key, &block) raise result if result.is_a?(Exception) result = result.dup if result.frozen? rescue result result end
# File lib/i18n/backend/cache.rb, line 85 def fetch_ignoring_procs(cache_key, &block) I18n.cache_store.read(cache_key) || yield.tap do |result| I18n.cache_store.write(cache_key, result) unless result.is_a?(Proc) end
# File lib/i18n/backend/cache.rb, line 78 def fetch_storing_missing_translation_exception(cache_key, &block) fetch_ignoring_procs(cache_key, &block) rescue MissingTranslationData => exception I18n.cache_store.write(cache_key, exception) exception end
Generated with the Darkfish Rdoc Generator 2.