KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portal > impl > ResourceBundleDelegateImpl


1  /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5
6 package org.exoplatform.services.portal.impl;
7
8 import java.util.Locale JavaDoc;
9 import java.util.ResourceBundle JavaDoc;
10
11 import org.exoplatform.services.portletcontainer.bundle.ResourceBundleDelegate;
12 import org.exoplatform.services.resources.ResourceBundleService;
13
14
15 /**
16  * @author Benjamin Mestrallet
17  * benjamin.mestrallet@exoplatform.com
18  */

19 public class ResourceBundleDelegateImpl implements ResourceBundleDelegate {
20   
21   private static final String JavaDoc CUSTOM_PROPERTIES_PATH = "locale.custom.custom";
22   private static final String JavaDoc 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 JavaDoc lookupBundle(String JavaDoc portletBundleName, Locale JavaDoc locale){
31     String JavaDoc[] bundles = { PORTAL_PROPERTIES_PATH, portletBundleName, CUSTOM_PROPERTIES_PATH};
32     return resourceBundleService.getResourceBundle(bundles, locale);
33   }
34
35 }
36
Popular Tags