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

gmap.net set map name language invalid? #192

Open
guhuan769 opened this issue Jul 16, 2023 · 3 comments
Open

gmap.net set map name language invalid? #192

guhuan769 opened this issue Jul 16, 2023 · 3 comments

Comments

@guhuan769
Copy link

I set the attribute language to Chinese in the mapprovider and it doesn't take effect? Is there any solution?

@guhuan769 guhuan769 changed the title setting language ? gmap.net set map name language invalid? Jul 16, 2023
@JManikiza
Copy link

Did you have any success with finding a solution? I'm in the same problem

@JManikiza
Copy link

I was able to do it like this, you may have solved it already but for anyone else:

        var currentCulture = System.Globalization.CultureInfo.CurrentCulture;
        LanguageType languageType;

        switch (currentCulture.TwoLetterISOLanguageName.ToLower())
        {
            case "en":
                languageType = LanguageType.Japanese;
                break;
            case "es":
                languageType = LanguageType.Spanish;
                break;
            case "it":
                languageType = LanguageType.Italian;
                break;
            case "fr":
                languageType = LanguageType.French;
                break;
            case "zh":
                languageType = LanguageType.ChineseSimplified;
                break;
            case "ja":
                languageType = LanguageType.Japanese;
                break;
            case "vi":
                languageType = LanguageType.Vietnamese;
                break;
            case "ar":
                languageType = LanguageType.Arabic;
                break;
            default:
                languageType = LanguageType.English; // Default to English if the language is not recognized
                break;
        }

        GMapProvider.Language = languageType;

And you have to set the language before most other map settings otherwise it won't work, even with a ReloadMap()

@guhuan769
Copy link
Author

I was able to do it like this, you may have solved it already but for anyone else:

        var currentCulture = System.Globalization.CultureInfo.CurrentCulture;
        LanguageType languageType;

        switch (currentCulture.TwoLetterISOLanguageName.ToLower())
        {
            case "en":
                languageType = LanguageType.Japanese;
                break;
            case "es":
                languageType = LanguageType.Spanish;
                break;
            case "it":
                languageType = LanguageType.Italian;
                break;
            case "fr":
                languageType = LanguageType.French;
                break;
            case "zh":
                languageType = LanguageType.ChineseSimplified;
                break;
            case "ja":
                languageType = LanguageType.Japanese;
                break;
            case "vi":
                languageType = LanguageType.Vietnamese;
                break;
            case "ar":
                languageType = LanguageType.Arabic;
                break;
            default:
                languageType = LanguageType.English; // Default to English if the language is not recognized
                break;
        }

        GMapProvider.Language = languageType;

And you have to set the language before most other map settings otherwise it won't work, even with a ReloadMap()

Thank you

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

2 participants