Recent

Author Topic: Items in TRadioGroup not translated.  (Read 707 times)

CM630

  • Hero Member
  • *****
  • Posts: 1522
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Items in TRadioGroup not translated.
« on: October 24, 2025, 08:42:35 am »
I created a new project, added a TRadioGroup, and added two .Items in it.
Then in the code, I added LCLTranslator in uses, and I set up the I18n settings in Project options.
When I build the app, the .Items of the TRadioGroup are missing from the autogenerated .POT file. Only the caption of the RadioGroup is present.
Is it a bug, shall I report it?


These are the contents of the autogenerated .POT file:
Code: INI  [Select][+][-]
  1. msgid ""
  2. msgstr "Content-Type: text/plain; charset=UTF-8"
  3.  
  4. #: tform1.caption
  5. msgid "Form1"
  6. msgstr ""
  7.  
  8. #: tform1.radiogroup1.caption
  9. msgid "RadioGroup1"
  10. msgstr ""
  11.  


« Last Edit: October 24, 2025, 01:07:10 pm by CM630 »
Лазар 4,2 32 bit (sometimes 64 bit); FPC3,2,2

Zvoni

  • Hero Member
  • *****
  • Posts: 3135
Re: Items in TRadioGroup not translated.
« Reply #1 on: October 24, 2025, 09:28:12 am »
And did you follow the instructions here?
https://wiki.freepascal.org/Step-by-step_instructions_for_creating_multi-language_applications

Specifically this chapter: https://wiki.freepascal.org/Step-by-step_instructions_for_creating_multi-language_applications#Translating
Did you use POEdit to actually translate your strings?
Into which language?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

CM630

  • Hero Member
  • *****
  • Posts: 1522
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Items in TRadioGroup not translated.
« Reply #2 on: October 24, 2025, 01:06:40 pm »
...
Specifically this chapter: https://wiki.freepascal.org/Step-by-step_instructions_for_creating_multi-language_applications#Translating
Did you use POEdit to actually translate your strings?
Into which language?
This makes me think that you have not understood the issue.
POEdit will do nothing; it is Lazarus / FPC that shall add entries in the .POT file, then POEdit will take the data from the .POT and create the language-specific .POs.
The problem is that the entries are not added in the .POT, as quoted in my first post (I just added a clarification there).
Лазар 4,2 32 bit (sometimes 64 bit); FPC3,2,2

wp

  • Hero Member
  • *****
  • Posts: 13195
Re: Items in TRadioGroup not translated.
« Reply #3 on: October 24, 2025, 03:09:02 pm »
Is it a bug, shall I report it?
I don't think that it should be called a "bug", it just has not be implemented. The LCLTranslator iterates over all controls of a form. Every control has a (at least public) property Caption (even a TEdit which seems to have only a Text property but there is also a Caption with the same content). Therefore it is easy to extract the Captions of all controls and translate them. But there are only a few controls which have a property which descends from TStrings. Maybe it is possible with detailed knowledge of RTTI to find this out and to extract this information for translation, but I think the author of LCLTranslator only took the easy way to skip this case.

So, yes: report it.

CM630

  • Hero Member
  • *****
  • Posts: 1522
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Items in TRadioGroup not translated.
« Reply #4 on: October 24, 2025, 04:31:23 pm »
Here it is https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41865
I did not find a way to attach a sample project in the bugtracker.
Лазар 4,2 32 bit (sometimes 64 bit); FPC3,2,2

wp

  • Hero Member
  • *****
  • Posts: 13195
Re: Items in TRadioGroup not translated.
« Reply #5 on: October 24, 2025, 05:31:41 pm »
I did not find a way to attach a sample project in the bugtracker.
Edit your report and drag the zipped sample project into the report editor of the browser. If this does not work attach the project here and I can add it for you.

 

TinyPortal © 2005-2018