Examples of ResourceBundle


Examples of java.util.ResourceBundle

  return rb;
    }

    private void initializeData(Locale desiredLocale) {
        int i;
        ResourceBundle resource = cacheLookup(desiredLocale);

        // FIXME: cache only ResourceBundle. Hence every time, will do
        // getObject(). This won't be necessary if the Resource itself
        // is cached.
        eras = (String[])resource.getObject("Eras");
        months = resource.getStringArray("MonthNames");
        shortMonths = resource.getStringArray("MonthAbbreviations");
        String[] lWeekdays = resource.getStringArray("DayNames");
        weekdays = new String[8];
        weekdays[0] = ""// 1-based
        for (i=0; i<lWeekdays.length; i++)
            weekdays[i+1] = lWeekdays[i];
        String[] sWeekdays = resource.getStringArray("DayAbbreviations");
        shortWeekdays = new String[8];
        shortWeekdays[0] = ""// 1-based
        for (i=0; i<sWeekdays.length; i++)
            shortWeekdays[i+1] = sWeekdays[i];
        ampms = resource.getStringArray("AmPmMarkers");
        localPatternChars = resource.getString("DateTimePatternChars");

  locale = desiredLocale;
    }
View Full Code Here

Examples of java.util.ResourceBundle

     * Finds the available plugins and uses the PluginLoader to load them Once a
     * plugin is loaded, it's init() method is called so it can execute initial
     * code and register for various events in JBother
     */
    public static void loadPlugins() {
        ResourceBundle resources = ResourceBundle.getBundle("JBotherBundle",
                Locale.getDefault());
       
        loader
                .findPlugins(JBother.settingsDir + File.separatorChar
                + "plugins");
        loader.loadPlugins();
       
        ArrayList invalids = loader.getInvalidPlugins();
        for (int i = 0; i < invalids.size(); i++) {
            String name = (String) invalids.get(i);
            Standard.warningMessage(null, resources.getString("pluginError"),
                    MessageFormat.format(resources
                    .getString("pluginErrorMessage"),
                    new Object[] { name }));
        }
    }
View Full Code Here

Examples of java.util.ResourceBundle

            if (providersInstance != null) {
                return providersInstance;
            }
        }

        ResourceBundle bundle = getBundle(
                        "sun.text.resources.BreakIteratorInfo", locale);
        String[] classNames = bundle.getStringArray("BreakIteratorClasses");
       
        String dataFile = bundle.getString(dataName);

        try {
            if (classNames[type].equals("RuleBasedBreakIterator")) {
                return new RuleBasedBreakIterator(dataFile);
            }
            else if (classNames[type].equals("DictionaryBasedBreakIterator")) {
                String dictionaryFile = bundle.getString(dictionaryName);
                return new DictionaryBasedBreakIterator(dataFile, dictionaryFile);
            }
            else {
                throw new IllegalArgumentException("Invalid break iterator class \"" +
                                classNames[type] + "\"");
View Full Code Here

Examples of java.util.ResourceBundle

        /* try the cache first */
  String key = getKey();
        String[] dateTimePatterns = cachedLocaleData.get(key);
        if (dateTimePatterns == null) { /* cache miss */
            ResourceBundle r = LocaleData.getDateFormatData(loc);
      if (!isGregorianCalendar()) {
    try {
        dateTimePatterns = r.getStringArray(getCalendarName() + ".DateTimePatterns");
    } catch (MissingResourceException e) {
    }
      }
      if (dateTimePatterns == null) {
    dateTimePatterns = r.getStringArray("DateTimePatterns");
      }
            /* update cache */
            cachedLocaleData.put(key, dateTimePatterns);
        }
  formatData = DateFormatSymbols.getInstance(loc);
View Full Code Here

Examples of net.rim.device.api.i18n.ResourceBundle

   
    enterEventDispatcher();
  }
 
  public static String getString(int resourceKey) {
    ResourceBundle resBundle = ResourceBundle.getBundle(OmniLinkClientResource.BUNDLE_NAME);
    return resBundle.getString(resourceKey);   
  }
View Full Code Here

Examples of org.apache.myfaces.config.element.ResourceBundle

        return ClassUtils.getContextClassLoader();
    }

    String getBundleName(final FacesContext facesContext, final String name)
    {
        ResourceBundle bundle = getRuntimeConfig(facesContext).getResourceBundle(name);
        return bundle != null ? bundle.getBaseName() : null;
    }
View Full Code Here

Examples of org.apache.myfaces.config.impl.digester.elements.ResourceBundle

        return ClassUtils.getContextClassLoader();
    }

    String getBundleName(final FacesContext facesContext, final String name)
    {
        ResourceBundle bundle = getRuntimeConfig(facesContext).getResourceBundle(name);
        return bundle != null ? bundle.getBaseName() : null;
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.cdi.core.api.resource.bundle.ResourceBundle

public class ResourceBundleTest
{
    @Test
    public void testNonTypesafeBundleKey() throws Exception
    {
        ResourceBundle resourceBundle = getTestResourceBundle();
        Assert.assertEquals(resourceBundle.useBundle(getClass().getPackage().getName() + ".testbundle").getValue("value1"), "1");
    }
View Full Code Here

Examples of org.conventionsframework.util.ResourceBundle

    if (bundleMap.containsKey(currentLanguage)) {
      currentBundle = bundleMap.get(currentLanguage);

    } else {
      try {
        currentBundle = new ResourceBundle(baseName,locale);
        bundleMap.put(currentLanguage, currentBundle);
        log.fine("Conventions: loaded resource bundle:" + baseName
            + "_" + currentLanguage + ".properties");
      } catch (Exception e) {
        log.log(Level.SEVERE,
View Full Code Here

Examples of org.damour.base.client.localization.ResourceBundle

  public static boolean isInitialized() {
    return initialized;
  }

  public void loadSettings(final IGenericCallback<Void> callback) {
    settings = new ResourceBundle();
    settings.loadBundle("settings/", "settings", false, new IResourceBundleLoadCallback() {
      public void bundleLoaded(String bundleName) {
        final ResourceBundle settings_override = new ResourceBundle();
        settings_override.loadBundle("settings/", "settings_override", false, new IResourceBundleLoadCallback() {
          public void bundleLoaded(String bundleName) {
            settings.mergeResourceBundle(settings_override);
            String serviceEntryPoint = settings.getString("BaseService", BASE_SERVICE_PATH);
            if (!StringUtils.isEmpty(serviceEntryPoint)) {
              ((ServiceDefTarget) BaseServiceCache.getServiceUnsafe()).setServiceEntryPoint(serviceEntryPoint);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.