1 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 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 } 65 | Popular Tags |