Multilingual support not working correctly (GET query not correct)

Issue #20 new
Al D
created an issue

The enum net.aksingh.owmjapis.OpenWeatherMap.Language has a language code string, but it's never used in the query building.

new StringBuilder().....append(PARAM_LANG).append(this.lang).append("&").....toString();

this should be

new StringBuilder().....append(PARAM_LANG).append(this.lang**.getLang()**).append("&").....toString();

Language.getLang() should return the language code:

public static enum Language {
        ENGLISH("en"),
        RUSSIAN("ru"),
        ITALIAN("it"),
        SPANISH("es"),
        UKRAINIAN("uk"),
        GERMAN("de"),
        PORTUGUESE("pt"),
        ROMANIAN("ro"),
        POLISH("pl"),
        FINNISH("fi"),
        DUTCH("nl"),
        FRENCH("FR"),
        BULGARIAN("bg"),
        SWEDISH("sv"),
        CHINESE_TRADITIONAL("zh_tw"),
        CHINESE_SIMPLIFIED("zh"),
        TURKISH("tr"),
        CROATIAN("hr"),
        CATALAN("ca");

        private final String lang;

        Language(String lang) {
            this.lang = lang;
        }

        public String getLang() {
            return lang;
        }
    }

This fixes the issue and returns the correct descriptions in the appropriate language.

Comments (1)

  1. Ashutosh Kumar Singh repo owner

    Hi, thanks for reaching out to me. And apologies for the late response. I wasn't able to work on this lib for long time, but finally I have decided to work on it and make it the full-featured lib. for OpenWeatherMap.org

    I have shifted the repo. to http://go.aksingh.net/owm-japis. Kindly check it there.

    In the new version, latest supported languages are also added, and this works too. Thank you.

  2. Log in to comment