Lines Matching refs:Locale

111  * {@link #getBundle(java.lang.String, java.util.Locale) getBundle}
194 * {@link #getBundle(String, Locale, ClassLoader, Control) getBundle}
205 * descriptions of the {@linkplain #getBundle(String, Locale, ClassLoader,
208 * Control#getTimeToLive(String, Locale)
210 * Control#needsReload(String, Locale, String, ClassLoader, ResourceBundle,
311 private Locale locale = null;
411 public Locale getLocale() {
490 private Locale locale;
514 CacheKey(String baseName, Locale locale, ClassLoader loader) {
537 Locale getLocale() {
541 CacheKey setLocale(Locale locale) {
704 * <code>getBundle(baseName, Locale.getDefault(), this.getClass().getClassLoader())</code>,
708 * See {@link #getBundle(String, Locale, ClassLoader) getBundle}
721 return getBundleImpl(baseName, Locale.getDefault(),
732 * getBundle(baseName, Locale.getDefault(),
737 * #getBundle(String, Locale, ClassLoader, Control) getBundle} for the
764 return getBundleImpl(baseName, Locale.getDefault(),
778 * See {@link #getBundle(String, Locale, ClassLoader) getBundle}
793 Locale locale)
811 * #getBundle(String, Locale, ClassLoader, Control) getBundle} for the
824 * <code>Locale</code> in <code>locales</code>
839 public static final ResourceBundle getBundle(String baseName, Locale targetLocale,
852 * {@link #getBundle(String, Locale, ClassLoader, Control)} passing a
856 * the default locale (obtained from {@link java.util.Locale#getDefault()
857 * Locale.getDefault}) to generate a sequence of <a
905 * <blockquote><b>Note:</b> For some <code>Locale</code>s, the list of
908 * of {@link Control#getCandidateLocales(String, Locale)
995 * <code>Locale("en", "GB")</code>.
1001 * <tr><td>Locale("fr", "CH")</td><td>MyResources_fr_CH.class, parent MyResources_fr.properties, parent MyResources.class</td></tr>
1002 * <tr><td>Locale("fr", "FR")</td><td>MyResources_fr.properties, parent MyResources.class</td></tr>
1003 * <tr><td>Locale("de", "DE")</td><td>MyResources_en.properties, parent MyResources.class</td></tr>
1004 * <tr><td>Locale("en", "US")</td><td>MyResources_en.properties, parent MyResources.class</td></tr>
1005 * <tr><td>Locale("es", "ES")</td><td>MyResources_es_ES.class, parent MyResources.class</td></tr>
1022 public static ResourceBundle getBundle(String baseName, Locale locale,
1034 * #getBundle(String, Locale, ClassLoader) <code>getBundle</code>
1061 * Locale) control.getCandidateLocales} method is called with the target
1062 * locale to get a list of <em>candidate <code>Locale</code>s</em> for
1065 * <li>The {@link ResourceBundle.Control#newBundle(String, Locale,
1073 * are <code>Locale("de", "DE")</code>, <code>Locale("de")</code> and
1074 * <code>Locale("")</code> and the formats are <code>"java.class"</code>
1084 * style="vertical-align: top; text-align: left; font-weight: bold; width: 50%;">Locale<br>
1091 * <td style="vertical-align: top; width: 50%;">Locale("de", "DE")<br>
1097 * <td style="vertical-align: top; width: 50%;">Locale("de", "DE")</td>
1102 * <td style="vertical-align: top; width: 50%;">Locale("de")</td>
1106 * <td style="vertical-align: top; width: 50%;">Locale("de")</td>
1110 * <td style="vertical-align: top; width: 50%;">Locale("")<br>
1115 * <td style="vertical-align: top; width: 50%;">Locale("")</td>
1124 * for <code>Locale("")</code>), and the candidate locale list only contained
1125 * <code>Locale("")</code>, return the bundle to the caller. If a bundle
1127 * contained locales other than Locale(""), put the bundle on hold and
1132 * Locale) control.getFallbackLocale} method is called to get a fallback
1150 * Control#newBundle(String, Locale, String, ClassLoader, boolean)
1153 * calls the {@link ResourceBundle.Control#needsReload(String, Locale,
1165 * {@link Control#getTimeToLive(String,Locale)
1174 * <li>Requested <code>Locale</code>: {@link Locale#ITALY}</li>
1175 * <li>Default <code>Locale</code>: {@link Locale#FRENCH}</li>
1196 * Control#getFallbackLocale(String, Locale)
1197 * control.getFallbackLocale("foo.bar.Messages", Locale.ITALY)} which
1198 * returns <code>Locale.FRENCH</code>. Next, <code>getBundle</code>
1241 public static ResourceBundle getBundle(String baseName, Locale targetLocale,
1249 private static ResourceBundle getBundleImpl(String baseName, Locale locale,
1288 for (Locale targetLocale = locale;
1291 List<Locale> candidateLocales = control.getCandidateLocales(baseName, targetLocale);
1304 boolean isBaseBundle = Locale.ROOT.equals(bundle.locale);
1346 List<Locale> candidateLocales,
1351 Locale targetLocale = candidateLocales.get(index);
1356 } else if (baseBundle != null && Locale.ROOT.equals(targetLocale)) {
1429 Locale targetLocale = cacheKey.getLocale();
1492 Locale locale,
1677 * @see ResourceBundle.Control#getTimeToLive(String,Locale)
1691 * @see ResourceBundle.Control#getTimeToLive(String,Locale)
1806 * Locale, ClassLoader, Control) ResourceBundle.getBundle} factory
1815 * #toBundleName(String, Locale) toBundleName} and {@link
1831 * ResourceBundle.Control#getCandidateLocales(String, Locale)
1864 * ResourceBundle.getBundle("MyResources", new Locale("fr", "CH"),
1892 * Locale locale,
1987 * @see #getTimeToLive(String, Locale)
1995 * @see #getTimeToLive(String, Locale)
2048 * Control#getFallbackLocale(String, Locale) getFallbackLocale}
2060 * <code>Locale</code> support
2121 * Returns a <code>List</code> of <code>Locale</code>s as candidate
2125 * resource bundle for a target <code>Locale</code>.
2132 * must be a {@linkplain Locale#ROOT root locale} if it is desired to
2135 * <p>If the given locale is equal to <code>Locale.ROOT</code> (the
2137 * <code>Locale</code> must be returned. In this case, the
2147 * <code>Locale</code>s using the rules described below. In the
2151 * <code>Locale</code> that has non-empty values only for language and
2153 * language value is "xx". For all cases, <code>Locale</code>s whose
2156 * <ol><li>For an input <code>Locale</code> with an empty script value,
2157 * append candidate <code>Locale</code>s by omitting the final component
2164 * <li> <code>Locale.ROOT</code>
2167 * <li>For an input <code>Locale</code> with a non-empty script value,
2168 * append candidate <code>Locale</code>s by omitting the final component
2170 * <code>Locale</code> with country and variant restored:
2179 * <li> <code>Locale.ROOT</code>
2182 * <li>For an input <code>Locale</code> with a variant value consisting
2184 * <code>Locale</code>s by omitting the variant subtags one by one, then
2185 * insert them after every occurence of <code> Locale</code>s with the
2198 * <li> <code>Locale.ROOT</code>
2201 * <li>Special cases for Chinese. When an input <code>Locale</code> has the
2207 * is empty, no script is supplied. For example, for <code>Locale("zh", "CN")
2214 * <li> <code>Locale.ROOT</code>
2217 * For <code>Locale("zh", "TW")</code>, the candidate list will be:
2223 * <li> <code>Locale.ROOT</code>
2226 * <li>Special cases for Norwegian. Both <code>Locale("no", "NO",
2227 * "NY")</code> and <code>Locale("nn", "NO")</code> represent Norwegian
2235 * <li> <code>Locale.ROOT</code>
2238 * If the locale is exactly <code>Locale("no", "NO", "NY")</code>, it is first
2239 * converted to <code>Locale("nn", "NO")</code> and then the above procedure is
2243 * Bokm&#xE5;l "nb". Except for the single case <code>Locale("no",
2244 * "NO", "NY")</code> (handled above), when an input <code>Locale</code>
2245 * has language "no" or "nb", candidate <code>Locale</code>s with
2248 * <code>Locale("nb", "NO", "POSIX")</code> generates the following
2258 * <li> <code>Locale.ROOT</code>
2261 * <code>Locale("no", "NO", "POSIX")</code> would generate the same list
2275 * <code>Locale("ja",&nbsp;"",&nbsp;"XX")</code>, then a
2276 * <code>List</code> of <code>Locale</code>s:
2278 * Locale("ja", "", "XX")
2279 * Locale("ja")
2280 * Locale.ROOT
2283 * "" <code>Locale</code>s are found, then the runtime resource
2295 * <code>Locale</code>s for the given <code>locale</code>
2300 public List<Locale> getCandidateLocales(String baseName, Locale locale) {
2309 private static class CandidateListCache extends LocaleObjectCache<BaseLocale, List<Locale>> {
2310 protected List<Locale> createObject(BaseLocale base) {
2328 List<Locale> tmpList = getDefaultList("nb", script, region, variant);
2330 List<Locale> bokmalList = new LinkedList<>();
2331 for (Locale l : tmpList) {
2336 bokmalList.add(Locale.getInstance("no", l.getScript(), l.getCountry(),
2342 List<Locale> nynorskList = getDefaultList("nn", script, region, variant);
2344 nynorskList.add(idx++, Locale.getInstance("no", "NO", "NY"));
2345 nynorskList.add(idx++, Locale.getInstance("no", "NO", ""));
2346 nynorskList.add(idx++, Locale.getInstance("no", "", ""));
2373 private static List<Locale> getDefaultList(String language, String script, String region, String variant) {
2385 List<Locale> list = new LinkedList<>();
2389 list.add(Locale.getInstance(language, script, region, v, null));
2393 list.add(Locale.getInstance(language, script, region, "", null));
2396 list.add(Locale.getInstance(language, script, "", "", null));
2402 list.add(Locale.getInstance(language, "", region, v, null));
2406 list.add(Locale.getInstance(language, "", region, "", null));
2410 list.add(Locale.getInstance(language, "", "", "", null));
2413 list.add(Locale.ROOT);
2420 * Returns a <code>Locale</code> to be used as a fallback locale for
2433 * Locale#getDefault() default <code>Locale</code>} if the given
2444 * the <code>Locale</code> for which
2448 * @return a <code>Locale</code> for the fallback search,
2455 public Locale getFallbackLocale(String baseName, Locale locale) {
2459 Locale defaultLocale = Locale.getDefault();
2483 * #toBundleName(String, Locale) toBundleName(baseName,
2537 * {@link #toBundleName(String, Locale) toBundleName}
2559 public ResourceBundle newBundle(String baseName, Locale locale, String format,
2639 * #needsReload(String, Locale, String, ClassLoader, ResourceBundle,
2668 public long getTimeToLive(String baseName, Locale locale) {
2723 public boolean needsReload(String baseName, Locale locale,
2767 * implementation of the {@link #newBundle(String, Locale, String,
2769 * Locale, String, ClassLoader, ResourceBundle, long) needsReload}
2786 * <code>Locale("ja",&nbsp;"",&nbsp;"XX")</code>, then
2788 * locale is <code>Locale("en")</code>, then
2806 public String toBundleName(String baseName, Locale locale) {
2807 if (locale == Locale.ROOT) {
2905 public Locale getFallbackLocale(String baseName, Locale locale) {