Class: FastGettext::TranslationRepository::Mo

### Home Classes Methods

### In Files

- lib/fast_gettext/translation_repository/mo.rb

### Parent

FastGettext::TranslationRepository::Base

### Methods

- ::new
- #available_locales
- #current_translations
- #find_and_store_files
- #pluralisation_rule
- #reload

### Class/Module Index

Quicksearch

- FastGettext
- FastGettext::Cache
- FastGettext::GetText
- FastGettext::GetText::MOFile
- FastGettext::GetText::MOFile::HeaderRev1
- FastGettext::GetText::MOFile::InvalidFormat
- FastGettext::GetText::PoParser
- FastGettext::MoFile
- FastGettext::PoFile
- FastGettext::Storage
- FastGettext::Storage::NoTextDomainConfigured
- FastGettext::Translation
- FastGettext::TranslationMultidomain
- FastGettext::TranslationRepository
- FastGettext::TranslationRepository::Base
- FastGettext::TranslationRepository::Chain
- FastGettext::TranslationRepository::Db
- FastGettext::TranslationRepository::Logger
- FastGettext::TranslationRepository::Mo
- FastGettext::TranslationRepository::Po
- FastGettext::TranslationRepository::Yaml
- String
- TranslationKey
- TranslationText

No matching classes.

# FastGettext::TranslationRepository::Mo

Responsibility:

    - find and store mo files
    - provide access to translations in mo files

### Public Class Methods

new(name,options={}) click to toggle source

    # File lib/fast_gettext/translation_repository/mo.rb, line 8
    def initialize(name,options={})
      super
      reload
    end

### Public Instance Methods

available_locales() click to toggle source

    # File lib/fast_gettext/translation_repository/mo.rb, line 13
    def available_locales
      @files.keys
    end

pluralisation_rule() click to toggle source

    # File lib/fast_gettext/translation_repository/mo.rb, line 17
    def pluralisation_rule
      current_translations.pluralisation_rule
    end

reload() click to toggle source

    # File lib/fast_gettext/translation_repository/mo.rb, line 21
    def reload
      find_and_store_files(@name, @options)
      super
    end

### Protected Instance Methods

current_translations() click to toggle source

    # File lib/fast_gettext/translation_repository/mo.rb, line 35
    def current_translations
      @files[FastGettext.locale] || MoFile.empty
    end

find_and_store_files(name,options) click to toggle source

    # File lib/fast_gettext/translation_repository/mo.rb, line 28
    def find_and_store_files(name,options)
      # parse all .mo files with the right name, that sit in locale/LC_MESSAGES folders
      find_files_in_locale_folders(File.join('LC_MESSAGES',"#{name}.mo"), options[:path]) do |locale,file|
        MoFile.new(file)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.