Class: RDoc::Generator::POT

### Home Classes Methods

### In Files

- lib/rdoc/generator/pot.rb

### Parent

Object

### Methods

- ::new
- #class_dir
- #generate

### Files

- CONTRIBUTING.rdoc
- CVE-2013-0256.rdoc
- ExampleRDoc.rdoc
- LICENSE.rdoc
- Manifest.txt
- README.rdoc
- RI.rdoc
- Rakefile
- TODO.rdoc

### Class/Module Index

Quicksearch

- RDoc
- RDoc::Alias
- RDoc::AnonClass
- RDoc::AnyMethod
- RDoc::Attr
- RDoc::ClassModule
- RDoc::CodeObject
- RDoc::Comment
- RDoc::Constant
- RDoc::Context
- RDoc::Context::Section
- RDoc::CrossReference
- RDoc::ERBIO
- RDoc::ERBPartial
- RDoc::Encoding
- RDoc::Error
- RDoc::Extend
- RDoc::Gauntlet
- RDoc::Generator
- RDoc::Generator::Darkfish
- RDoc::Generator::JsonIndex
- RDoc::Generator::Markup
- RDoc::Generator::POT
- RDoc::Generator::RI
- RDoc::GhostMethod
- RDoc::Include
- RDoc::Markdown
- RDoc::Markdown::Literals
- RDoc::Markup
- RDoc::Markup::AttrChanger
- RDoc::Markup::AttrSpan
- RDoc::Markup::AttributeManager
- RDoc::Markup::Attributes
- RDoc::Markup::BlankLine
- RDoc::Markup::BlockQuote
- RDoc::Markup::Document
- RDoc::Markup::Formatter
- RDoc::Markup::FormatterTestCase
- RDoc::Markup::HardBreak
- RDoc::Markup::Include
- RDoc::Markup::IndentedParagraph
- RDoc::Markup::List
- RDoc::Markup::ListItem
- RDoc::Markup::Paragraph
- RDoc::Markup::Parser
- RDoc::Markup::Parser::Error
- RDoc::Markup::Parser::ParseError
- RDoc::Markup::PreProcess
- RDoc::Markup::Raw
- RDoc::Markup::Rule
- RDoc::Markup::Special
- RDoc::Markup::TextFormatterTestCase
- RDoc::Markup::ToAnsi
- RDoc::Markup::ToBs
- RDoc::Markup::ToHtml
- RDoc::Markup::ToHtmlCrossref
- RDoc::Markup::ToHtmlSnippet
- RDoc::Markup::ToJoinedParagraph
- RDoc::Markup::ToLabel
- RDoc::Markup::ToMarkdown
- RDoc::Markup::ToRdoc
- RDoc::Markup::ToTableOfContents
- RDoc::Markup::ToTest
- RDoc::Markup::ToTtOnly
- RDoc::Markup::Verbatim
- RDoc::MetaMethod
- RDoc::MethodAttr
- RDoc::Mixin
- RDoc::NormalClass
- RDoc::NormalModule
- RDoc::Options
- RDoc::Parser
- RDoc::Parser::C
- RDoc::Parser::ChangeLog
- RDoc::Parser::Markdown
- RDoc::Parser::RD
- RDoc::Parser::Ruby
- RDoc::Parser::RubyTools
- RDoc::Parser::Simple
- RDoc::Parser::Text
- RDoc::RD
- RDoc::RD::BlockParser
- RDoc::RD::Inline
- RDoc::RD::InlineParser
- RDoc::RDoc
- RDoc::RI
- RDoc::RI::Driver
- RDoc::RI::Driver::Error
- RDoc::RI::Driver::NotFoundError
- RDoc::RI::Error
- RDoc::RI::Paths
- RDoc::Require
- RDoc::RubyLex
- RDoc::RubyLex::Error
- RDoc::RubyToken
- RDoc::RubygemsHook
- RDoc::Servlet
- RDoc::SingleClass
- RDoc::Stats
- RDoc::Stats::Normal
- RDoc::Stats::Quiet
- RDoc::Stats::Verbose
- RDoc::Store
- RDoc::Store::Error
- RDoc::Store::MissingFileError
- RDoc::Task
- RDoc::Task
- RDoc::TestCase
- RDoc::TokenStream
- RDoc::TomDoc
- RDoc::TopLevel
- Object

No matching classes.

# RDoc::Generator::POT

Generates a POT file.

Here is a translator work flow with the generator.

## Create .pot

You create .pot file by pot formatter:

    % rdoc --format pot

It generates doc/rdoc.pot.

## Create .po

You create .po file from doc/rdoc.pot. This operation is needed only the first time. This work flow assumes that you are a translator for Japanese.

You create locale/ja/rdoc.po from doc/rdoc.pot. You can use msginit provided by GNU gettext or rmsginit provided by gettext gem. This work flow uses gettext gem because it is more portable than GNU gettext for Rubyists. Gettext gem is implemented by pure Ruby.

    % gem install gettext
    % mkdir -p locale/ja
    % rmsginit --input doc/rdoc.pot --output locale/ja/rdoc.po --locale ja

Translate messages in .po

You translate messages in .po by a PO file editor. po-mode.el exists for Emacs users. There are some GUI tools such as GTranslator. There are some Web services such as POEditor and Tansifex. You can edit by your favorite text editor because .po is a text file. Generate localized documentation

You can generate localized documentation with locale/ja/rdoc.po:

    % rdoc --locale ja

You can find documentation in Japanese in doc/. Yay!

## Update translation

You need to update translation when your application is added or modified messages.

You can update .po by the following command lines:

    % rdoc --format pot
    % rmsgmerge --update locale/ja/rdoc.po doc/rdoc.pot

You edit locale/ja/rdoc.po to translate new messages.

### Constants

DESCRIPTION

  Description of this generator

### Public Class Methods

new(store, options) click to toggle source

Set up a new .pot generator

    # File lib/rdoc/generator/pot.rb, line 67
    def initialize store, options #:not-new:
      @options    = options
      @store      = store
    end

### Public Instance Methods

class_dir() click to toggle source

    # File lib/rdoc/generator/pot.rb, line 83
    def class_dir
      nil
    end

generate() click to toggle source

Writes .pot to disk.

    # File lib/rdoc/generator/pot.rb, line 75
    def generate
      po = extract_messages
      pot_path = 'rdoc.pot'
      File.open(pot_path, "w") do |pot|
        pot.print(po.to_s)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.