My software relies in the windows locale configuration to work properly.
My customers have always the pt-br locale setted up and it works fine that way.
In one user´s windows there is the pt-br locale setted properly but somehow my software gets all the us configurations. (. as decimal sepparator, $ as currency symbol and so on).
Is there any way for me to force the locale globally in my software?
Since you have delphi-7 you can do as follows:
Application.UpdateFormatSettings := false;
This prevents the system to update your application with windows default values.
Then define at application startup:
DecimalSeparator := '.'; // Or whatever preference you have
CurrencyString := '$'; // Or something else
...
etc
In Delphi 2006 and higher this method is deprecated and the use of TFormatSettings is prefered. It also deals with reentrancy problems if parts of the applications needs to change the format settings during execution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With