Class: GetText::Tools::MsgMerge
- Inherits:
-
Object
- Object
- GetText::Tools::MsgMerge
- Defined in:
- lib/gettext/tools/msgmerge.rb
Defined Under Namespace
Classes: Merger
Class Method Summary collapse
-
.run(*command_line) ⇒ void
Merge a po-file inluding translated messages and a new pot-file.
Instance Method Summary collapse
-
#run(*command_line) ⇒ void
Merge a po-file inluding translated messages and a new pot-file.
Class Method Details
.run(*command_line) ⇒ void
This method returns an undefined value.
Merge a po-file inluding translated messages and a new pot-file.
This method is provided just for convenience. It equals to
new.run(*command_line)
.
337 338 339 |
# File 'lib/gettext/tools/msgmerge.rb', line 337 def run(*command_line) new.run(*command_line) end |
Instance Method Details
#run(*command_line) ⇒ void
This method returns an undefined value.
Merge a po-file inluding translated messages and a new pot-file.
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/gettext/tools/msgmerge.rb', line 347 def run(*command_line) config = Config.new config.parse(command_line) parser = POParser.new parser.ignore_fuzzy = false definition_po = PO.new reference_pot = PO.new parser.parse_file(config.definition_po, definition_po) parser.parse_file(config.reference_pot, reference_pot) merger = Merger.new result = merger.merge(definition_po, reference_pot) result.order = config.order p result if $DEBUG print result.generate_po if $DEBUG if config.output.is_a?(String) File.open(File.(config.output), "w+") do |file| file.write(result.to_s(config.)) end else puts(result.to_s(config.)) end end |