Re: [Lazarus] Multi-line msgid in PO file
30.01.2019 20:10, Henry Vermaak via lazarus пишет: > I've had a problem with multi-line translations not working and realised > that an extra '\n' was appended to the last line of the msgid in the PO > file causing the translation lookup to fail. I'm assuming that this is > a bug, but thought I'd ask here first. Multiline translations are used in Lazarus and seem to work? Please send a test project. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Multi-line msgid in PO file
I've had a problem with multi-line translations not working and realised that an extra '\n' was appended to the last line of the msgid in the PO file causing the translation lookup to fail. I'm assuming that this is a bug, but thought I'd ask here first. I've attached a simple patch. Henry Index: components/lazutils/translations.pas === --- components/lazutils/translations.pas (revision 60247) +++ components/lazutils/translations.pas (working copy) @@ -1428,7 +1428,9 @@ for i:=0 to FHelperList.Count-1 do begin s := FHelperList[i]; if (AProp<>'') and (AProp<>'#') then begin - s := '"' + s + '\n"'; + if i < FHelperList.Count - 1 then +s := s + '\n'; + s := '"' + s + '"'; if AProp='#| msgid' then s := '#| ' + s; end else -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus