1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.jetspeed.services.customlocalization;
17
18 import org.apache.turbine.services.TurbineServices;
19 import java.util.Locale;
20 import java.util.ResourceBundle;
21 import org.apache.turbine.util.RunData;
22
23 /***
24 * Custom Localization allows for the localization properties to changed dynamically,
25 * without shutting down the application server.
26 *
27 * @author <a href="mailto:massimiliano.dessi@gruppoatlantis.it">Dessė Massimiliano</a>
28 * @version $Id: CustomLocalization.java,v 1.4 2004/02/23 03:49:33 jford Exp $
29 */
30 public abstract class CustomLocalization
31 {
32
33 public CustomLocalization(){}
34
35 public static String getString(String bundleName, Locale locale, String key)
36 {
37 return getService().getString(bundleName, locale, key);
38 }
39
40 public static String getString(String key, RunData data)
41 {
42 return getService().getString(null, getLocale(data), key);
43 }
44
45 public static ResourceBundle getBundle( RunData data )
46 {
47 return getService().getBundle(data);
48 }
49
50 public static Locale getLocale(RunData data)
51 {
52 return getService().getLocale(data);
53 }
54
55 public static String getDefaultBundleName()
56 {
57 return getService().getDefaultBundleName();
58 }
59
60 protected static final CustomLocalizationService getService()
61 {
62 return (CustomLocalizationService) TurbineServices.getInstance().getService(CustomLocalizationService.SERVICE_NAME);
63 }
64 }