Lines 162-194
sub add_form {
Link Here
|
162 |
my $templates = { map { $_ => { message_transport_type => $_ } } sort @$message_transport_types }; |
162 |
my $templates = { map { $_ => { message_transport_type => $_ } } sort @$message_transport_types }; |
163 |
my %letters = ( default => { templates => $templates } ); |
163 |
my %letters = ( default => { templates => $templates } ); |
164 |
|
164 |
|
|
|
165 |
my $translated_languages = C4::Languages::getTranslatedLanguages( |
166 |
'opac', |
167 |
C4::Context->preference('template') |
168 |
); |
165 |
if ( C4::Context->preference('TranslateNotices') ) { |
169 |
if ( C4::Context->preference('TranslateNotices') ) { |
166 |
my $translated_languages = |
|
|
167 |
C4::Languages::getTranslatedLanguages( 'opac', |
168 |
C4::Context->preference('template') ); |
169 |
for my $language (@$translated_languages) { |
170 |
for my $language (@$translated_languages) { |
170 |
for my $sublanguage( @{ $language->{sublanguages_loop} } ) { |
171 |
for my $sublanguage ( @{ $language->{sublanguages_loop} } ) { |
171 |
if ( $language->{plural} ) { |
172 |
if ( $language->{plural} ) { |
172 |
$letters{ $sublanguage->{rfc4646_subtag} } = { |
173 |
$letters{ $sublanguage->{rfc4646_subtag} } = { |
173 |
description => $sublanguage->{native_description} |
174 |
description => $sublanguage->{native_description} . ' ' |
174 |
. ' ' |
175 |
. $sublanguage->{region_description} . ' (' |
175 |
. $sublanguage->{region_description} . ' (' |
176 |
. $sublanguage->{rfc4646_subtag} . ')', |
176 |
. $sublanguage->{rfc4646_subtag} . ')', |
177 |
templates => {%$templates}, |
177 |
templates => { %$templates }, |
|
|
178 |
}; |
178 |
}; |
179 |
} |
179 |
} else { |
180 |
else { |
|
|
181 |
$letters{ $sublanguage->{rfc4646_subtag} } = { |
180 |
$letters{ $sublanguage->{rfc4646_subtag} } = { |
182 |
description => $sublanguage->{native_description} |
181 |
description => $sublanguage->{native_description} . ' (' . $sublanguage->{rfc4646_subtag} . ')', |
183 |
. ' (' |
182 |
templates => {%$templates}, |
184 |
. $sublanguage->{rfc4646_subtag} . ')', |
|
|
185 |
templates => { %$templates }, |
186 |
}; |
183 |
}; |
187 |
} |
184 |
} |
188 |
} |
185 |
} |
189 |
} |
186 |
} |
190 |
$template->param( languages => $translated_languages ); |
187 |
$template->param( languages => $translated_languages ); |
191 |
} |
188 |
} |
|
|
189 |
my $default_language = @{ @{$translated_languages}[0]->{sublanguages_loop} }[0]->{native_description}; |
190 |
$template->param( default_language => $default_language ); |
192 |
if ($letters) { |
191 |
if ($letters) { |
193 |
$template->param( |
192 |
$template->param( |
194 |
modify => 1, |
193 |
modify => 1, |
195 |
- |
|
|