In the site starter, allow users to pick the default language for a site based on installed language packs. Adds RFE #10727.
This commit is contained in:
parent
f3a4bd1b68
commit
7c240127e8
4 changed files with 91 additions and 10 deletions
|
|
@ -17,7 +17,7 @@ use WebGUI::Content::Setup;
|
|||
|
||||
# load your modules here
|
||||
|
||||
use Test::More tests => 2; # increment this value for each test you create
|
||||
use Test::More tests => 8; # increment this value for each test you create
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
|
|
@ -28,3 +28,42 @@ isnt(WebGUI::Content::Setup::handler($session), undef, "Setup should return some
|
|||
$session->setting->remove("specialState");
|
||||
is(WebGUI::Content::Setup::handler($session), undef, "Setup shouldn't return anything when no special state is present");
|
||||
|
||||
$session->request->setup_body({
|
||||
step => 2,
|
||||
timeZone => 'America/New_York',
|
||||
language => 'Spanish',
|
||||
});
|
||||
|
||||
$session->setting->set("specialState", "init");
|
||||
WebGUI::Content::Setup::handler($session);
|
||||
|
||||
my $admin = WebGUI::User->new($session, '3');
|
||||
is($admin->get('language'), 'Spanish', 'Admin language set to Spanish');
|
||||
is($admin->get('timeZone'), 'America/New_York', 'Admin timezone set to America/New_York');
|
||||
|
||||
my $visitor = WebGUI::User->new($session, '1');
|
||||
is($visitor->get('language'), 'Spanish', 'Visitor language set to Spanish');
|
||||
is($visitor->get('timeZone'), 'America/New_York', 'Visitor timezone set to America/New_York');
|
||||
|
||||
my $zoneField = WebGUI::ProfileField->new($session, 'timeZone');
|
||||
is $zoneField->get('dataDefault'), 'America/New_York', 'timezone profile field default set to America/New_York';
|
||||
|
||||
my $languageField = WebGUI::ProfileField->new($session, 'language');
|
||||
is $languageField->get('dataDefault'), 'Spanish', 'timezone profile field default set to Spanish';
|
||||
|
||||
$admin->update( { language => 'English' } );
|
||||
$visitor->update({ language => 'English' } );
|
||||
|
||||
$admin->update( { timeZone => 'America/Chicago' } );
|
||||
$visitor->update({ timeZone => 'America/Chicago' } );
|
||||
|
||||
my $properties;
|
||||
$properties = $zoneField->get();
|
||||
$properties->{dataDefault} = 'America/Chicago';
|
||||
$zoneField->set($properties);
|
||||
|
||||
$properties = $languageField->get();
|
||||
$properties->{dataDefault} = 'English';
|
||||
$zoneField->set($properties);
|
||||
|
||||
$session->setting->remove("specialState");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue