Bug 6958 - Missing spaces in translated templates
Summary: Missing spaces in translated templates
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: PATCH-Sent (DO NOT USE) critical (vote)
Assignee: Frédéric Demians
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-02 21:14 UTC by Katrin Fischer
Modified: 2019-06-27 09:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 6958 : Fix for leading spaces being stripped on translation (1.57 KB, patch)
2011-10-04 20:37 UTC, Chris Cormack
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 6958 : Fix for leading spaces being stripped on translation (1.87 KB, patch)
2011-10-05 05:59 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2011-10-02 21:14:24 UTC
I noticed that especially in breadcrubs and texts that contains links and normal text spaces are missing from the po file and so from the translated templates.

Examples: 
1) Breadcrumbs on patron module start page:
English: Start > Patrons
German: Start> Benutzer

The po file for the first part of the breadcrumbs looks like this:
[...]
#: intranet-tmpl/prog/en/modules/errors/405.tt:10
#, c-format
msgid "Home"
msgstr "Start"

When changing "Start" to "Start " the templates look correct.

This is only an example, the spaces before the > are missing in general on all breadcrumbs.

2) Fines on patron account (check out tab)
English: Fines: Patron has Outstanding fines of 1.00. Make Payment
German: Gebühren:Benutzer hat offene Gebühren in Höhe von 1.00. Zahlung

The space after Fines: is missing.

The po fiole looks like this:
#: intranet-tmpl/prog/en/modules/circ/circulation.tt:574
#, c-format
msgid "Fines:"
msgstr "Gebühren:"

#: intranet-tmpl/prog/en/modules/circ/circulation.tt:569
#: intranet-tmpl/prog/en/modules/circ/circulation.tt:574
#, c-format
msgid "Patron has "
msgstr "Benutzer hat "

There are lot of other examples.
Comment 1 Chris Cormack 2011-10-03 20:39:40 UTC
Hmm it looks like its the replacement when putting the .po file back into the templates that is the problem.

Investigating more
Comment 2 Chris Cormack 2011-10-03 21:12:17 UTC
Right here the problem

</a> &rsaquo; Error 405</div>
Becomes
</a>&rsaquo; Fehler 405</div>

Tracking down why now
Comment 3 Frédéric Demians 2011-10-04 07:29:31 UTC
> Tracking down why now

I've tried without success. It seems that stings containing &rsaquo; are parsed as a TEXT_PARAMATRIZED tokens, which is false.
Comment 4 Chris Cormack 2011-10-04 07:32:54 UTC
I have a patch which adds the space back in. Katrin is testing it more, to make sure it has no unintended side effects. Its not a very elegant solution but seems to work.

Ill attach it to the bug once Katrin has a little more time to test
Comment 5 Chris Cormack 2011-10-04 20:37:49 UTC Comment hidden (obsolete)
Comment 6 Chris Cormack 2011-10-04 20:38:43 UTC
Please test a lot, it is pretty harmless only adds whitespace if needed.
Comment 7 Katrin Fischer 2011-10-05 05:59:14 UTC
Created attachment 5712 [details] [review]
[SIGNED-OFF] Bug 6958 : Fix for leading spaces being stripped on translation

Tested on 5.4.x with complete German po files.
Comment 8 Ian Walls 2011-10-06 13:46:20 UTC
The logic in this patch looks sound; the same basic functionality is preserved, with an expansion in the event that the string starts with leading spaces, which are now preserved.  Logic is actually now much more readable, so improvement there.  Marking as Passed QA.
Comment 9 Chris Cormack 2011-10-06 20:47:56 UTC
Pushed, please test