module SerialTranslator

Constants

VERSION

Public Instance Methods

current_translation_locale() click to toggle source
# File lib/serial_translator.rb, line 90
def current_translation_locale
  (@current_translation_locale || I18n.locale).to_sym
end
translated_into?(locale) click to toggle source
# File lib/serial_translator.rb, line 111
def translated_into?(locale)
  translated_locales.include?(locale.to_sym)
end
translated_locales() click to toggle source
# File lib/serial_translator.rb, line 98
def translated_locales
  result = []
  self.class.serial_translator_attributes.each do |attribute|
    translations = translations_for(attribute).select { |_, value| value.present? }
    result += translations.keys
  end
  result.uniq
end
translation_fallback?() click to toggle source
# File lib/serial_translator.rb, line 94
def translation_fallback?
  @translation_fallback != false
end
translations_for(attribute) click to toggle source
# File lib/serial_translator.rb, line 107
def translations_for(attribute)
  __send__(:"#{attribute}_translations") || {}
end