METHODS

Constructors

$obj->clone( OPTIONS, VARIABLES )

Returns a new object which copies info from original, and updates it with the specified OPTIONS and VARIABLES. The advantage is that the cached translations are shared between the objects.

» Example: use of clone()
 my $s = __x "found {nr} files", nr => 5;
 my $t = $s->clone(nr => 3);
 my $t = $s->(nr => 3);      # equivalent
 print $s;     # found 5 files
 print $t;     # found 3 files
$class->new( OPTIONS, VARIABLES )
Option Default

_append

undef

_category

undef

_count

undef

_domain

from use

_expand

false

_msgid

undef

_plural

undef

_prepend

undef

_append => STRING
_category => INTEGER
_count => INTEGER
When defined, then _plural need to be defined as well.
_domain => STRING
The textdomain in which this msgid is defined.
_expand => BOOLEAN
Indicates whether variables are filled-in.
_msgid => MSGID
The message label, which refers to some translation information. Usually a string which is close the English version of the error message. This will also be used if there is no translation possible
_plural => MSGID
Can be specified when a _count is specified. This plural form of the message is used to simplify translation, and as fallback when no translations are possible: therefore, this can best resemble an English message.
_prepend => STRING

Accessors

$obj->append

Returns the string or Log::Report::Message object which is appended after this one. Usually undef.

$obj->concat( STRING|OBJECT, [PREPEND] )

This method implements the overloading of concatenation, which is needed to delay translations even longer. When PREPEND is true, the STRING or OBJECT (other Log::Report::Message) needs to prepended, otherwise it is appended.

» Example: of concatenation
 print __"Hello" . ' ' . __"World!";
 print __("Hello")->concat(' ')->concat(__"World!")->concat("\n");
$obj->domain

Returns the domain of the first translatable string in the structure.

$obj->msgid

Returns the msgid which will later be translated.

$obj->prepend

Returns the string which is prepended to this one. Usually undef.

$obj->toString( [LOCALE] )

Translate a message. If not specified, the default locale is used.

$obj->untranslated

Return the concatenation of the prepend, msgid, and append strings. Variable expansions within the msgid is not performed.