Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-11

Hot switching RTL locale

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

leledumbo

My web application is currently serving two languages, I use a simple TStringList based translation strings to achieve that. However, things are a little harder for locale, especially day and month names. The web application is an embedded server one, so its lifetime is not on a per process basis, meaning I must be able to do hot locale switching as people change the used language (kept in session per visitor).

I notice that clocale can fill DefaultFormatSettings according to server locale for me, but the unit itself doesn't expose any interface, so I guess it's not possible to use it for hot switching (the call to setlocale inside GetFormatSettings has hardcoded parameters).

I have a fallback mechanism to fill (Short|Long)(Month|Day)Names on language change using the same translation mechanism above, but I'm looking for a better way if possible.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Hot-switching-RTL-locale-tp5726762.html Sent from the Free Pascal - General mailing list .

Reply by email