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:
Jan Vonka
2008-01-22 12:49:50 +00:00
parent 375305b7d6
commit 92919aa931
4 changed files with 50 additions and 29 deletions

View File

@@ -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;
}
}