mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD (5.1) to 5.1.N (5.1.1)
112630 gjames: Removed the use of Locale.setDefault(locale) ACE-4246 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@112681 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -108,17 +108,14 @@ public abstract class ParameterizedItemAbstractBase extends CommonResourceAbstra
|
|||||||
addParameterDefinitions(paramList);
|
addParameterDefinitions(paramList);
|
||||||
Map<Locale, List<ParameterDefinition>> result = new HashMap<Locale, List<ParameterDefinition>>();
|
Map<Locale, List<ParameterDefinition>> result = new HashMap<Locale, List<ParameterDefinition>>();
|
||||||
result.put(Locale.ROOT, paramList);
|
result.put(Locale.ROOT, paramList);
|
||||||
Locale currentLocale = Locale.getDefault();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (Locale locale : locales)
|
for (Locale locale : locales)
|
||||||
{
|
{
|
||||||
Locale.setDefault(locale);
|
|
||||||
List<ParameterDefinition> definitions = new LinkedList<ParameterDefinition>();
|
List<ParameterDefinition> definitions = new LinkedList<ParameterDefinition>();
|
||||||
result.put(locale, definitions);
|
result.put(locale, definitions);
|
||||||
for (ParameterDefinition definition : paramList)
|
for (ParameterDefinition definition : paramList)
|
||||||
{
|
{
|
||||||
String paramDisplayLabel = getParamDisplayLabel(definition.getName());
|
String paramDisplayLabel = getParamDisplayLabel(definition.getName(), locale);
|
||||||
definitions.add(
|
definitions.add(
|
||||||
new ParameterDefinitionImpl(
|
new ParameterDefinitionImpl(
|
||||||
definition.getName(),
|
definition.getName(),
|
||||||
@@ -129,11 +126,6 @@ public abstract class ParameterizedItemAbstractBase extends CommonResourceAbstra
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Locale.setDefault(currentLocale);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,6 +191,17 @@ public abstract class ParameterizedItemAbstractBase extends CommonResourceAbstra
|
|||||||
return I18NUtil.getMessage(this.name + "." + paramName + "." + DISPLAY_LABEL);
|
return I18NUtil.getMessage(this.name + "." + paramName + "." + DISPLAY_LABEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the parameter definition display label from the properties file.
|
||||||
|
*
|
||||||
|
* @param paramName the name of the parameter
|
||||||
|
* @param locale the name of the locale
|
||||||
|
* @return the display label of the parameter
|
||||||
|
*/
|
||||||
|
protected String getParamDisplayLabel(String paramName, Locale locale)
|
||||||
|
{
|
||||||
|
return I18NUtil.getMessage(this.name + "." + paramName + "." + DISPLAY_LABEL, locale);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Checked whether all the mandatory parameters for the rule item have been assigned.
|
* Checked whether all the mandatory parameters for the rule item have been assigned.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user