Page 1 of 1

Translate FMX.consts

Posted: Fri May 07, 2021 6:58 am
by g.buonfini
Hello everyone

I have a question about translating some resourcestring.

- FMX project on Delphi 10.4
- Tsilang 7.8.4

I need to translate the strings in the system menu items (Services, Hide, Hide Others and Quit)

Image

This items are added automatically in Delphi 10.4 applications, so do not need to be added by the developer

The strings are found in the FMX.consts file.

Is it possible to translate them?

Re: Translate FMX.consts

Posted: Fri May 07, 2021 8:14 am
by isiticov
Hello,

I believe these strings (on the screenshot) and commands are added by Mac OS itself and it will be impossible to change them.
But to translate strings declared in FMX.Consts.pas you can try the following trick:
1. Copy FMX.Consts.pas to you project's folder.
2. Modify it by changing resourcestring to var or const and declare them as strings.
3. Add this unit to your project.
4. Translate it with TsiLang Expert as you do for the regular units without form in your project.
5. Try to place FMX.Consts.pas at the top of the uses clause of your project file.
6. Re-build your project.

Hope this helps.

Re: Translate FMX.consts

Posted: Mon May 10, 2021 8:44 am
by g.buonfini
Thank you very much for the quick reply.
i tried to perform the steps you told me but it didn't work properly for me.
do you think there could be another way to modify those resourcestring?

Thanks for the support

Re: Translate FMX.consts

Posted: Mon May 10, 2021 9:50 am
by isiticov
Hello,

What do you mean under "those resourcestrings"? Strings that are listed in system menu: Hide, Hide Others and Quit? If yes, then you can't translate them as I think they are from the OS and Mac OS adds them not RAD Studio.