Zitat von Mattias Gärtner <[EMAIL PROTECTED]>:
> Zitat von Mattias Gaertner <[EMAIL PROTECTED]>:
>
> > On Mon, 01 Oct 2007 00:15:16 +0100
> > Luis Rodrigues <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> > >
> > > Attached there is a patch do implement app localization automatically.
> > >
> > > If Enable 18n is checked in project options when an app is compiled a
> > > appname.po file is generated with the forms strings and
> > > resourcestrings.
> > >
> > > Then create a languages/LANG in the program working directory (there
> > > are other options, check defaulttranslator.pas), compile the po into
> > > a mo file and place it there.
> > >
> > > Is also necessary to add DefaultTranslator.pas do the main unit uses
> > > clause.
> > >
> > > This patch mainly cleans the existing code that was {IFDEFed
> > > TRANSLATESTRING}.
> > >
> > > Comments please.
> >
> > I will take a look.
>
> I think the direction is good, but there are some issues:
>
> Basically you enable the experimental LRT code *and* remove the working and
> used
> RST code. So it breaks existing packages/projects. This must be improved. See
> below.
>
> It collects the .rst and .lrt file for each project file - even if the file
> does
> not belong to the project. Add a check (Project1.Files[i].IsPartOfProject).
>
> It puts them all together into one stringlist and checks with a linear search
> for doubles. That's too slow for the several thousand strings.
>
> It always recreate the .po file, even if nothing changed. It should at least
> check the .po file. Otherwise a readonly file will stop the update.
>
> Some error checks and dialogs are missing (e.g. failing to read/write a
> file).
>
> The .po file is created in the source directory and has the name of the
> project.
> This should be configurable. For example the .po file should have the same
> name
> as the target executable, and/or the .po files should be placed into a sub
> directory. It should at least check if the old 'RST/OutDir' config variable
> exists and use that as default.
I forgot:
What about packages?
The old RST code works with packages too. If a package is compiled, the package
files should be checked, not the project files.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives