Responsibility:
- provide access to translations in database through a database abstraction Options: :model => Model that represents your keys you can either use the models supplied under db/, extend them or build your own only constraints: key: find_by_key, translations translation: text, locale
# File lib/fast_gettext/translation_repository/db.rb, line 55 def self.included(base) puts "you no longer need to include the result of require_models" end
# File lib/fast_gettext/translation_repository/db.rb, line 14 def initialize(name,options={}) @model = options[:model] end
# File lib/fast_gettext/translation_repository/db.rb, line 50 def self.require_models folder = "fast_gettext/translation_repository/db_models" require "#{folder}/translation_key" require "#{folder}/translation_text" Module.new do def self.included(base) puts "you no longer need to include the result of require_models" end end end
# File lib/fast_gettext/translation_repository/db.rb, line 38 def [](key) @model.translation(key, FastGettext.locale) end
# File lib/fast_gettext/translation_repository/db.rb, line 22 def available_locales if @model.respond_to? :available_locales @model.available_locales || [] else [] end end
Generated with the Darkfish Rdoc Generator 2.