Good morning Dear Sirs. On some occasions, the Windows regional configuration is shared with other applications, which have a different regional configuration and are sometimes affected. Is it possible for my app in powerbuilder 2022 to set my own locale by code or in my app? Thank you
William
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Set regional settings for my app
- JOSE WILLIAM ROMERO OLIVOS
- PowerBuilder
- Tuesday, 4 July 2023 22:37 PM UTC
- Wednesday, 5 July 2023 07:00 AM UTC
- PowerBuilder
- # 1
Hi.
In the past, there was a client who needed our application to run with some regional settings altered. For example: they wanted to use as decimal separator "." instead of "," which is the default in Greek regional settings. But they wanted this change to happen only in our application.
Before mentioning how we achieved that, I will mention that most applications read those settings when they are initially loaded. As a result if those settings change while a powerbuilder application is running, from what we experienced, powerbuilder application ins't aware of those changes.
As a result, we built a small exe which did customized regional settings (altering registry) and right away called (using run command) our main application. Our main application was reverting those changes back to original settings (altering again registry), but as it was already launched it wasn't affected by that change.
I don't know what regional settings you need to modify for your application. Depending on what you need to do, what we did may or may not work for you.
Andreas.
- Wednesday, 5 July 2023 13:24 PM UTC
- PowerBuilder
- # 2
Thanks for the reply.
The changes I want to make are in number format, currency format, and date format.
But I would like to be able to tell my app what the format is and not take the Windows one. That saves me windows configuration issues and avoids problems with other desktop applications that need different regional configuration.
Is there a way to do it without modifying the registry?
- John Fauss
- Wednesday, 5 July 2023 18:09 PM UTC
-
Helpful Loading... Helpful 0
- Roland Smith
- Wednesday, 5 July 2023 18:29 PM UTC
-
Helpful Loading... Helpful 0
- Chris Pollach @Appeon
- Wednesday, 5 July 2023 19:44 PM UTC
FYI: That is what I do in my STD framework ... the App is always assuming English but when run in other languages that it supports, the framework uses the objects of that language that have are tailored descendants that implement the language variations (ie: Display Format, Edit Format, Tool-tips, etc). ;-)
Regards ... Chris
-
Helpful Loading... Helpful 0
- Thursday, 6 July 2023 08:18 AM UTC
- PowerBuilder
- # 3
Here is the screenshot where we used to get the format(s)
One can choose the format for required fields in this screen. These values are stored in database, which will be retrieved on application start up and applied wherever required. We have an event for that in ancestor window. In that event, in child window, we code like this
dw_list.Modify('insertdate.editmask.mask = "' + ls_datetime_editmask + '"')
dw_list.Modify('insertdate.editmask.useformat = "yes"' )
dw_list.Modify('insertdate.format = "' + ls_datetime_format + '"')
dw_entry.Modify('openingdebit.format = "' + ls_decimal_format_screen + '"')
dw_entry.Modify('openingcredit.format = "' + ls_decimal_format_screen + '"')
Here we never touch the registry or windows settings.
HTH
Happiness Always
BKR Sivaprakash
- Page :
- 1
However, you are not allowed to reply to this question.
We used to have our own date (display & edit) format, amount (decimal) display format, which will work only in our application. We didn't change the windows Regional settings for this instead set the required format for all fields that needs this.