Class: FastGettext::PoFile
Overview
Responsibility:
- abstract po files for Po Repository
Constant Summary
Constants inherited from MoFile
MoFile::CONTEXT_SEPARATOR, MoFile::PLURAL_SEPARATOR
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, options = {}) ⇒ PoFile
constructor
A new instance of PoFile.
Methods inherited from MoFile
#[], #data, empty, #plural, #pluralisation_rule
Constructor Details
#initialize(file, options = {}) ⇒ PoFile
Returns a new instance of PoFile.
8 9 10 11 |
# File 'lib/fast_gettext/po_file.rb', line 8 def initialize(file, = {}) @options = super end |
Class Method Details
.parse_po_file(file, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fast_gettext/po_file.rb', line 17 def self.parse_po_file(file, = {}) require 'fast_gettext/vendor/poparser' parser = FastGettext::GetText::PoParser.new warn ":ignore_obsolete is no longer supported, use :report_warning" if .key? :ignore_obsolete parser.ignore_fuzzy = [:ignore_fuzzy] parser.report_warning = .fetch(:report_warning, true) mo_file = FastGettext::GetText::MOFile.new parser.parse_file(file, mo_file) mo_file end |