Class: FastGettext::PoFile

### Home Classes Methods

### In Files

- lib/fast_gettext/po_file.rb

### Parent

Object

### Methods

- ::to_mo_file

### 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::PoFile

Responsibility:

    - abstract po files for Po Repository

### Public Class Methods

to_mo_file(file, options={}) click to toggle source

    # File lib/fast_gettext/po_file.rb, line 6
    def self.to_mo_file(file, options={})
      require 'fast_gettext/vendor/poparser'
      parser = FastGettext::GetText::PoParser.new

      warn ":ignore_obsolete is no longer supported, use :report_warning" if options.key? :ignore_obsolete
      parser.ignore_fuzzy = options[:ignore_fuzzy]
      parser.report_warning = options.fetch(:report_warning, true)

      mo_file = FastGettext::GetText::MOFile.new
      parser.parse(File.read(file), mo_file)
      MoFile.new(mo_file)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.