stackTom / FSEarthTiles

14 stars 2 forks source link

Issues with foreign CultureInfo #9

Open duchenean opened 2 years ago

duchenean commented 2 years ago

Hello,

First, thanks for this usefull software !

I've had some issues to run it, though. There are some bugs when this is running on a plateform that use another CultureInfo (== "locale"). For example, my Windows is in french (CultureInfo('fr-FR')) and strings are thus not properly handled.

In french, we use this format "123,45" for a decimal number (and not "123.45"). I assume this is probably the case for other languages as well.

I will provide a pull request later this week when I figure where to force the CultureInfo to "en-US" or if I find another cleaner way.

In the meantime, I managed to compile it and run it successfully by placing Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); at different places in the codebase but it's not very clean.

stackTom commented 2 years ago

I don't believe hb-100, the original author, took this into account, and I've likewise not taken this into account either. A PR would be great :).

mardanga commented 2 years ago

Hi, i have problems when run fsearthmask, because i have the spanish (Argentina) cultureInfo. The problem is the unit of measure in windows, if i change to US works perfectly. I forced in the code with this line in main class of fsearthmask and works.


static class FSEarthMasksAppl
    {
       [STAThread]
        static void Main(String[] iApplicationStartArguments)
        {
            // force us culture
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); 

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FSEarthMasksForm(iApplicationStartArguments));
        }
    }
stackTom commented 2 years ago

Any updates on a pull request with these fixes?

duchenean commented 2 years ago

Hi, I haven't had time to do a proper pull request. In the meantime I've switched to MSFS and changed computer so don't count on me to do a PR regarding this issue.

Sorry

Edit: Looks like FSET now support MSFS, great ! I might give this a shot again... But I'm not by any means proficient in C# so it might take me a while