Hot switching RTL locale

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Hot switching RTL locale

leledumbo
Administrator
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.