Problem with doubles and times, couse of country specific things

Hi,

I’m from Germany and here are some things different as in the english-speaking-countries.

example:

  • the time 1:10 PM is written in Germany 13:10
  • the Date YYYY-MM-DD is written in Germany DD.MM.YYYY
  • the decimal 1,000.01 (one thousand …) is written in Germany 1.000,01

My problem is:
When I develop my apps on my PC, the localization of the debugging-Server is german.
When I upload the the apps to my server (linux ubuntu) all things are in the english spelling.

So everything I test local, I have to write in german. When I load it to my servers in english. Cause most of my customers are germans, I have to translate every double, time or date back to the german version.

I hope you understand what I mean.

My Question:
Is there a simple way to avoid such behavior? Or to switch the language of my server or the local-server when I’m debugging?

Thanks!

Where is the problem? Even for desktop apps you should develop for all locales.

I develop webapps.
The Problem is: On my Mac they’re in german. On the server they’re in english, but I have to display everything in german. So I have to re-translate everything to english when I want to calculate or save something into the DB. But only on the server, not on the Mac.

The specific problem is, that the Mac calculates everything in german and the server in english. So I have to develop several translators.

You need to differentiate between display and calculation - always.

[quote=161299:@Lars Lehmann]I develop webapps.
The Problem is: On my Mac they’re in german. On the server they’re in english, but I have to display everything in german. So I have to re-translate everything to english when I want to calculate or save something into the DB. But only on the server, not on the Mac.

The specific problem is, that the Mac calculates everything in german and the server in english. So I have to develop several translators.[/quote]

It happens for French sites as well. Since you cannot change the locale for the host, the best approach is to construct your own representation, from the date object properties, and use some replaces in addition to Format to get the proper separator.

I think it is more a Linux/Unix flaw than a Xojo problem. In a multiuser setting, each user should be able to set his own locale. One can hope one of these days the nerds who create those systems will get out of their den, and discover the world extends beyond the US frontiers :wink:

Run your server in a german locale ?
Everything will be in whatever locale the SERVER is running in NOT the locale the user accessing it is in
Strings you can already do dynamically based on the users locale (see http://www.xojo.com/blog/en/2014/03/picking-a-language-at-runtime.php ) which was basically designed JUST for web edition & this use case.
Dates & times & such are sadly not as easy and you would have to format them by hand
Its not hard as you can easily get the separators & do something appropriate based on the users locale
It just sucks you have to do it - but the new framework gives you more flexibility since you can say “format it using the defaults for this locale”

@Norman Palardy So I’ll wait for the new framework :smiley:

@Michel Bujardet :smiley: The in europe much-touted Americanism. We’re not the market, we are the decorative accessories.

You can do some of this already if you are using 2014r3 where the new date classes are available.