Created attachment 2235 [details] pootle screenshot There is a problem with \n (newline) and pootle. At the moment there is no possibility to translate \n (newline) with pootle. I think newlines and tabs might be also confusing for new translators. An example: Pootle shows: (see screenshot) - Budget amount cannot be blank\n - Etatsumme darf nicht leer sein\n -------------------- po file: \\n #. SCRIPT #: /home/katrin/kohaclone/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl:84 msgid "- Budget amount cannot be blank\\n" msgstr "- Etatsumme darf nicht leer sein\\n" -------------------- Poedit: - Budget amount cannot be blank\\n - Etatsumme darf nicht leer sein\\n I think the best solution is to removes tabs, newlines etc. from strings that need translation. \\n does not work and is shown behind the translated text as \\n.
I talked to Chris and changed my mind about the best solution: tmpl_process3.pl needs to remove them, when it creates the po file. (23:10:59) chris: ie, you dont translate them (23:11:13) chris: so they dont need to be in the string (23:11:37) kf: but if you remove them, how will they get back in? (23:11:51) chris: the po file works like this (23:12:00) chris: it takes the english line, finds that in the template (23:12:16) chris: and switches out the english words for the translated words (23:12:24) kf: ah, so you work around the rest of the template (23:12:27) chris: if you dont have the \n in the english (23:12:45) chris: then it will find the words without them and change them .. and the \n will stay just fine in the template (23:12:53) chris: make sense? (23:13:17) chris: its actually better that way, cos then if you have the string twice, once with \n once without (23:13:25) chris: you now only need to translate it once (23:13:35) kf: sounds really better (23:13:53) kf: im done with opac ( removing..) but they are really a lot of them in inranet (23:17:10) chris: problem is, they will all come back
> tmpl_process3.pl needs to remove them, when it creates the po file. There are several difficulties : - tmpl_process3.pl is a black box very complex to improve. The way it parse is tricky and un-extensible (for me). Whatever, if templates are switched from HTML::Template to Template::Toolkit, .po generation will have to be entirely recoded. - Carriage return inside text is error prone for translator. It should be forbidden. It mixes text with formating which should be avoided at all.
Hi Frederic, thx for looking into this. > - Carriage return inside text is error prone for translator. It should > be forbidden. It mixes text with formating which should be avoided at > all. I have a tested patch ready for OPAC that I can send later. Intranet will take a bit more work, but if you think it makes sense to remove them I can work on that.
Created attachment 2249 [details] [review] patch: remove \n from opac files
Created attachment 2250 [details] [review] patch. remove \n from staff files
Patches pushed. Please test and close.
Tested successfully, closing bug.