NAME
WE::Util::LangString - language-dependent strings
SYNOPSIS
use WE::Util::LangString qw(new_langstring langstring set_langstring);
DESCRIPTION
This module deals with language-dependent strings.
METHODS
- WE::Util::LangString->new(en => "english title", de => "german title")
-
Create a new
WE::Util::LangString
object and optionally initializes the object with values. - new_langstring(en => "english title", de => "german title")
-
Same as the
new
constructor, but shorter form. - $obj->get([$language])
-
Get the value for the specified language. If no language is specified or there is no language value in the object, then the english version is returned. If there is no english version, return the first value found in the object.
- $obj->langstring([$language])
- langstring($string, [$language])
-
This is an alias for
get
. - set_langstring($obj,$language,$string,[$default_language])
-
Set the string
$string
for language$language
to the object$obj
. If$obj
is not yet aWE::Util::LangString
object, then it will be blessed automatically into it. If$language
is not specified, then a default language (as set in$DEFAULT_LANG
, normally english) is used. - dump
-
Dump the content of the langstring as a one-line string.
- concat($oldstr, $newstr)
-
Add
$newstr
to$oldstr
. If$oldstr
is aWE::Util::LangString
object, than add$newstr
to all language variants in the object. If both arguments areWE::Util::LangString
objects, then the corresponding language versions are concatenated.
AUTHOR
Slaven Rezic - slaven@rezic.de