Sha256: 3bfe441a15be97a48d060ae96f3b7070165f0d93e653eedda52bba32e43420e7

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

require 'fast_gettext/translation_repository/base'
module FastGettext
  module TranslationRepository
     # Responsibility:
    #  - find and store mo files
    #  - provide access to translations in mo files
    class Mo < Base
      def initialize(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|
          @files[locale] = MoFile.new(file)
        end
      end

      def available_locales
        @files.keys
      end

      protected

      def current_translations
        @files[FastGettext.locale] || MoFile.empty
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grosser-fast_gettext-0.2.11 lib/fast_gettext/translation_repository/mo.rb