Hi, all. At the end of the file is a diff that adds support to
TurbineLocalizationService for the java.util.Locale constructor that accepts
a vendor-specific variant. Can someone with proper access please commit
this to CVS?
(If anyone's curious: we're planning to use this tag as an easy/lazy way to
implement customizable skins in a forthcoming application.)
--
Christopher Elkins
--
Index: TurbineLocalizationService.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/services/localization/TurbineLocalizationService.java,v
retrieving revision 1.2
diff -c -r1.2 TurbineLocalizationService.java
*** TurbineLocalizationService.java 2000/01/25 19:47:19 1.2
--- TurbineLocalizationService.java 2000/03/08 00:09:45
***************
*** 85,91 ****
{
/** the one and only instance of our ResourceBundle */
private static ResourceBundle bundle = null;
! /** contains the language and country specified in TurbineResources.properties */
private static Locale userLocale = null;
/** CONSTRUCTOR */
--- 85,91 ----
{
/** the one and only instance of our ResourceBundle */
private static ResourceBundle bundle = null;
! /** contains the language, country, and optional variant specified in
TurbineResources.properties */
private static Locale userLocale = null;
/** CONSTRUCTOR */
***************
*** 109,121 ****
Log.note("Language: " + lang );
String country = props.getProperty("country", "");
Log.note("Country: " + country );
String bundleStr = props.getProperty("bundle", null);
Log.note("Bundle Class: " + bundleStr );
if ( bundleStr == null )
throw new Exception ("Can't get the bundle property");
! userLocale = new Locale(lang,country);
Log.note ("Locale: " + userLocale.toString() );
bundle = ResourceBundle.getBundle(bundleStr, userLocale);
--- 109,126 ----
Log.note("Language: " + lang );
String country = props.getProperty("country", "");
Log.note("Country: " + country );
+ String variant = props.getProperty("variant", "");
+ Log.note("Variant: " + variant );
String bundleStr = props.getProperty("bundle", null);
Log.note("Bundle Class: " + bundleStr );
if ( bundleStr == null )
throw new Exception ("Can't get the bundle property");
! if ( variant.length() > 0)
! userLocale = new Locale(lang,country,variant);
! else
! userLocale = new Locale(lang,country);
Log.note ("Locale: " + userLocale.toString() );
bundle = ResourceBundle.getBundle(bundleStr, userLocale);
***************
*** 133,138 ****
--- 138,144 ----
Locale selected in TurbineResource.properties
(services.TurbineLocalizationService.language,
services.TurbineLocalizationService.country,
+ services.TurbineLocalizationService.variant,
services.TurbineLocalizationService.bundle)
*/
public ResourceBundle getBundle()
***************
*** 175,178 ****
}
return defaultValue;
}
! }
\ No newline at end of file
--- 181,184 ----
}
return defaultValue;
}
! }
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]