Changeset 15475 in josm for trunk/src


Ignore:
Timestamp:
2019-10-26T00:20:52+02:00 (4 years ago)
Author:
Don-vip
Message:

fix #18260 - restore correct entries in language drop down menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r15395 r15475  
    22package org.openstreetmap.josm.tools;
    33
    4 import java.util.Collection;
    54import java.util.LinkedList;
     5import java.util.List;
    66import java.util.Locale;
    77
     
    179179     */
    180180    public static String getDisplayName(Locale locale) {
     181        String currentCountry = Locale.getDefault().getCountry();
     182        String localeCountry = locale.getCountry();
     183        // Don't display locale country if country has been forced to current country at JOSM startup
     184        if (currentCountry.equals(localeCountry) && !I18n.hasCode(getLanguageCodes(locale).get(0))) {
     185            return new Locale(locale.getLanguage(), "", locale.getVariant()).getDisplayName();
     186        }
    181187        return locale.getDisplayName();
    182188    }
     
    263269     * @since 8283
    264270     */
    265     public static Collection<String> getLanguageCodes(Locale l) {
    266         Collection<String> list = new LinkedList<>();
     271    public static List<String> getLanguageCodes(Locale l) {
     272        List<String> list = new LinkedList<>();
    267273        if (l == null)
    268274            l = Locale.getDefault();
Note: See TracChangeset for help on using the changeset viewer.