Author Topic: Translations deleting themselves after recompiling  (Read 105 times)


  • Newbie
  • Posts: 1
Translations deleting themselves after recompiling
« on: July 16, 2020, 09:33:32 am »
I'm working on a fairly big project, with translations in several different languages. We recently upgraded Lazarus from 1.8.4 to 2.0.8, and that seems to have created issues with translations that weren't present before.

This is what I get every time I recompile my code, whether I choose to force recompile the .po files or not:

Code: Bash  [Select][+][-]
  1. $ git diff
  2. Changes not staged for commit:
  3.   (use "git add <file>..." to update what will be committed)
  4.   (use "git restore <file>..." to discard changes in working directory)
  5.         modified:   languages/
  6.         modified:   languages/waptconsole.en.po
  7.         modified:   languages/
  8.         modified:   languages/
  9.         modified:   languages/waptconsole.po
  11. $ git diff --compact-summary
  12.  languages/ | 8531 ++++++++++++++--------------------------
  13.  languages/waptconsole.en.po | 7392 +++++++++++------------------------
  14.  languages/ | 9065 +++++++++++++++----------------------------
  15.  languages/ | 7432 +++++++++++------------------------
  16.  languages/waptconsole.po    | 7388 +++++++++++------------------------
  17.  5 files changed, 12856 insertions(+), 26952 deletions(-)

It's a bit hard to show specifics, since as you can see, there's a large number of translated strings, for a large number of project files.

If I edit every .lfm file, by opening them and modifying something arbitrarily, therefore forcing them to be interpreted when I compile next, then the language files are NOT modified at all, the expected behavior.

We've modified every .lfm file like I said, and it does fix the problem... to an extent. It seems to be a fragile fix as we've had this issue appear again later unexpectedly. I can't tell you specifics, but it seemed to happen after merging our work, so it's possible it was an oversight on our part. I'll try to reproduce these strange cases again if the information I've provided here isn't enough.

My guess is that Lazarus assumes it can delete "clutter" from my translations, presumably assuming what it's deleting is obsolete since the .lfm files were written while using a previous version of Lazarus, and the IDE hasn't felt the need to interpret them again. I have no idea if this is a bug that needs to be fixed, or if this is intended and I'm doing something wrong. Considering I couldn't find much information about it or anyone having the same issue, I'm leaning towards the latter.

Thanks in advance, and good day to you all.


TinyPortal © 2005-2018