mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Dynamic Models - minor, validate message resource bundle exists in repo
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8055 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -925,4 +925,28 @@ public class MessageServiceImpl implements MessageService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getBaseBundleName(String resourceName)
|
||||
{
|
||||
// convert resource file name to a resource bundle basename
|
||||
// e.g. either 'workflow_fr_FR.properties' or 'workflow.properties' should be converted to 'workflow'
|
||||
// note: this assumes that the baseName itself does not contain underscore !
|
||||
|
||||
String bundleBaseName = resourceName;
|
||||
int idx = resourceName.indexOf("_");
|
||||
if (idx > 0)
|
||||
{
|
||||
bundleBaseName = resourceName.substring(0, idx - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int idx1 = resourceName.indexOf(".");
|
||||
if (idx1 > 0)
|
||||
{
|
||||
bundleBaseName = resourceName.substring(0, idx1);
|
||||
}
|
||||
}
|
||||
|
||||
return bundleBaseName;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user