Bug 11225 - \n in translation strings should be removed
Summary: \n in translation strings should be removed
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-09 19:30 UTC by Katrin Fischer
Modified: 2015-06-04 23:23 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: String patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11225: \n in translation strings should be removed (3.31 KB, patch)
2013-11-12 14:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11225: \n in translation strings should be removed (3.31 KB, patch)
2013-11-14 15:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 11225: \n in translation strings should be removed (3.49 KB, patch)
2013-11-24 20:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 11225: \n in translation strings should be removed (3.56 KB, patch)
2013-12-06 13:04 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2013-11-09 19:30:59 UTC
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
Comment 1 Jonathan Druart 2013-11-12 13:33:47 UTC
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.
Comment 2 Katrin Fischer 2013-11-12 13:38:45 UTC
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"
Comment 3 Jonathan Druart 2013-11-12 14:33:27 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-11-12 14:34:55 UTC
(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.
Comment 5 Owen Leonard 2013-11-14 14:25:04 UTC
This patch includes several extra parentheses:

error_msg += _("- Frequency is not defined") + "\n"); <-- like that last one
Comment 6 Jonathan Druart 2013-11-14 15:00:00 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2013-11-24 20:58:15 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall 2013-12-06 13:04:26 UTC
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.
Comment 9 Galen Charlton 2013-12-06 15:16:13 UTC
Pushed to master.  Thanks, Jonathan!
Comment 10 Fridolin Somers 2013-12-24 09:22:26 UTC
Patch pushed to 3.14.x, will be in 3.14.2