Class: TranslationKey
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- TranslationKey
- Defined in:
- lib/fast_gettext/translation_repository/db_models/translation_key.rb
Class Method Summary collapse
Class Method Details
.available_locales ⇒ Object
15 16 17 |
# File 'lib/fast_gettext/translation_repository/db_models/translation_key.rb', line 15 def self.available_locales @@available_locales ||= TranslationText.count(:group=>:locale).keys.sort end |
.translation(key, locale) ⇒ Object
9 10 11 12 13 |
# File 'lib/fast_gettext/translation_repository/db_models/translation_key.rb', line 9 def self.translation(key, locale) return unless translation_key = find_by_key(key) return unless translation_text = translation_key.translations.find_by_locale(locale) translation_text.text end |