格式化消息。

@param bundle
资源
@param key
键值
@param arguments
参数
@return 消息字符串
169197
public static String format(final ResourceBundle bundle, final String key, final Object... arguments) {
		String pattern = ResourceBundles.getProperty(bundle, key);
		if (arguments.length == 0) {
			return pattern;
		}
		if (pattern.equals(key)) {
			return formatFallback(pattern, arguments);
		}
		return format(pattern, bundle.getLocale(), arguments);
	}
1140068
@HtmlSafe
    public String getText(String key, Object... arguments) {
        return I18nUtil.getText(key, getResourceBundle(), arguments);
    }
1304748
public static String getText(String key, ResourceBundle bundle, Object... arguments)
	{
		try
		{
			String value = bundle.getString(key);

			return MessageFormat.format(value, arguments);
		}
		catch (MissingResourceException ex)
		{
			return key;
		}
	}
824441
public static String get(Locale locale, String key, Object... args) {
        return get(BUNDLE_NAME, getLocale(locale), key, args);
    }
681919
public static final Object getObject(Locale locale, String key)
   {
      ResourceBundle bundle = ResourceBundle.getBundle(LocaleData.class.getName(), locale);
      return (bundle.getObject(key));
   }
415262
public Bundler putBundle(String key, Bundle value) {
    bundle.putBundle(key, value);
    return this;
  }
969267
public boolean getBoolean( String key )
        throws MissingResourceException
    {
        ResourceBundle bundle = getBundle();
        String value = bundle.getString( key );
        return "true".equalsIgnoreCase( value );
    }
449665
public String get(String key) {
        try { 
            return bundle.getString(key); 
        }catch(MissingResourceException e) { 
            logger.warn("Missing resource.", e);
            return key; 
        }
    }
1099869
public static void containsKey( Map<?, ?> argument,
                                    Object key,
                                    String name ) {
        isNotNull(argument, name);
        if (!argument.containsKey(key)) {
            throw new IllegalArgumentException(CommonI18n.argumentDidNotContainKey.text(name, getObjectName(key)));
        }
    }
22783
protected function getMessage($bundle, $key, $language)
    {
        $keyRecord = $this->getKeyRepository()->findOneBy(array(
                'project'  => $this->project,
                'bundle'   => $bundle,
                'key'      => $key,
            )
        );

        if(!$keyRecord){
            return null;
        }
        /** @var Message $message */
        $message = $this->getMessageRepository()->findOneBy(array(
                'key'      => $keyRecord,
                'language' => $language,
            )
        );
        return $message;
    }
699561
private void appendBundle(JoinableResourceBundle bundle, Map<String, String> variants, StringBuffer buf,
			boolean useGzip) {
		buf.append("r(").append(JavascriptStringUtil.quote(bundle.getId())).append(",");
		String path = bundle.getURLPrefix(variants);
		if (useGzip) {
			if (path.charAt(0) == '/') {
				path = path.substring(1); // remove leading '/'
			}
			buf.append(JavascriptStringUtil.quote(BundleRenderer.GZIP_PATH_PREFIX + path));
		} else {
			if (path.charAt(0) != '/') {
				path = "/" + path; // Add leading '/'
			}
			buf.append(JavascriptStringUtil.quote(path));
		}

		boolean skipItems = false;
		if (bundle.getItemPathList().size() == 1 && null == bundle.getExplorerConditionalExpression()) {
			skipItems = bundle.getItemPathList().get(0).getPath().equals(bundle.getId());
		}

		if (!skipItems) {
			buf.append(",[");
			for (Iterator<BundlePath> it = bundle.getItemPathList(variants).iterator(); it.hasNext();) {
				path = it.next().getPath();
				if (this.config.getGeneratorRegistry().isPathGenerated(path)) {
					path = PathNormalizer.createGenerationPath(path, this.config.getGeneratorRegistry(), null);
				}
				if ("".equals(this.config.getContextPathOverride()) && path.startsWith("/"))
					path = path.substring(1);
				buf.append(JavascriptStringUtil.quote(path));
				if (it.hasNext())
					buf.append(",");
			}
			buf.append("]");

			if (null != bundle.getExplorerConditionalExpression()) {
				buf.append(",'").append(bundle.getExplorerConditionalExpression()).append("'");
			}
		}
		if (null != bundle.getAlternateProductionURL()) {
			// Complete the parameters if needed, since the alternate param goes
			// afterwards
			if (skipItems)
				buf.append(",null,null");
			else if (null == bundle.getExplorerConditionalExpression())
				buf.append(",null");
			buf.append(",").append(JavascriptStringUtil.quote(bundle.getAlternateProductionURL()));

		}
		buf.append(")");

	}
26374
public String getLocalized(String key) {
		if (bundle != null) {
			try {
				return bundle.getString(key);
	//			String localized = bundle.getString(key);
	//			if((localized != null) && (localized.length() > 0)) {
	//				return localized;
	//			}
			} catch (Exception e) {
			}

		}
		return key;
	}
1295408
@Nullable
    public static ArrayList<Integer> optIntegerArrayList(@Nullable Bundle bundle, @Nullable String key) {
        return optIntegerArrayList(bundle, key, new ArrayList<Integer>());
    }
1031964
public static <T> void bindArguments(T target, Bundle bundle) {
        @SuppressWarnings("unchecked")
        BundleBinding<T> binding = (BundleBinding<T>) getBundleBinding(target.getClass().getClassLoader(), target.getClass());
        if (binding != null) {
            binding.bindArguments(target, bundle);
        }
    }
479756
private JSONObject getJSONForBundle(Bundle bundle) throws JSONException {
    JSONObject root = new JSONObject();
    for (String key : bundle.keySet()) {
      root.put(key, getJSONValue(bundle.get(key)));
    }
    return root;
  }
1272944
public static boolean containsKey(final String _key)
    {
        final Cache<String, BundleInterface> cache = InfinispanCache.get()
                        .<String, BundleInterface>getIgnReCache(BundleMaker.CACHE4BUNDLE);
        return cache.containsKey(_key);
    }
1210270
protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
                              TileSetBundle bundle)
    {
        IMImageProvider improv = (_imgr == null) ?
            null : new IMImageProvider(_imgr, bundle);

        // map all of the tilesets in this bundle
        for (IntMap.IntEntry<TileSet> entry : bundle.intEntrySet()) {
            Integer tsid = entry.getKey();
            TileSet tset = entry.getValue();
            tset.setImageProvider(improv);
            idmap.put(tsid.intValue(), tset);
            namemap.put(tset.getName(), tsid);
        }
    }