lvgl / lv_i18n

Internationalization (i18n) for LVGL
MIT License
63 stars 17 forks source link

string representation of locales #39

Closed incity closed 3 years ago

incity commented 3 years ago

i think it's more common to use underline for locales as like en_US, zh_CN. image

and also in the java:


    /**
     * Returns a string representation of this <code>Locale</code>
     * object, consisting of language, country, variant, script,
     * and extensions as below:
     * <p><blockquote>
     * language + "_" + country + "_" + (variant + "_#" | "#") + script + "-" + extensions
     * </blockquote>
     *
     * Language is always lower case, country is always upper case, script is always title
     * case, and extensions are always lower case.  Extensions and private use subtags
     * will be in canonical order as explained in {@link #toLanguageTag}.
     *
     * <p>When the locale has neither script nor extensions, the result is the same as in
     * Java 6 and prior.
     *
     * <p>If both the language and country fields are missing, this function will return
     * the empty string, even if the variant, script, or extensions field is present (you
     * can't have a locale with just a variant, the variant must accompany a well-formed
     * language or country code).
     *
     * <p>If script or extensions are present and variant is missing, no underscore is
     * added before the "#".
     *
     * <p>This behavior is designed to support debugging and to be compatible with
     * previous uses of <code>toString</code> that expected language, country, and variant
     * fields only.  To represent a Locale as a String for interchange purposes, use
     * {@link #toLanguageTag}.
     *
     * <p>Examples: <ul><tt>
     * <li>en
     * <li>de_DE
     * <li>_GB
     * <li>en_US_WIN
     * <li>de__POSIX
     * <li>zh_CN_#Hans
     * <li>zh_TW_#Hant-x-java
     * <li>th_TH_TH_#u-nu-thai</tt></ul>
     *
     * @return A string representation of the Locale, for debugging.
     * @see #getDisplayName
     * @see #toLanguageTag
     */
puzrin commented 3 years ago

Both should be supported. Please, provide concrete details what is wrong.