Koha populates the lanugage attribute of the html tag on all pages with the language code of the currently selected language. Apart from other things this allows customizations using the language code to control visibility of translated text. This works well, but for the system preference editor, where the language attribute is empty: <html lang="">
*** Bug 19591 has been marked as a duplicate of this bug. ***
The problem is that $lang is send to the template from preferences.pl and overwrites the normal $lang variable. I *think* the variable is not used/never properly set.
Created attachment 77634 [details] [review] Bug 20504: Fix lang attribute in html tag on systempreferences page On the system preferences page the lang attribute of the html tag is always empty. To test: - Go to systempreferences - Check the html source and look at the html tag, it should read: <html lang=""> - Apply patch - Check the html source again: <html lang="en"> Verify the language code shown matches the currently selected language in the staff interface - Verify the language system preferences work correctly
I am not totally sure about this one - it seems that the $lang variable in the preferences code was never set and not used in the template. But by overwriting the existing lang template variable, it broke the lang attribute in the html tag.
Created attachment 77636 [details] [review] Bug 20504: Fix lang attribute in html tag on systempreferences page On the system preferences page the lang attribute of the html tag is always empty. To test: - Go to systempreferences - Check the html source and look at the html tag, it should read: <html lang=""> - Apply patch - Check the html source again: <html lang="en"> Verify the language code shown matches the currently selected language in the staff interface - Verify the language system preferences work correctly Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> The problem was actually that $lang = $template->param( 'lang' ); should certainly be $lang = $input->param( 'lang' ); and, as it, it overrides the value of 'lang' passed from C4::Auth
Created attachment 78049 [details] [review] Bug 20504: Fix lang attribute in html tag on systempreferences page On the system preferences page the lang attribute of the html tag is always empty. To test: - Go to systempreferences - Check the html source and look at the html tag, it should read: <html lang=""> - Apply patch - Check the html source again: <html lang="en"> Verify the language code shown matches the currently selected language in the staff interface - Verify the language system preferences work correctly Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> The problem was actually that $lang = $template->param( 'lang' ); should certainly be $lang = $input->param( 'lang' ); and, as it, it overrides the value of 'lang' passed from C4::Auth Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.03
Pushed to 17.11.x for 17.11.10