Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with foreign CultureInfo #9

Open
duchenean opened this issue Oct 27, 2021 · 4 comments
Open

Issues with foreign CultureInfo #9

duchenean opened this issue Oct 27, 2021 · 4 comments

Comments

@duchenean
Copy link

duchenean commented Oct 27, 2021

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
Copy link
Owner

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
Copy link

mardanga commented Nov 8, 2021

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
Copy link
Owner

stackTom commented Sep 5, 2022

Any updates on a pull request with these fixes?

@duchenean
Copy link
Author

duchenean commented Sep 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants