Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Mattias Gaertner
On Thu, 19 Jun 2014 13:30:30 +0300 Juha Manninen wrote: > On Thu, Jun 19, 2014 at 12:50 PM, Mattias Gaertner > wrote: > > The rst to po converter. > > That is part of FPC project. No. It's in lcl/translations.pas line 973: if MultiLinedValue then begin // check t

Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Juha Manninen
On Thu, Jun 19, 2014 at 12:50 PM, Mattias Gaertner wrote: > The rst to po converter. That is part of FPC project. Even if it was fixed now we cannot start using embedded newlines right away because the previous version of FPC must be supported. > #13 works in message dialogs on all platforms. W

Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Mattias Gaertner
On Thu, 19 Jun 2014 12:01:57 +0300 Juha Manninen wrote: > On Wed, Jun 18, 2014 at 10:44 AM, Mattias Gaertner > wrote: > > In the old days special characters were not converted properly. > > > > I just tested: > > > > 'A'#10'BC' is converted to > > msgid "" > > "A\n" > > "BC\n" > > > > Note the n

Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Juha Manninen
On Wed, Jun 18, 2014 at 10:44 AM, Mattias Gaertner wrote: > In the old days special characters were not converted properly. > > I just tested: > > 'A'#10'BC' is converted to > msgid "" > "A\n" > "BC\n" > > Note the new line behind BC. When this is fixed, I can adapt the 'Make > resourcestring dial

Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Mattias Gaertner
On Thu, 19 Jun 2014 08:27:27 +0200 Péter Gábor wrote: >[...] > The second ("all-are-the-same") approach is used by ShowMessage(). > The following will have 3 line breaks inside the string on all operating > systems: > ShowMessage('How'#10'many'#13'lines'#13#10'here?'); Many LCL strings acc

Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Mattias Gaertner
On Thu, 19 Jun 2014 08:27:27 +0200 Péter Gábor wrote: > PO-reader works system specific so \n will be converted to #10 on linux > and #13#10 on windows, etc. > > But what does PO-writer with #10, #13 and #13#10 in a single > resourcestring? Like this: 'How'#10'many'#10'lines'#13#10'here?' 'How\

Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Mattias Gaertner
On Thu, 19 Jun 2014 07:07:53 +0200 Péter Gábor wrote: > I asked about different LineEndigs because of the resourcestrings which > are written by developers working on different operating systems. > They may put different LineEnding in resourcestrings if they don't use > the LineEnding constant, b

Re: [Lazarus] Resource strings and newline

2014-06-19 Thread Václav Valíček
Yes, it could be problem. I was writing #13#10 under windows, but when I started to rewrite localizations in some of my sources, I'm using resourceString = 'This is multiline' + sLineBreak + 'resourcestring.' I think that to type new line after sLineBreak, LineEnding etc. Is very good for

Re: [Lazarus] Resource strings and newline

2014-06-18 Thread Péter Gábor
PO-reader works system specific so \n will be converted to #10 on linux and #13#10 on windows, etc. But what does PO-writer with #10, #13 and #13#10 in a single resourcestring? Like this: 'How'#10'many'#10'lines'#13#10'here?' It converts only the system specific LineEnding to \n or it converts al

Re: [Lazarus] Resource strings and newline

2014-06-18 Thread Péter Gábor
I asked about different LineEndigs because of the resourcestrings which are written by developers working on different operating systems. They may put different LineEnding in resourcestrings if they don't use the LineEnding constant, but writing #13#10 or #10 or #13 as it is usual on their system.

Re: [Lazarus] Resource strings and newline

2014-06-18 Thread Sven Barth
Am 18.06.2014 18:32 schrieb "Péter Gábor" : > > > > 2014-06-18 09:44 keltezéssel, Mattias Gaertner írta: > > In the old days special characters were not converted properly. > > > > I just tested: > > > > 'A'#10'BC' is converted to > > msgid "" > > "A\n" > > "BC\n" > > > > Note the new line behind B

Re: [Lazarus] Resource strings and newline

2014-06-18 Thread Péter Gábor
2014-06-18 09:44 keltezéssel, Mattias Gaertner írta: > In the old days special characters were not converted properly. > > I just tested: > > 'A'#10'BC' is converted to > msgid "" > "A\n" > "BC\n" > > Note the new line behind BC. When this is fixed, I can adapt the 'Make > resourcestring dialo

Re: [Lazarus] Resource strings and newline

2014-06-18 Thread Mattias Gaertner
On Tue, 17 Jun 2014 21:12:02 +0300 Juha Manninen wrote: > I must say I agree mostly. > Does anybody know why parameters are currently used for newlines? Logically > parameters are meant for varying data. In the old days special characters were not converted properly. I just tested: 'A'#10'BC'

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Václav Valíček
I'm not sure, it it is real reason, but I was forced to use delphi gettext lib becose Lazarus/Freepascal po parser was unable to load \n into translated resourcestring or maybe wasn't able to generate po file with \n... Really not sure.. Václav Valíček vac...@valicek.name Dne 17.6.2014 20:12,

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Juha Manninen
I must say I agree mostly. Does anybody know why parameters are currently used for newlines? Logically parameters are meant for varying data. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailma

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Péter Gábor
Sometimes translators (and maybe developers) need to reorder the appearance of parameters using the parameter ordering feature of Format() function. See: http://www.freepascal.org/docs-html/rtl/sysutils/format.html Which is very difficult without exactly knowing the meaning of all %s symbols. Here

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Václav Valíček
Václav Valíček vac...@valicek.name Dne 17.6.2014 11:24, Juha Manninen napsal(a): Format should not convert \n. This is the job of the .po reader. Right, the .po reader converts it back to system specific line-ending. Václav, apparently it works if you add #13#10 to a resource string. It shows

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Juha Manninen
On Tuesday, June 17, 2014, Péter Gábor wrote: > > > Can someone change the title of the bug-report #26343 to something > that is more descriptive and refers to what we are talking about there? > > eg.: lazaruside.*.po contains semi converted and/or confusing strings: > "%s%s%s" > I will explain w

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Péter Gábor
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi! Can someone change the title of the bug-report #26343 to something that is more descriptive and refers to what we are talking about there? eg.: lazaruside.*.po contains semi converted and/or confusing strings: "%s%s%s" - -- Péter Gábor p...@fre

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Juha Manninen
> Format should not convert \n. This is the job of the .po reader. Right, the .po reader converts it back to system specific line-ending. Václav, apparently it works if you add #13#10 to a resource string. It shows as \n in .po files and you can use it in translations, too. No need for an extra t

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Sven Barth
Am 17.06.2014 07:37 schrieb "Juha Manninen" : > > Could somebody please explain what happens when there is #13#10 in a > resource string. > > See issue > http://bugs.freepascal.org/view.php?id=26343 > and a note: > http://bugs.freepascal.org/view.php?id=26343#c75738 > > It is converted to \n in

Re: [Lazarus] Resource strings and newline

2014-06-17 Thread Václav Valíček
In my opinion, ti should be solved... I am adding \n into po files translations of licences, where the new line is needed. But If I need linebreak in resourcestring, it's not really comfortable to replace every linebreak with %s and Format() param - it decreases readablity of file... In my apps

Re: [Lazarus] Resource strings and newline

2014-06-16 Thread Michael Van Canneyt
On Tue, 17 Jun 2014, Juha Manninen wrote: Could somebody please explain what happens when there is #13#10 in a resource string. See issue http://bugs.freepascal.org/view.php?id=26343 and a note: http://bugs.freepascal.org/view.php?id=26343#c75738 It is converted to \n in .po file strings.

[Lazarus] Resource strings and newline

2014-06-16 Thread Juha Manninen
Could somebody please explain what happens when there is #13#10 in a resource string. See issue http://bugs.freepascal.org/view.php?id=26343 and a note: http://bugs.freepascal.org/view.php?id=26343#c75738 It is converted to \n in .po file strings. However Format() does not convert \n. How can