https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42370 Bug ID: 42370 Summary: locale=C breaks on the fly translations Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org Preparations for testing in KTD: - Install a translation, for example swedish: $ sudo koha-translate -d kohadev -i sv-SE - Enable sv-SE for OPACLanguages. - Set opaclanguagesdisplay = Allow. - Go to the OPAC. - Choose Swedish as your language. - Make sure you are not logged in. - Verify that the word for "Card number" in the login form *is* translated. To reproduce the problem set your locale to C: - $ sudo dpkg-reconfigure locales Choose to generate sv_SE.UTF-8 (for me it was option 271) When asked "Default locale for the system environment" choose the C option, for me it was 2. - $ restart_all - Go to the OPAC and refresh the front page. - Make sure you are not logged in. - Make sure your installed translation is the active language. - Verify that "Card number" in the login form is *not* translated, but the rest of the page is. This problem affects all template strings that are translated on the fly, which means they are enclosed in t(), tx(), tn() etc in the templates. For us, the solution was to change the locale on the server, so this bug report might be a "won't fix", but maybe it will be a help to future searchers. It has been suggested that it would be a good idea to change this in Koha::I18N: # LANG needs to be set to a valid locale, # otherwise LANGUAGE is ignored $ENV{LANG} = $system_locales[0]; POSIX::setlocale( LC_MESSAGES, '' ); To this: # LANG needs to be set to a valid locale, # otherwise LANGUAGE is ignored $ENV{LANG} = $system_locales[0]; setlocale(LC_MESSAGES, $locale . '.utf8'); But I have not tested that properly. Another suggestion might be to have a warning on the "About Koha" page if the locale on the server is set to C. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.