Module: Translator

Defined in:
lib/rails-translator.rb,
lib/translator/version.rb,
lib/translator/translates.rb

Defined Under Namespace

Modules: Translates

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.fallback_localeObject



3
# File 'lib/translator/translates.rb', line 3

def fallback_locale  ()        @fallback_locale  ||= nil         end

.fallback_locale=(locale) ⇒ Object



4
# File 'lib/translator/translates.rb', line 4

def fallback_locale= (locale)  @fallback_locale    = locale.to_s end

.prefixed(name) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/translator/translates.rb', line 8

def prefixed name
  if prefixed_locales.empty?
    name.to_sym
  else
    prefixed_locales.map do |locale|
      "#{locale}_#{name}".to_sym
    end
  end
end

.prefixed_localesObject



5
# File 'lib/translator/translates.rb', line 5

def prefixed_locales ()        @prefixed_locales ||= []          end

.prefixed_locales=(locales) ⇒ Object



6
# File 'lib/translator/translates.rb', line 6

def prefixed_locales=(locales) @prefixed_locales   = locales     end