Re: [Lazarus] Replacing LRT format with RSJ

2016-02-17 Thread Mattias Gaertner
On Wed, 17 Feb 2016 18:03:52 +
Denis Kozlov  wrote:

> It would be useful to have a built-in option to regenerate base PO file
> (and update translated PO files) for a project.
> 
> This could involve:
> 1) Removing all existing LRT, LRJ, RST, RSJ.

This can do that:
Run / Clean up and build

> 2) Forcing project to be recompiled to reprocess resourcestrings and
> produce RSJ

See above.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-17 Thread Denis Kozlov
It would be useful to have a built-in option to regenerate base PO file
(and update translated PO files) for a project.

This could involve:
1) Removing all existing LRT, LRJ, RST, RSJ.
2) Forcing project to be recompiled to reprocess resourcestrings and
produce RSJ
3) Forcing forms to be resaved to reprocess LFM and produce LRJ

I have performed these steps manually on several occasions to ensure a
clean regenerated PO file.


On 17 February 2016 at 16:50, Maxim Ganetsky  wrote:

>
> 17.02.2016 18:24, Denis Kozlov пишет:
> > It should be possible to code up an automatic conversion of LRT files
> > directly to RSJ/LSJ, without a need to resave all forms. They both store
> > the same data, but use a different format.
> >
> > Of course, LRT files with already broken strings (as a result of new
> > lines) would be initially mapped 1-to-1 to broken strings in RSJ file,
> > but they will get fixed the next time the form is re-saved.
>
> So users will need to save forms anyway in order to ensure strings
> correctness and to get correct .po files.
>
> Maybe some helper tool that resaves all affected forms in one go can be
> created, though. Don't know how big is demand for it.
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-17 Thread Bart
On 2/17/16, Maxim Ganetsky  wrote:

> So users will need to save forms anyway in order to ensure strings
> correctness and to get correct .po files.
>
> Maybe some helper tool that resaves all affected forms in one go can be
> created, though. Don't know how big is demand for it.

Just announce it on the ML and forum, maybe somewhere on the wiki and
just implement.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-17 Thread Maxim Ganetsky


17.02.2016 18:24, Denis Kozlov пишет:
> It should be possible to code up an automatic conversion of LRT files
> directly to RSJ/LSJ, without a need to resave all forms. They both store
> the same data, but use a different format.
> 
> Of course, LRT files with already broken strings (as a result of new
> lines) would be initially mapped 1-to-1 to broken strings in RSJ file,
> but they will get fixed the next time the form is re-saved.

So users will need to save forms anyway in order to ensure strings
correctness and to get correct .po files.

Maybe some helper tool that resaves all affected forms in one go can be
created, though. Don't know how big is demand for it.

-- 
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-17 Thread Denis Kozlov
It should be possible to code up an automatic conversion of LRT files
directly to RSJ/LSJ, without a need to resave all forms. They both store
the same data, but use a different format.

Of course, LRT files with already broken strings (as a result of new lines)
would be initially mapped 1-to-1 to broken strings in RSJ file, but they
will get fixed the next time the form is re-saved.

Denis

On 16 February 2016 at 17:41, Maxim Ganetsky  wrote:

>
> 16.02.2016 20:31, Giuliano Colla пишет:
> > To actually provide the benefit to users, it would be nice if the
> > transition process would be made automatic in Lazarus IDE.
> > I.e.: If in Project Options "Enable i18n" and "Create/update .po file
> > when saving" are both ticked,  a "Compile" should check for the presence
> > of  .lrt files and behave accordingly, i.e. remove .lrt files and
> > generate again what required.
> >
> > Is that possible?
>
> Not without forcibly saving all affected forms. I don't think it is
> good, because LFMs can change (e.g. when form created in Linux and saved
> in Windows).
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-16 Thread JuuS


On 02/16/2016 05:29 PM, Maxim Ganetsky wrote:
> Hello.
> 
> Currently we use .lrt file to store translatable strings extracted from
> forms.
> 
> This format is broken, because it cannot handle multiline
> resource strings (e.g. multiline hints).

Hi,

I've already submitted a patch, in October, at

http://bugs.freepascal.org/view.php?id=28740

Note that there will be issues from older versions to newer versions.
Read the notes there at the page.

Currently I simply update the laz files after I upgrade because I too
use multiLine hints. This fix will also fix multi-line edits, etc.

Julius

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-16 Thread Maxim Ganetsky


16.02.2016 20:31, Giuliano Colla пишет:
> Il 16/02/2016 17:29, Maxim Ganetsky ha scritto:
>> As a result people using this feature will need to remove their .lrt
>> files and save all affected forms again in order to generate .lrj files.
>> No other changes should be needed.
>>
>> Any comments?
> 
> To actually provide the benefit to users, it would be nice if the
> transition process would be made automatic in Lazarus IDE.
> I.e.: If in Project Options "Enable i18n" and "Create/update .po file
> when saving" are both ticked,  a "Compile" should check for the presence
> of  .lrt files and behave accordingly, i.e. remove .lrt files and
> generate again what required.
> 
> Is that possible?

Not without forcibly saving all affected forms. I don't think it is
good, because LFMs can change (e.g. when form created in Linux and saved
in Windows).

-- 
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Replacing LRT format with RSJ

2016-02-16 Thread Giuliano Colla

Il 16/02/2016 17:29, Maxim Ganetsky ha scritto:

As a result people using this feature will need to remove their .lrt
files and save all affected forms again in order to generate .lrj files.
No other changes should be needed.

Any comments?


To actually provide the benefit to users, it would be nice if the 
transition process would be made automatic in Lazarus IDE.
I.e.: If in Project Options "Enable i18n" and "Create/update .po file 
when saving" are both ticked,  a "Compile" should check for the presence 
of  .lrt files and behave accordingly, i.e. remove .lrt files and 
generate again what required.


Is that possible?

Giuliano


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Replacing LRT format with RSJ

2016-02-16 Thread Maxim Ganetsky
Hello.

Currently we use .lrt file to store translatable strings extracted from
forms.

This format is broken, because it cannot handle multiline
resource strings (e.g. multiline hints).

See the following bug report for details:

http://bugs.freepascal.org/view.php?id=26553

I propose to generate this file in RSJ format (also used by FPC 3.0.0
and up).

Therefore the plan is:

1) Remove LRT support completely, replacing it with RSJ.

2) Although generated file would be in RSJ format its extension will
be .lrj in order to avoid possible filename clashes, e.g.
when output directory is the same as project directory.

As a result people using this feature will need to remove their .lrt
files and save all affected forms again in order to generate .lrj files.
No other changes should be needed.

Any comments?

-- 
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus