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::LangStringobject and optionally initializes the object with values. - new_langstring(en => "english title", de => "german title")
-
Same as the
newconstructor, 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
$stringfor language$languageto the object$obj. If$objis not yet aWE::Util::LangStringobject, then it will be blessed automatically into it. If$languageis 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
$newstrto$oldstr. If$oldstris aWE::Util::LangStringobject, than add$newstrto all language variants in the object. If both arguments areWE::Util::LangStringobjects, then the corresponding language versions are concatenated.
AUTHOR
Slaven Rezic - slaven@rezic.de