Some strings in the serials module contain linebreaks \n that cause problems in translation. Example: "Cannot test prediction pattern for the following reason(s):\\n \\n
Katrin, What is the problem? When I update the po file, I get: msgid "Cannot test prediction pattern for the following reason(s):\\n\\n" I update the translation: msgstr "TEST TRANSLATION\n\n" I install the templates and I get: alert(_("TEST TRANSLATION:\n\n") + error_msg); I don't know how we could add a new line without \n.
Hi Jonathan, did you translate the string using pootle or did you do it manually in the text file? It used to be a bug in Pootle causing problems with escaping (bug 4883) An easy way to solve it, and also not have the confusing \n in translation is concatenating: _("Cannot test prediction pattern for the following reason(s):") + "\\n\\n"
Created attachment 22880 [details] [review] Bug 11225: \n in translation strings should be removed Some strings in the serials module contain linebreaks \n that cause problems in translation. Test plan: - Update your po file - Verify that strings in serials/subscription-add.tt and serials/subscription-numberpatterns.tt are present and don't contain "\n" character.
(In reply to Katrin Fischer from comment #2) > Hi Jonathan, > > did you translate the string using pootle or did you do it manually in the > text file? It used to be a bug in Pootle causing problems with escaping (bug > 4883) Yes, manually! > An easy way to solve it, and also not have the confusing \n in translation > is concatenating: > > _("Cannot test prediction pattern for the following reason(s):") + "\\n\\n" Yep, of course. I provided a patch fixing strings introduced by bug 7688 with this way.
This patch includes several extra parentheses: error_msg += _("- Frequency is not defined") + "\n"); <-- like that last one
Created attachment 22934 [details] [review] Bug 11225: \n in translation strings should be removed Some strings in the serials module contain linebreaks \n that cause problems in translation. Test plan: - Update your po file - Verify that strings in serials/subscription-add.tt and serials/subscription-numberpatterns.tt are present and don't contain "\n" character.
Created attachment 23120 [details] [review] [SIGNED OFF] Bug 11225: \n in translation strings should be removed Some strings in the serials module contain linebreaks \n that cause problems in translation. Test plan: - Update your po file - Verify that strings in serials/subscription-add.tt and serials/subscription-numberpatterns.tt are present and don't contain "\n" character. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Template only change, passes all tests and QA script. Updated po files now contain only the strings and no line breaks.
Created attachment 23339 [details] [review] Bug 11225: \n in translation strings should be removed Some strings in the serials module contain linebreaks \n that cause problems in translation. Test plan: - Update your po file - Verify that strings in serials/subscription-add.tt and serials/subscription-numberpatterns.tt are present and don't contain "\n" character. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Template only change, passes all tests and QA script. Updated po files now contain only the strings and no line breaks. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> No regressions found. Passes koha-qa.pl and xt.
Pushed to master. Thanks, Jonathan!
Patch pushed to 3.14.x, will be in 3.14.2