View | Details | Raw Unified | Return to bug 18911
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (+29 lines)
Lines 153-158 Link Here
153
                                    <i>Please contact a library staff member if you are unsure of your mobile service provider, or you do not see your provider in this list.</i>
153
                                    <i>Please contact a library staff member if you are unsure of your mobile service provider, or you do not see your provider in this list.</i>
154
                                </li></ol>
154
                                </li></ol>
155
                            [% END %]
155
                            [% END %]
156
157
                            [% IF Koha.Preference('TranslateNotices') %]
158
                                <ol>
159
                                    <li>
160
                                        <label for="lang">Preferred language for notices: </label>
161
                                        <select id="lang" name="lang">
162
                                            <option value="default">Default</option>
163
                                            [% FOR language IN languages %]
164
                                                [% FOR sublanguage IN language.sublanguages_loop %]
165
                                                    [% IF language.plural %]
166
                                                        [% IF sublanguage.rfc4646_subtag == patron_lang %]
167
                                                            <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
168
                                                        [% ELSE %]
169
                                                            <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
170
                                                        [% END %]
171
                                                    [% ELSE %]
172
                                                        [% IF sublanguage.rfc4646_subtag == patron_lang %]
173
                                                            <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
174
                                                        [% ELSE %]
175
                                                            <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
176
                                                        [% END %]
177
                                                    [% END # /IF language.plural %]
178
                                                [% END # /FOR sublanguage %]
179
                                            [% END #/FOR language %]
180
                                        </select> <!-- /#lang -->
181
                                    </li>
182
                                </ol>
183
                            [% END #/IF Koha.Preference('TranslateNotices') %]
184
156
                        </fieldset>
185
                        </fieldset>
157
186
158
                        <fieldset class="action">
187
                        <fieldset class="action">
(-)a/opac/opac-messaging.pl (-1 / +12 lines)
Lines 69-74 if ( defined $query->param('modify') && $query->param('modify') eq 'yes' ) { Link Here
69
    })->store;
69
    })->store;
70
70
71
    C4::Form::MessagingPreferences::handle_form_action($query, { borrowernumber => $patron->borrowernumber }, $template);
71
    C4::Form::MessagingPreferences::handle_form_action($query, { borrowernumber => $patron->borrowernumber }, $template);
72
73
    if ( C4::Context->preference('TranslateNotices') ) {
74
        $patron->set({ lang => scalar $query->param('lang') })->store;
75
    }
72
}
76
}
73
77
74
C4::Form::MessagingPreferences::set_form_values({ borrowernumber     => $patron->borrowernumber }, $template);
78
C4::Form::MessagingPreferences::set_form_values({ borrowernumber     => $patron->borrowernumber }, $template);
Lines 91-94 $template->param( Link Here
91
        }),
95
        }),
92
);
96
);
93
97
98
if ( C4::Context->preference('TranslateNotices') ) {
99
    my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('template') );
100
    $template->param(
101
        languages => $translated_languages,
102
        patron_lang => $patron->lang,
103
    );
104
}
105
94
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
106
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
95
- 

Return to bug 18911