[gatein-commits] gatein SVN: r5979 - in epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui: portal and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Mar 8 08:38:01 EST 2011
Author: mputz
Date: 2011-03-08 08:38:01 -0500 (Tue, 08 Mar 2011)
New Revision: 5979
Modified:
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
JBEPP-813: Translation of navigation elements not working for languages defined with country variant
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2011-03-08 13:36:52 UTC (rev 5978)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2011-03-08 13:38:01 UTC (rev 5979)
@@ -407,8 +407,9 @@
{
if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
return;
+ String localeLanguage = (locale.getCountry().length() > 0) ? locale.getLanguage() + "_" + locale.getCountry() : locale.getLanguage();
ResourceBundle res =
- i18nManager.getNavigationResourceBundle(locale.getLanguage(), nav.getOwnerType(), nav.getOwnerId());
+ i18nManager.getNavigationResourceBundle(localeLanguage, nav.getOwnerType(), nav.getOwnerId());
for (PageNode node : nav.getNodes())
{
resolveLabel(res, node);
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2011-03-08 13:36:52 UTC (rev 5978)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2011-03-08 13:38:01 UTC (rev 5979)
@@ -183,8 +183,9 @@
private void localizeNavigation(Locale locale)
{
+ String localeLanguage = (locale.getCountry().length() > 0) ? locale.getLanguage() + "_" + locale.getCountry() : locale.getLanguage();
LocaleConfig localeConfig =
- getApplicationComponent(LocaleConfigService.class).getLocaleConfig(locale.getLanguage());
+ getApplicationComponent(LocaleConfigService.class).getLocaleConfig(localeLanguage);
String ownerType = edittedNavigation.getOwnerType();
if (!PortalConfig.USER_TYPE.equals(ownerType))
{
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-03-08 13:36:52 UTC (rev 5978)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-03-08 13:38:01 UTC (rev 5979)
@@ -382,7 +382,8 @@
ResourceBundleManager mgr = getApplicationComponent(ResourceBundleManager.class);
if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
return;
- ResourceBundle res = mgr.getNavigationResourceBundle(locale.getLanguage(), nav.getOwnerType(), nav.getOwnerId());
+ String localeLanguage = (locale.getCountry().length() > 0) ? locale.getLanguage() + "_" + locale.getCountry() : locale.getLanguage();
+ ResourceBundle res = mgr.getNavigationResourceBundle(localeLanguage, nav.getOwnerType(), nav.getOwnerId());
for (PageNode node : nav.getNodes())
{
resolveLabel(res, node);
More information about the gatein-commits
mailing list