Examples:
require "gettext/tools/xgettext"
class FooParser
def target?(path)
File.extname(path) == ".foo" end
def parse(path, options={})
po = []
entry = POEntry.new(:normal)
entry.msgid = "hello"
entry.references = ["foo.rb:200", "bar.rb:300"]
entry.("Comment for the entry")
po << entry
entry = POEntry.new(:plural)
entry.msgid = "An apple"
entry.msgid_plural = "Apples"
entry.references = ["foo.rb:200", "bar.rb:300"]
po << entry
entry = POEntry.new(:msgctxt)
entry.msgctxt = "context"
entry.msgid = "hello"
entry.references = ["foo.rb:200", "bar.rb:300"]
po << entry
entry = POEntry.new(:msgctxt_plural)
entry.msgctxt = "context"
entry.msgid = "An apple"
entry.msgid_plural = "Apples"
entry.references = ["foo.rb:200", "bar.rb:300"]
po << entry
return po
end
end
GetText::Tools::XGetText.add_parser(FooParser.new)