NAME
Apache::Language::SW - LanguageHandler for SmartWorker Applications
SYNOPSIS
sub new
{
my $classname = shift;
my $self = $classname->SUPER::new(@_);
$self->{Language} = new Apache::Language($self);
[...]
}
[...]
-text => $self->{Language}{"keyName1"},
[...]
#outside a FormPanel
$Panel->addElement(x,y,$self->{Language}->getLanguagePicker());
#inside a FormPanel
$Panel->addElement(x,y,$self->{Language}->getLanguagePicker("formPanel1));
[...]
DESCRIPTION
This is the new way to handle Language in SW::Applications. The interface is a tied hash, so you can use the object returned by Apache::Language like any other hash reference.
There are also a few function calls you can make on it, like the getLanguagePicker() sub that returns a Language picker panel ready to insert in your application.
The only restriction with this module is that it uses the 'Lang' key to find wanted languages. So it sets it in the Session/Data stuff. So don't do this:
$self->{Lang} = "I love perl";
or
$self->setSessionValue("Lang","I love perl");
ok ?
But you can look at it if you want to know what language are requested by the user, but I advise against it.
METHODS
getLanguagePicker - Returns a formpanel with a correct language picker for the current user.
Arguments : if already in form context, call it with the name of the formpanel you are adding it to.
AUTHOR
Philippe M. Chiasson HBE gozer@hbe.ca Sept 9/99
REVISION HISTORY
$Log$
SEE ALSO
perl(1).
Apache::Language(3).
Apache::Language::*(3).