public static Language fromLocale(Locale locale) {
        String str = locale.getLanguage();
        if (str.equals("in")) {
            return INDONESIAN; // Locale converts 'id' to 'in'
        }
        if (str.equals("iw")) {
            return HEBREW; // Locale converts 'he' to 'iw'
        }
        if (str.equals("ji")) {
            return YIDDISH; // Locale converts 'yi' to 'ji'
        }
        if (str.equals("no")) {
            return NORWEGIAN_BOKMAL; // alias for 'nb'
        }
        if (str.equals("zh")) {
            if (locale.getCountry().equalsIgnoreCase("cn") ||
                locale.getVariant().equalsIgnoreCase("hans")) {
                return CHINESE_SIMPLIFIED;
            }
            return CHINESE_TRADITIONAL;
        }
        Language ret = index.get(str);
        return ret != null ? ret : UNKNOWN;
    }
<p>Returns the <code>Language</code> whose {@link #languageCode()} is equal to <code>locale.getLanguage()</code>, with
the following additions:</p>
<ul>
<li>Language code "in" translates to {@link #INDONESIAN}</li>
<li>Language code "iw" translates to {@link #HEBREW}</li>
<li>Language code "ji" translates to {@link #YIDDISH}</li>
<li>Language code "no" translates to {@link #NORWEGIAN_BOKMAL}</li>
<li>Language code "zh" translates to {@link #CHINESE_TRADITIONAL}, unless country code is "cn" or variant code
is "hans", in which case it translates to {@link #CHINESE_SIMPLIFIED}.</li>
</ul>

@param locale The locale for which the <code>Language</code> to return.
@return The corresponding <code>Language</code>, or {@link #UNKNOWN} if not known.
linguistics/src/main/java/com/yahoo/language/Language.java