Jump to content
Der schöne Günther

Get FormatSettings for a specific language

Recommended Posts

I would like to get the format settings for a language, EN-GB for example. I know this is as easy as 

myFormatSettings := TFormatSettings.Create('EN-GB')

My problem: Assuming

  1. The current user session is already using this very EN-GB locale
  2. And has adjusted the local format settings (for example, by using Windows settings)

myFormatSettings will contain the users custom values, not the "original" ones for EN-GB

 

Example:

Assert( TFormatSettings.Create('EN-GB').ShortDateFormat = 'dd/MM/yyyy' )

will fail if I have set the computers local format settings for something else.

 

I have tried TFormatSettings.Create(..) where it takes an LCID instead of a string, but all

GetUserDefaultLCID()GetSystemDefaultLCID() or MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK) return the same LCID number and therefore make no difference when trying to extract the short date format from Windows.

 

Is there any way I could still get the "true" short date format that has not been customized?

Share this post


Link to post
Quote

Side note: having a choice, I'd stay away from such a software unless there would be REALLY strong benefits in using it. Then I'd use it but curse its developer regularily

Edited by Fr0sT.Brutal

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×