Code example for Locale

Methods: toString

0
        throw new AssertionError();
    } 
 
    private static LocaleData initLocaleData(Locale locale) {
        LocaleData localeData = new LocaleData();
        if (!ICU.initLocaleDataImpl(locale.toString(), localeData)) {
            throw new AssertionError("couldn't initialize LocaleData for locale " + locale);
        } 
        if (localeData.fullTimeFormat != null) {
            // There are some full time format patterns in ICU that use the pattern character 'v'. 
            // Java doesn't accept this, so we replace it with 'z' which has about the same result 
            // as 'v', the timezone name. 
            // 'v' -> "PT", 'z' -> "PST", v is the generic timezone and z the standard tz 
            // "vvvv" -> "Pacific Time", "zzzz" -> "Pacific Standard Time" 
            localeData.fullTimeFormat = localeData.fullTimeFormat.replace('v', 'z');
        } 
        if (localeData.numberPattern != null) {
            // The number pattern might contain positive and negative subpatterns. Arabic, for 
            // example, might look like "#,##0.###;#,##0.###-" because the minus sign should be 
            // written last. Macedonian supposedly looks something like "#,##0.###;(#,##0.###)". 
            // (The negative subpattern is optional, though, and not present in most locales.)