Class | GetText::PoMessage
In: | lib/gettext/tools/parser/ruby.rb lib/gettext/tools/pomessage.rb
Parent: | Object

Contains data related to the expression or sentence that is to be translated.

### Methods

== [] add_comment escaped initialize_old max_line_length max_line_length= merge msgctxt? new new new_from_ary plural? to_po_str

### Included Modules

PoMessageForRubyParser

### Constants

PARAMS | = | { :normal => [:msgid], :plural => [:msgid, :msgid_plural], :msgctxt => [:msgctxt, :msgid], :msgctxt_plural => [:msgctxt, :msgid, :msgid_plural] }

### Attributes

comment | [RW] |
msgctxt | [RW] |
msgid | [RW] |
msgid_plural | [RW] | Options
sources | [RW] |
type | [RW] | Required

### Public Class methods

max_line_length()

Gets the max line length.

max_line_length=(len)

Sets the max line length.

new(type)

Create the object. `type` should be :normal, :plural, :msgctxt or :msgctxt_plural.

new(type)
new_from_ary(ary)

For backward comatibility. This doesn’t support “comment”. ary = [msgid1, “file1:line1”, “file2:line”]

### Public Instance methods

==(other)

Checks if the other translation target is mergeable with the current one. Relevant are msgid and translation context (msgctxt).

[](number)
add_comment(new_comment)

Support for extracted comments. Explanation s. www.gnu.org/software/gettext/manual/gettext.html#Names

escaped(param_name)

Returns a parameter representation suitable for po-files and other purposes.

initialize_old(type)

Alias for initialize

merge(other)

Merges two translation targets with the same msgid and returns the merged result. If one is declared as plural and the other not, then the one with the plural wins.

msgctxt?()

Returns true if the type is kind of msgctxt. And if this is a kind of msgctxt and msgctxt property is nil, then raise an RuntimeException.

plural?()

Returns true if the type is kind of plural. And if this is a kind of plural and msgid_plural property is nil, then raise an RuntimeException.

to_po_str()

Output the po message for the po-file.

[Validate]