View Issue Details

IDProjectCategoryView StatusLast Update
0038640LazarusOtherpublic2021-03-30 00:30
ReporterMiloŇ° Assigned ToMaxim Ganetsky  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformwinOSWindows 
Product Version2.0.10 
Fixed in Version2.0.13 (SVN) 
Summary0038640: Resave forms with enabled i18n doesn't work for all forms
DescriptionDescription is in forum.

https://forum.lazarus.freepascal.org/index.php/topic,53764.msg398180.html#msg398180
Steps To ReproduceRemove LRJ files and use menu item Project / Resave forms with enables i18n
TagsNo tags attached.
Fixed in Revision64891
LazTarget-
Widgetset
Attached Files

Activities

Maxim Ganetsky

2021-03-22 14:18

developer   ~0129830

Last edited: 2021-03-22 14:19

View 2 revisions

Please attach small test project (sources only) where the issue can be reproduced.

Also 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).

Maxim Ganetsky

2021-03-25 00:57

developer   ~0129868

Confirmed. Happens only in Lazarus 2.0.x, trunk Lazarus (2.1) works correctly.

Attached patch seems to fix this bug, but maybe more general solution will be needed.

Maxim Ganetsky

2021-03-25 00:57

developer   ~0129869

bug38640-resave-forms-fix.patch (670 bytes)   
Index: ide/main.pp
===================================================================
--- ide/main.pp	(revision 64867)
+++ ide/main.pp	(working copy)
@@ -4074,7 +4074,7 @@
       LFMFileName:=AnUnitInfo.UnitResourceFileformat.GetUnitResourceFilename(AnUnitInfo.Filename,true);
       if FileExistsCached(LFMFileName) and (not AnUnitInfo.DisableI18NForLFM) then
       begin
-        OpenStatus:=LazarusIDE.DoOpenEditorFile(AnUnitInfo.Filename,-1,-1,[ofAddToRecent]);
+        OpenStatus:=LazarusIDE.DoOpenEditorFile(AnUnitInfo.Filename,-1,-1,[ofAddToRecent, ofDoLoadResource]);
         if OpenStatus=mrOk then
         begin
           AnUnitInfo.Modified:=true;

Maxim Ganetsky

2021-03-30 00:30

developer   ~0129982

Actually it happened in trunk too (installed Docked Form Editor "masked" this problem). Fixed and merged to fixes_2_0.

Please test and close if OK.

Issue History

Date Modified Username Field Change
2021-03-19 17:25 MiloŇ° New Issue
2021-03-22 14:18 Maxim Ganetsky Assigned To => Maxim Ganetsky
2021-03-22 14:18 Maxim Ganetsky Status new => feedback
2021-03-22 14:18 Maxim Ganetsky LazTarget => -
2021-03-22 14:18 Maxim Ganetsky Note Added: 0129830
2021-03-22 14:19 Maxim Ganetsky Note Edited: 0129830 View Revisions
2021-03-25 00:57 Maxim Ganetsky Status feedback => confirmed
2021-03-25 00:57 Maxim Ganetsky Note Added: 0129868
2021-03-25 00:57 Maxim Ganetsky Note Added: 0129869
2021-03-25 00:57 Maxim Ganetsky File Added: bug38640-resave-forms-fix.patch
2021-03-30 00:30 Maxim Ganetsky Status confirmed => resolved
2021-03-30 00:30 Maxim Ganetsky Resolution open => fixed
2021-03-30 00:30 Maxim Ganetsky Fixed in Version => 2.0.13 (SVN)
2021-03-30 00:30 Maxim Ganetsky Fixed in Revision => 64891
2021-03-30 00:30 Maxim Ganetsky Widgetset Win32/Win64 =>
2021-03-30 00:30 Maxim Ganetsky Note Added: 0129982