Recent

Author Topic: "i18n Options > Create/update.po file..." doesn't work properly  (Read 3267 times)

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1216
    • Burdjia
I've found an annoying behavior on the i18n on Lazarus 2.0.10:  It removes all resourcestrings from one and only one of the frames of my application.  Any other resourcestring is correctly saved.  If I edit the .po file externally and add the removed resourcestrings then the frame is properly translated.

Frame has only two controls:  TDividerBevel and TComboBoxEx.

Is it a bug, an issue or did I miss something?
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #1 on: August 17, 2020, 01:43:05 pm »
I lost all my English translations with an old project in trunk so maybe is a similar issue. Seems fixed btw in latest trunk. Same was happening with Lazpaint the deletion of parts of the translations. The solution is the same thing you did.

I did not report it because I can't reproduce it in a new project. But I have discussed it here in the forum.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1216
    • Burdjia
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #2 on: August 17, 2020, 06:09:00 pm »
So it is a bug.  Nice to know that trunk fixes it but annoying to wait.  I don't wan't to install an older Lazarus version. :(
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #3 on: January 08, 2021, 03:06:25 pm »
Still not working in trunk, today loosing my translations

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #4 on: January 08, 2021, 10:22:20 pm »
Has someone logged the bug in the BugTracker? If not, it's unlikely it will ever be fixed.

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #5 on: January 08, 2021, 10:46:27 pm »
Has someone logged the bug in the BugTracker? If not, it's unlikely it will ever be fixed.

Yes I reported it here
https://bugs.freepascal.org/view.php?id=38331

dbannon

  • Hero Member
  • *****
  • Posts: 3566
    • tomboy-ng, a rewrite of the classic Tomboy
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #6 on: January 08, 2021, 11:48:21 pm »
This is a bit scary, I can imagine having translations 'lost' and I would not notice because I rarely look at the translated app and even if I did, I might think the translation is the same as the English word. End users would just assume that the translation to their language is incomplete. Only the translators themselves would pick it up. Is there anything we can do to help isolate this problem ?

Should we check the number of lines in each .po file after a build ?

In Iainz's example, the problem is "Printer", could it be that only words that exist in LCL's .po file  are being dropped ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #7 on: January 08, 2021, 11:52:23 pm »
I'm not sure, a thing in common in the projects that this happen is that they have a lot of forms (LazPaint and the project I work on).

Strange that this doesn't happen in Lazarus project itself...

Another thing is that these projects has translations since a lot of time ago, maybe some breaking change?

dbannon

  • Hero Member
  • *****
  • Posts: 3566
    • tomboy-ng, a rewrite of the classic Tomboy
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #8 on: January 09, 2021, 03:23:55 am »
My project has just over 400 translation strings, maybe 12 to 15 forms.  I don't know if you consider that a lot.

But its relatively new, did not use translations until (I think) 2.0.x of Lazarus so, no 'old' data in there.

I do not know if I have ever lost a translation, thats the issue really IMHO, it can easily slip past my normal release tests. Maybe I'll go back over recent git commits and see if diff flags things being removed that I don't remember removing. If its happening then my data may increase our info base !

Davo



Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #9 on: January 09, 2021, 03:35:32 am »
Thanks. Even if in your program there is no lost translation is good to know that doesn't happen in new projects.  :)

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #10 on: January 09, 2021, 04:29:03 am »
Ok, in the bugtracker Maxim Ganetsky helped me to find the bug.

The problem was that in the projects the .lrj files was in the gitignore, and these .lrj files are needed to create the translations, so these files must be shipped with the sourcecode as well.

So the solution is to open every single form in the project, move something a button or a component, then save the form. Then a .lrj file is created.

Then rebuild the program and the .po file is correctly generated!

 :)

As I promised in the bug report, I've added some small explanation of .lrj files in the translations wiki
https://wiki.freepascal.org/Translations_/_i18n_/_localizations_for_programs#Translating_Forms
« Last Edit: January 09, 2021, 04:34:27 am by lainz »

dbannon

  • Hero Member
  • *****
  • Posts: 3566
    • tomboy-ng, a rewrite of the classic Tomboy
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #11 on: January 09, 2021, 12:06:13 pm »
Well, thats interesting.  I suspect I have not been effected because I always generate my .pot and .po files on the same machine and it did have its full complement of .lrj files.

I have made a note on the https://wiki.freepascal.org/File_extensions wiki page too.  Nice catch folks !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1216
    • Burdjia
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #12 on: February 08, 2021, 02:39:18 pm »
Ok, in the bugtracker Maxim Ganetsky helped me to find the bug.
(...)
That's weird. I don't use GIT so I shouldn't be afected by gitignore stuff.  Also I remove the temporary files (.o, .ppu, .lrj...) and it still not generate the .po correctly (should made more tests moving the components though).

Anyway, thanks for the tips.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: "i18n Options > Create/update.po file..." doesn't work properly
« Reply #13 on: February 08, 2021, 05:00:01 pm »
Ok, in the bugtracker Maxim Ganetsky helped me to find the bug.
(...)
That's weird. I don't use GIT so I shouldn't be afected by gitignore stuff.  Also I remove the temporary files (.o, .ppu, .lrj...) and it still not generate the .po correctly (should made more tests moving the components though).

Anyway, thanks for the tips.

You must not delete .lrj files, that's the problem.

 

TinyPortal © 2005-2018