1 5 6 package org.exoplatform.services.portal.impl; 7 8 import java.util.Locale ; 9 import java.util.ResourceBundle ; 10 11 import org.exoplatform.services.portletcontainer.bundle.ResourceBundleDelegate; 12 import org.exoplatform.services.resources.ResourceBundleService; 13 14 15 19 public class ResourceBundleDelegateImpl implements ResourceBundleDelegate { 20 21 private static final String CUSTOM_PROPERTIES_PATH = "locale.custom.custom"; 22 private static final String PORTAL_PROPERTIES_PATH = "locale.portal.portal"; 23 24 private ResourceBundleService resourceBundleService; 25 26 public ResourceBundleDelegateImpl(ResourceBundleService resourceBundleService) { 27 this.resourceBundleService = resourceBundleService; 28 } 29 30 public ResourceBundle lookupBundle(String portletBundleName, Locale locale){ 31 String [] bundles = { PORTAL_PROPERTIES_PATH, portletBundleName, CUSTOM_PROPERTIES_PATH}; 32 return resourceBundleService.getResourceBundle(bundles, locale); 33 } 34 35 } 36 | Popular Tags |