Commit 9c2d6474 authored by sikeda's avatar sikeda
Browse files

[-dev] $Language::default_lang is no longer available. Use Site->lang or $robot->lang.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@8962 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 06a1e037
......@@ -272,6 +272,7 @@ if (!$main::options{'help'} and $main::options{'health_check'}) {
my %loop_info;
my %msgid_table;
my $latest_msgid_table_cleanup = time;
my $default_lang;
# this loop is run foreach HUP signal received
my $signal = 0;
......@@ -315,8 +316,9 @@ while ($signal ne 'term') { #as long as a SIGTERM is not received }
## Set locale configuration
# Compatibility with version < 2.3.3
$main::options{'lang'} =~ s/\.cat$//
if defined($main::options{'lang'});
$Language::default_lang = $main::options{'lang'} || Site->lang;
if defined $main::options{'lang'};
$default_lang = $main::options{'lang'} || Site->lang;
Language::SetLang($default_lang);
## Main program
if (!chdir(Site->home)) {
......@@ -1175,7 +1177,7 @@ while ($signal ne 'term') { #as long as a SIGTERM is not received }
## them, sleeps a while and continues the good job.
while (!$signal) {
&Language::SetLang($Language::default_lang);
Language::SetLang($default_lang);
&List::init_list_cache();
......@@ -1256,8 +1258,9 @@ while ($signal ne 'term') { #as long as a SIGTERM is not received }
}
## Set NLS default lang for current message
$Language::default_lang = $main::options{'lang'} ||
$default_lang = $main::options{'lang'} ||
&Conf::get_robot_conf($robot_id, 'lang');
Language::SetLang($default_lang);
my $status = &process_message($message_in_spool);
......
......@@ -164,7 +164,7 @@ unless (chdir(Site->home)) {
exit (-1);
}
$Language::default_lang = Site->lang || 'en';
Language::SetLang(Site->lang || 'en');
&Log::do_log('notice', "archived %s Started", Sympa::Constants::VERSION);
......
......@@ -1029,7 +1029,7 @@ my %filtering = ('d_reject_shared' => {'id' => 'qencode'},
&Log::do_log('info', 'WWSympa started');
 
## Set locale configuration
$Language::default_lang = Site->lang;
Language::SetLang(Site->lang);
 
## Important to leave this there because it defined defaults for user_data_source
&SDM::check_db_connect();
......@@ -2856,7 +2856,7 @@ sub check_param_in {
$param->{'list'} = $list->name;
$param->{'subtitle'} = $list->subject;
$param->{'subscribe'} = $list->subscribe->{'name'};
$param->{'send'} = $list->send->{'title'}{$param->{'lang'}}; #FIXME
$param->{'send'} = $list->send->get_current_title() if $list->send;
 
# Pictures are not available unless it is configured for the list and the robot
if ($list->pictures_feature eq 'off') {
......@@ -10932,16 +10932,12 @@ sub _prepare_edit_form {
}
}
}elsif ($pname eq 'lang') {
my $saved_lang = &Language::GetLang();
foreach my $lang (keys %{$p->{'value'}}) {
&Language::SetLang($lang);
my $t = gettext('_language_');
my $t = Language::GetLangName($lang) || $lang;
$t = sprintf '%s (%s)', $t, $lang
if $robot->is_listmaster($param->{'user'}{'email'});
$p->{'value'}{$lang}{'title'} = $t;
}
&Language::SetLang($saved_lang);
} elsif ($pname eq 'available_user_options' or
$pname eq 'default_user_options') {
foreach my $v (@{$p->{'value'}}) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment