You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by ep...@apache.org on 2004/08/13 14:58:29 UTC

cvs commit: jakarta-turbine-fulcrum/localization/impl/src/java/org/apache/fulcrum/localization Localization.java

epugh       2004/08/13 05:58:29

  Modified:    localization/impl/src/java/org/apache/fulcrum/localization
                        Localization.java
  Log:
  add missing methods
  
  Revision  Changes    Path
  1.2       +56 -31    jakarta-turbine-fulcrum/localization/impl/src/java/org/apache/fulcrum/localization/Localization.java
  
  Index: Localization.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/localization/impl/src/java/org/apache/fulcrum/localization/Localization.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Localization.java	14 Nov 2003 13:46:13 -0000	1.1
  +++ Localization.java	13 Aug 2004 12:58:29 -0000	1.2
  @@ -85,37 +85,37 @@
    */
   public class Localization
   {
  -	
  -	/** Static instance of the LocalizationService.  */
  -	private static LocalizationService localizationService;
  -
  -	/**
  -	 * Return whether the localization service has been initialized
  -	 * or not.
  -	 * @return
  -	 */
  -	public static boolean isInitialized(){
  -		return (!(localizationService==null));
  -	}
  -	/**
  -	 * Utility method for accessing the service
  -	 * implementation
  -	 *
  -	 * @return a LocalizationService implementation instance
  -	 */
  -	private static LocalizationService getService()
  -	{
  -		if(localizationService==null){
  -			throw new RuntimeException("Localization Service has not been started yet.");
  -		}
  -		return localizationService;
  -	}
  -	static void setLocalizationService(LocalizationService service)
  -	{
  -		localizationService = service;
  -	}
   
  -	
  +    /** Static instance of the LocalizationService.  */
  +    private static LocalizationService localizationService;
  +
  +    /**
  +     * Return whether the localization service has been initialized
  +     * or not.
  +     * @return
  +     */
  +    public static boolean isInitialized(){
  +        return (!(localizationService==null));
  +    }
  +    /**
  +     * Utility method for accessing the service
  +     * implementation
  +     *
  +     * @return a LocalizationService implementation instance
  +     */
  +    private static LocalizationService getService()
  +    {
  +        if(localizationService==null){
  +            throw new RuntimeException("Localization Service has not been started yet.");
  +        }
  +        return localizationService;
  +    }
  +    static void setLocalizationService(LocalizationService service)
  +    {
  +        localizationService = service;
  +    }
  +
  +
       /**
        * Fetches the localized text from the specified bundle, ignoring
        * any default bundles.
  @@ -292,5 +292,30 @@
           return getService().getDefaultBundleName();
       }
   
  +   /**
  +     * @see LocalizationService#format(String, Locale, String, Object)
  +     */
  +    public static String format(String bundleName, Locale locale,
  +                                String key, Object arg1)
  +    {
  +        return getService().format(bundleName, locale, key, arg1);
  +    }
  +
  +    /**
  +     * @see LocalizationService#format(String, Locale, String, Object, Object)
  +     */
  +    public static String format(String bundleName, Locale locale,
  +                                String key, Object arg1, Object arg2)
  +    {
  +        return getService().format(bundleName, locale, key, arg1, arg2);
  +    }
   
  +    /**
  +     * @see LocalizationService#format(String, Locale, String, Object[])
  +     */
  +    public static String format(String bundleName, Locale locale,
  +                                String key, Object[] args)
  +    {
  +        return getService().format(bundleName, locale, key, args);
  +    }
    }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org