Author: mputz
Date: 2011-03-08 08:36:52 -0500 (Tue, 08 Mar 2011)
New Revision: 5978
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
GTNPORTAL-1828: Translation of navigation elements not working for languages defined with
country variant
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2011-03-08
10:02:01 UTC (rev 5977)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/PageNavigationUtils.java 2011-03-08
13:36:52 UTC (rev 5978)
@@ -413,8 +413,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.toString(), nav.getOwnerType(),
nav.getOwnerId());
+ i18nManager.getNavigationResourceBundle(localeLanguage, nav.getOwnerType(),
nav.getOwnerId());
for (PageNode node : nav.getNodes())
{
resolveLabel(res, node);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2011-03-08
10:02:01 UTC (rev 5977)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2011-03-08
13:36:52 UTC (rev 5978)
@@ -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:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-03-08
10:02:01 UTC (rev 5977)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-03-08
13:36:52 UTC (rev 5978)
@@ -383,7 +383,8 @@
ResourceBundleManager mgr = getApplicationComponent(ResourceBundleManager.class);
if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
return;
- ResourceBundle res = mgr.getNavigationResourceBundle(locale.toString(),
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);
Show replies by date