Author: thomas.heute(a)jboss.com
Date: 2010-07-15 14:23:19 -0400 (Thu, 15 Jul 2010)
New Revision: 3632
Added:
portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/
portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png
Modified:
portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-1301: Show "Simplified Chinese" for zh_CN and "Traditional
Chinese" for zh_TW
Added:
portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png
===================================================================
(Binary files differ)
Property changes on:
portal/trunk/docs/reference-guide/en/images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/docs/reference-guide/en/modules/PortalDevelopment/InternationalizationConfiguration.xml 2010-07-15
18:23:19 UTC (rev 3632)
@@ -313,6 +313,32 @@
</section>
</section>
+ <section>
+ <title>Translating the language selection form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/PortalDevelopment/InternationalizationConfiguration/LanguageChoice.png"
format="PNG" align="center" valign="middle"
+ scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ <para>When choosing a language as on the screenshot above, the user is
presented with a list of languages on the left side in the current chosen language
+ and on the right side, the same language translated into its own language.
+ Those texts are obtained from the JDK API
<literal>java.util.Locale.getDisplayedLanguage()</literal> and
<literal>java.util.Locale.getDisplayedCountry()</literal> (if needed) and all
languages may not be translated and can also depend on the JVM currently used.
+ It is still possible to override those values by editing the
<literal>locale.portal.webui</literal> resource bundle, to do so edit the file
<filename>gatein.ear/02portal.war/WEB-INF/classes/locale/portal/webui_xx_yy.properties</filename>
where <literal>xx_yy</literal>
+ represents the country code of the language in which you want to translate a
particular language.
+ In that file, add or modify a key such as
<literal>Locale.xx_yy</literal> with the value being the translated string.
+ </para>
+ <example>
+ <title>Changing the displayed text for Traditional Chinese in
French</title>
+ <para>First edit
<filename>gatein.ear/02portal.war/WEB-INF/classes/locale/portal/webui_fr.properties</filename>
where <literal>ne</literal> is the country code for French, and add
+ the following key into it:
+ <programlisting>
+ Locale.zh_TW=Chinois traditionnel
+ </programlisting>
+ After a restart the language will be updated in the user interface when a user
is trying to change the current language.
+ </para>
+ </example>
+ </section>
</section>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-07-15
18:23:19 UTC (rev 3632)
@@ -1347,4 +1347,8 @@
UIGadget.tooltip.Maximize=Maximieren
UIGadget.tooltip.Unmaximize=Normalgröße
UIGadget.tooltip.editGadget=Gadget bearbeiten
-UIGadget.tooltip.deleteGadget=Gadget löschen
\ No newline at end of file
+UIGadget.tooltip.deleteGadget=Gadget löschen
+
+
+Locale.zh_CN=Vereinfachtes Chinesisch
+Locale.zh_TW=Traditionelles Chinesisch
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-07-15
18:23:19 UTC (rev 3632)
@@ -174,6 +174,7 @@
Asia.label=Asia
Language.left.title=Select a language
+
#############################################################################
# Change Skin #
#############################################################################
@@ -1383,3 +1384,9 @@
UIConfirmation.title.exoMessages=Confirm message
UIConfirmation.Close=Close
+
+
+ ### Locales
+Locale.zh_CN=Simplified Chinese
+Locale.zh_TW=Traditional Chinese
+
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-07-15
18:23:19 UTC (rev 3632)
@@ -1310,3 +1310,7 @@
UIGadget.tooltip.Unmaximize=Restaurar
UIGadget.tooltip.editGadget=Editar Gadget
UIGadget.tooltip.deleteGadget=Borrar Gadget
+
+Locale.zh_CN=Chino simplificado
+Locale.zh_TW=Chino tradicional
+
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-07-15
18:23:19 UTC (rev 3632)
@@ -1285,3 +1285,7 @@
UIGadget.tooltip.deleteGadget=Supprimer la Gadget
UIUserToolBarDashboard.page.ClickAndType=Cliquez pour renommer
+
+Locale.zh_CN=Chinois simplifié
+Locale.zh_TW=Chinois traditionnel
+
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-07-15
18:23:19 UTC (rev 3632)
@@ -1348,3 +1348,6 @@
UIGadget.tooltip.deleteGadget=Elimina Gadget
UIListPermissionSelectorPopup.title.ListPermissionSelector=Seleziona il Permesso
+
+Locale.zh_CN=Cinese semplificato
+Locale.zh_TW=Cinese tradizionale
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-07-15
18:23:19 UTC (rev 3632)
@@ -1356,3 +1356,5 @@
UIGadget.tooltip.editGadget=\u30ac\u30b8\u30a7\u30c3\u30c8\u306e\u7de8\u96c6
UIGadget.tooltip.deleteGadget=\u30ac\u30b8\u30a7\u30c3\u30c8\u306e\u524a\u9664
+Locale.zh_CN=\u7c21\u4f53\u5b57\u4e2d\u56fd\u8a9e
+Locale.zh_TW=\u7e41\u4f53\u5b57\u4e2d\u56fd\u8a9e
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties 2010-07-15
18:23:19 UTC (rev 3632)
@@ -1351,3 +1351,5 @@
UIGadget.tooltip.Unmaximize=\u0930\u093f\u0938\u094d\u091f\u094b\u0930
\u0921\u093e\u0909\u0928
UIGadget.tooltip.editGadget=\u0917\u094d\u092f\u093e\u091c\u0947\u091f
\u092a\u0930\u093f\u092e\u093e\u0930\u094d\u091c\u0928
\u0917\u0930\u094d\u0928\u0941\u0939\u094b\u0938\u094d
UIGadget.tooltip.deleteGadget=\u0917\u094d\u092f\u093e\u091c\u0947\u091f
\u092e\u0947\u091f\u093e\u0909\u0928\u0941\u0939\u094b\u0938\u094d
+
+Locale.ne=\u0928\u0947\u092a\u093e\u0932\u0940
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml 2010-07-15
18:23:19 UTC (rev 3632)
@@ -1891,4 +1891,8 @@
<deleteGadget>删除小工具</deleteGadget>
</tooltip>
</UIGadget>
+ <Locale>
+ <zh_CN>全体字</zh_CN>
+ <zh_TW>全體字</zh_TW>
+ </Locale>
</bundle>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml 2010-07-15
18:23:19 UTC (rev 3632)
@@ -2068,4 +2068,9 @@
<deleteGadget>刪除小工具</deleteGadget>
</tooltip>
</UIGadget>
+
+ <Locale>
+ <zh_CN>繁体字</zh_CN>
+ <zh_TW>繁體字</zh_TW>
+ </Locale>
</bundle>
Modified:
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
===================================================================
---
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java 2010-07-15
18:23:19 UTC (rev 3632)
@@ -20,12 +20,15 @@
package org.exoplatform.webui.organization;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.Constants;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.UserProfile;
import org.exoplatform.services.organization.UserProfileHandler;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.ResourceBundleService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
@@ -42,6 +45,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.ResourceBundle;
/**
* Created by The eXo Platform SARL Author : Dang Van Minh minhdv81(a)yahoo.com
@@ -141,7 +145,6 @@
LocaleConfigService localeService =
getApplicationComponent(LocaleConfigService.class);
Locale currentLocale =
((PortletRequestContext)WebuiRequestContext.getCurrentInstance()).getLocale();
Iterator<LocaleConfig> i = localeService.getLocalConfigs().iterator();
- String displayLanguage = null;
String displayName = null;
String language = null;
String country = null;
@@ -150,19 +153,32 @@
{
LocaleConfig config = i.next();
Locale locale = config.getLocale();
- displayName = locale.getDisplayName(currentLocale);
+ displayName = capitalizeFirstLetter(locale.getDisplayName(currentLocale));
+
language = locale.getLanguage();
country = locale.getCountry();
if (country != null && country.length() > 0)
{
- displayLanguage = displayName + " (" +
locale.getDisplayCountry(currentLocale) + ")";
language = language + "_" + country;
}
- else
+
+
+ ResourceBundle localeResourceBundle;
+ try
{
- displayLanguage = displayName;
+ localeResourceBundle = getResourceBundle(currentLocale);
+ String key = "Locale." + language;
+ if (localeResourceBundle.containsKey(key))
+ {
+ displayName = localeResourceBundle.getString(key);
+ }
}
- option = new SelectItemOption<String>(displayLanguage, language,
displayName);
+ catch (Exception e)
+ {
+ // ignore, use default displayName
+ }
+
+ option = new SelectItemOption<String>(displayName, language);
if (language.equals(selectedLang))
{
option.setSelected(true);
@@ -242,5 +258,28 @@
}
uiApp.addMessage(new
ApplicationMessage("UIUserProfileInputSet.msg.sucsesful.update.userprofile",
args));
}
+
+ private String capitalizeFirstLetter(String word)
+ {
+ if (word == null)
+ {
+ return null;
+ }
+ if (word.length() == 0)
+ {
+ return word;
+ }
+ StringBuilder result = new StringBuilder(word);
+ result.replace(0, 1, result.substring(0, 1).toUpperCase());
+ return result.toString();
+ }
+ private ResourceBundle getResourceBundle(Locale locale) throws Exception
+ {
+ ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
+ ResourceBundleService service =
+
(ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class);
+ ResourceBundle res = service.getResourceBundle("locale.portal.webui",
locale);
+ return res;
+ }
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UILanguageSelector.java 2010-07-15
18:23:19 UTC (rev 3632)
@@ -19,7 +19,12 @@
package org.exoplatform.portal.webui.portal;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.Constants;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
@@ -28,6 +33,9 @@
import org.exoplatform.services.organization.UserProfileHandler;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.ResourceBundleManager;
+import org.exoplatform.services.resources.ResourceBundleService;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIContainer;
@@ -42,6 +50,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
+import java.util.ResourceBundle;
@ComponentConfig(template =
"system:/groovy/portal/webui/portal/UILanguageSelector.gtmpl", events = {
@EventConfig(listeners = UILanguageSelector.SaveActionListener.class),
@@ -63,16 +72,57 @@
{
LocaleConfig localeConfig = (LocaleConfig)object;
Locale locale = localeConfig.getLocale();
- String displayName =
capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale));
String lang = locale.getLanguage();
String country = locale.getCountry();
- String localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale));;
+ ResourceBundle currentLocaleResourceBundle = getResourceBundle(currentLocale);
+ ResourceBundle localeResourceBundle = getResourceBundle(locale);
+
+ String key = "Locale." + lang;
+
+ String displayName = null;
+ if (currentLocaleResourceBundle.containsKey(key))
+ {
+ displayName = currentLocaleResourceBundle.getString(key);
+ }
+ else
+ {
+ displayName =
capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale));
+ }
+
+ String localedName = null;
+ if (localeResourceBundle.containsKey(key))
+ {
+ localedName = localeResourceBundle.getString(key);
+ }
+ else
+ {
+ localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale));
+ }
+
+
if (country != null && country.length() > 0)
{
- displayName = capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale)) +
" - " + capitalizeFirstLetter(locale.getDisplayCountry(currentLocale));
- localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale)) +
" - " + capitalizeFirstLetter(locale.getDisplayCountry(locale));
lang = lang + "_" + country;
+ key = "Locale." + lang;
+
+ if (currentLocaleResourceBundle.containsKey(key))
+ {
+ displayName = currentLocaleResourceBundle.getString(key);
+ }
+ else
+ {
+ displayName =
capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale)) + " - " +
capitalizeFirstLetter(locale.getDisplayCountry(currentLocale));
+ }
+
+ if (localeResourceBundle.containsKey(key))
+ {
+ localedName = localeResourceBundle.getString(key);
+ }
+ else
+ {
+ localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale)) +
" - " + capitalizeFirstLetter(locale.getDisplayCountry(locale));
+ }
}
if (localedName == null || localedName.length() == 0)
@@ -159,4 +209,15 @@
result.replace(0, 1, result.substring(0, 1).toUpperCase());
return result.toString();
}
+
+ private ResourceBundle getResourceBundle(Locale locale) throws Exception
+ {
+ ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
+ ResourceBundleService service =
+
(ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class);
+ ResourceBundle res = service.getResourceBundle("locale.portal.webui",
locale);
+ return res;
+ }
+
+
}
\ No newline at end of file
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-07-15
16:34:46 UTC (rev 3631)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-07-15
18:23:19 UTC (rev 3632)
@@ -19,6 +19,8 @@
package org.exoplatform.portal.webui.portal;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfig;
@@ -37,6 +39,7 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.ResourceBundleService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.InitParams;
@@ -71,6 +74,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.ResourceBundle;
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@@ -187,13 +191,27 @@
Collection<?> listLocaleConfig = localeConfigService.getLocalConfigs();
LocaleConfig defaultLocale = localeConfigService.getDefaultLocaleConfig();
String defaultLanguage = defaultLocale.getLanguage();
- Locale currentLocate = Util.getPortalRequestContext().getLocale();
+ Locale currentLocale = Util.getPortalRequestContext().getLocale();
Iterator<?> iterator = listLocaleConfig.iterator();
while (iterator.hasNext())
{
LocaleConfig localeConfig = (LocaleConfig)iterator.next();
+ String displayName =
capitalizeFirstLetter(localeConfig.getLocale().getDisplayName(currentLocale));
+ ResourceBundle localeResourceBundle = getResourceBundle(currentLocale);
+
+ String key = "Locale." + localeConfig.getLocale().getLanguage();
+ if (localeConfig.getLocale().getCountry() != null)
+ {
+ key += "_" + localeConfig.getLocale().getCountry();
+ }
+
+ if (localeResourceBundle.containsKey(key))
+ {
+ displayName = localeResourceBundle.getString(key);
+ }
+
SelectItemOption<String> option =
- new
SelectItemOption<String>(localeConfig.getLocale().getDisplayName(currentLocate),
localeConfig
+ new SelectItemOption<String>(displayName, localeConfig
.getLanguage());
if (defaultLanguage.equals(localeConfig.getLanguage()))
{
@@ -370,4 +388,27 @@
}
}
+ private String capitalizeFirstLetter(String word)
+ {
+ if (word == null)
+ {
+ return null;
+ }
+ if (word.length() == 0)
+ {
+ return word;
+ }
+ StringBuilder result = new StringBuilder(word);
+ result.replace(0, 1, result.substring(0, 1).toUpperCase());
+ return result.toString();
+ }
+
+ private ResourceBundle getResourceBundle(Locale locale) throws Exception
+ {
+ ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
+ ResourceBundleService service =
+
(ResourceBundleService)appContainer.getComponentInstanceOfType(ResourceBundleService.class);
+ ResourceBundle res = service.getResourceBundle("locale.portal.webui",
locale);
+ return res;
+ }
}