Class: YARD::I18n::POParser
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/yard/i18n/po_parser.rb |
Overview
Class Attribute Summary
- .available? ⇒ Boolean readonly
Instance Method Summary
-
#parse(file) ⇒ Hash<String, String>
Parses PO file.
Class Attribute Details
.available? ⇒ Boolean
(readonly)
# File 'lib/yard/i18n/po_parser.rb', line 37
def available? !@@gettext_version.nil? end
Instance Method Details
#parse(file) ⇒ Hash<String, String>
Parses PO file.
# File 'lib/yard/i18n/po_parser.rb', line 46
def parse(file) case @@gettext_version when 2 parser = GetText::PoParser.new data = GetText::MoFile.new when 3 parser = GetText::POParser.new data = GetText::MO.new end parser.report_warning = false parser.parse_file(file, data) data end