View Issue Details

IDProjectCategoryView StatusLast Update
0038331LazarusIDEpublic2021-01-10 00:43
Reporterlainz Assigned ToMaxim Ganetsky  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version2.1 (SVN) 
Summary0038331: Lazarus keeps deleting translations
DescriptionHi, as you can see in the screenshot, lazarus is deleting a lot of translations, even if there was no changes in "tfrmbalanza" as you can see that unit didn't change since last commit (and since a lot of time I can confirm).

If I search for "Printer:" translation is not added somewhere else, only is being deleted!!!!!!!!!!

What I can do!

I always do Build > Compile to rebuild the project, so translations should be updated according if there are changes, but why these are being deleted!

Using Trunk from 2020-11-01
Steps To ReproduceJust rebuild the project, and check translations with a diff viewer
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

lainz

2021-01-08 14:48

reporter  

lainz

2021-01-08 15:07

reporter   ~0128169

Copy of this in the forum
https://forum.lazarus.freepascal.org/index.php?topic=52803.msg390010#msg390010

My first time talking about the bug
https://forum.lazarus.freepascal.org/index.php/topic,45980.0.html

Other user talking about the same bug
https://forum.lazarus.freepascal.org/index.php/topic,51062.msg374328.html#msg374328

Maxim Ganetsky

2021-01-09 00:36

developer   ~0128181

You must ensure the following:

1. "Project Options" -> "i18n" -> "Enable i18n" checkbox is enabled.
2. "Project Options" -> "i18n" -> "Create/update .po file when saving a .lfm file" checkbox is enabled.
3. All your forms/frames are part of your project (in Project Inspector).
4. All forms for which you want LFM strings to be extracted to PO files have "Enable i18n for LFM" option enabled (it is located in a popup menu in Project Inspector which appears when you click with right mouse button on the name of your form there).
5. You have run "Project" -> "Resave forms with enabled i18n" (you must keep generated LRJ files in your source tree).
6. Rebuild your project.

If above steps did not help, you must attach sample project which demonstrates the issue.

lainz

2021-01-09 01:48

reporter   ~0128182

Here the same in another project LazPaint.

LazPaint is free and open source, and I did what you said, enabled i18n, update po when form is saved, the form that is being removed from the po file is added in the project inspector.

I've run project > resave forms...

And rebuilt the project.

I don't have a project that is small enough to attach it here, but you can grab lazpaint: download lazpaint, bgrabitmap, bgracontrols and compile it to see the problem.

The project as I already say is open source and is useful to replicate the problem, that is the main goal.

Maxim Ganetsky

2021-01-09 02:30

developer   ~0128184

All I can say is that e. g. <lazarusdir>/tools/jsonviewer project also uses strings extracted from LFM and I just tested that its PO files are updated correctly.

Again, please make sure, that you correctly followed up the steps which I described. In particular, MAKE SURE, that appropriate LRJ files are present in your source tree (every form which you want to have its strings extracted to PO file, should have corresponding one). These LRJ files are generated when saving the form with enabled i18n. See jsonviewer project for a working example.

As for LazPaint, looking at its LPI file here:
https://github.com/bgrabitmap/lazpaint/blob/master/lazpaint/lazpaint.lpi

1. Its i18n is disabled.
2. I don't see LRJ files in repository.

Taking all above into account, I am afraid, I won't be able to help you further unless you will provide a test project.

lainz

2021-01-09 03:39

reporter   ~0128185

Of course I enabled the option. Is not enabled by default because is destroying our translations.

If you dont believe me please try it yourself with lazpaint is not that hard to setup.

If not thanks anyways I must find another translation tool.

lainz

2021-01-09 04:06

reporter   ~0128186

Ok I will try again tomorrow in a new lazpaint branch to play with translations.

Please be patient and if I find something I will get back here.

lainz

2021-01-09 04:26

reporter   ~0128187

Ok I opened every single form in lazpaint, then moved something like a control or a component, to save the form. Then I commited all the .lrj files, reverted back the forms. Then I rebuilt lazpaint and it's fixed.

Sorry for all the noise and many thanks for helping me.

I will try to document this on the wiki, and I will reply the solution in the respective forum threads.

Maxim Ganetsky

2021-01-10 00:14

developer   ~0128229

Great that I managed to help you!

> Ok I opened every single form in lazpaint, then moved something like a control or a component, to save the form.

Note that this should not be needed. "Project" -> "Resave forms with enabled i18n" should help you with this task (forms should be part of your project).

Also, looking at LazPaint's .gitignore file:
https://github.com/bgrabitmap/lazpaint/blob/d730df1cd9f7dde03de5ed041e05a8ebf3022613/.gitignore

I would recommend also to remove the following entries from there:
*.res (resource files, which I would recommend to store in the source tree)
*.lrt (predecessor of .lrj format, not used/generated by Lazarus IDE anymore)

lainz

2021-01-10 00:43

reporter   ~0128231

Thankyou, I'm not sure why *.res files are not stored, that was discussed in the lazpaint issues at github. I think it has to do something with the debian distribution, since lazpaint is built for debian packages or something like that.

I just helped with translations and other small stuff, so I have no idea.

Issue History

Date Modified Username Field Change
2021-01-08 14:48 lainz New Issue
2021-01-08 14:48 lainz File Added: Captura de pantalla 2021-01-08 104201.png
2021-01-08 15:07 lainz Note Added: 0128169
2021-01-09 00:36 Maxim Ganetsky Assigned To => Maxim Ganetsky
2021-01-09 00:36 Maxim Ganetsky Status new => feedback
2021-01-09 00:36 Maxim Ganetsky LazTarget => -
2021-01-09 00:36 Maxim Ganetsky Note Added: 0128181
2021-01-09 01:48 lainz Note Added: 0128182
2021-01-09 01:48 lainz File Added: Captura de pantalla 2021-01-08 214245.png
2021-01-09 01:48 lainz Status feedback => assigned
2021-01-09 02:30 Maxim Ganetsky Status assigned => feedback
2021-01-09 02:30 Maxim Ganetsky Note Added: 0128184
2021-01-09 03:39 lainz Note Added: 0128185
2021-01-09 03:39 lainz Status feedback => assigned
2021-01-09 04:06 lainz Note Added: 0128186
2021-01-09 04:26 lainz Note Added: 0128187
2021-01-10 00:14 Maxim Ganetsky Status assigned => resolved
2021-01-10 00:14 Maxim Ganetsky Resolution open => no change required
2021-01-10 00:14 Maxim Ganetsky Note Added: 0128229
2021-01-10 00:43 lainz Note Added: 0128231