Multilingual Content Fixes

- Fixed parsing of locale string to use I18NUtil.parseLocale and not Locale constructor
 - Fixed type conversion of properties returned from MLPropertyInterceptor's directNodeService
 - Fixed handling of ALL_LANGUAGES filter selection
 - Fixed MultilingualContentService NPE when checking for duplicate locales


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5007 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-02-02 00:09:20 +00:00
parent 74a20a88f3
commit bbba9d10cd
2 changed files with 9 additions and 5 deletions

View File

@@ -18,7 +18,6 @@ package org.alfresco.web.app.servlet;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Locale;
import javax.portlet.PortletSession;
import javax.servlet.ServletContext;
@@ -229,8 +228,13 @@ public final class AuthenticationHelper
String contentFilterLanguageStr = loginBean.getUserPreferencesBean().getContentFilterLanguage();
if (contentFilterLanguageStr != null)
{
//set the cocale for the method interceptor for MLText properties
I18NUtil.setContentLocale(new Locale(contentFilterLanguageStr));
// Set the locale for the method interceptor for MLText properties
I18NUtil.setContentLocale(I18NUtil.parseLocale(contentFilterLanguageStr));
}
else
{
// Nothing has been selected, so remove the content filter
I18NUtil.setContentLocale(null);
}
}

View File

@@ -99,7 +99,7 @@ public class UserPreferencesBean
}
/**
* @return current content filter language
* @return current content filter language, or <tt>null</tt> if all languages was selected
*/
public String getContentFilterLanguage()
{
@@ -116,7 +116,7 @@ public class UserPreferencesBean
this.contentFilterLanguage = locale.toString();
}
}
return contentFilterLanguage;
return (contentFilterLanguage.equals(MSG_CONTENTALLLANGUAGES)) ? null : contentFilterLanguage;
}
/**