class RDoc::Generator::POT::PO
生成 PO
格式文本
公共类方法
new() 点击以切换源代码
创建一个表示 PO
格式的对象。
# File rdoc/generator/pot/po.rb, line 10 def initialize @entries = {} add_header end
公共实例方法
add(entry) 点击以切换源代码
私有实例方法
add_header() 点击以切换源代码
# File rdoc/generator/pot/po.rb, line 40 def add_header add(header_entry) end
header_entry() 点击以切换源代码
# File rdoc/generator/pot/po.rb, line 44 def header_entry comment = <<-COMMENT SOME DESCRIPTIVE TITLE. Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER This file is distributed under the same license as the PACKAGE package. FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. COMMENT content = <<-CONTENT Project-Id-Version: PACKAGE VERSEION Report-Msgid-Bugs-To: PO-Revision-Date: YEAR-MO_DA HO:MI+ZONE Last-Translator: FULL NAME <EMAIL@ADDRESS> Language-Team: LANGUAGE <[email protected]> Language: MIME-Version: 1.0 Content-Type: text/plain; charset=CHARSET Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=INTEGER; plural=EXPRESSION; CONTENT options = { :msgstr => content, :translator_comment => comment, :flags => ['fuzzy'], } RDoc::Generator::POT::POEntry.new('', options) end
sort_entries() 点击以切换源代码
# File rdoc/generator/pot/po.rb, line 73 def sort_entries headers, messages = @entries.values.partition do |entry| entry.msgid.empty? end # TODO: sort by location sorted_messages = messages.sort_by do |entry| entry.msgid end headers + sorted_messages end