public static String createResourceName(String resource,Locale locale,boolean removeExtension){
  String resourceName=resource;
  if (removeExtension) {
    if (resourceName.endsWith(".xml")) {
      resourceName=resourceName.replace(".xml","");
    }
 else     if (resourceName.endsWith(".properties")) {
      resourceName=resourceName.replace(".properties","");
    }
  }
  if (locale != null) {
    if (UtilValidate.isNotEmpty(locale.toString())) {
      resourceName=resourceName + "_" + locale;
    }
  }
  return resourceName;
}

public static String createResourceName ( String resource , Locale locale , boolean removeExtension ) { String resourceName = resource ; if ( removeExtension ) { if ( resourceName . endsWith ( ".xml" ) ) { resourceName = resourceName . replace ( ".xml" , "" ) ; } else if ( resourceName . endsWith ( ".properties" ) ) { resourceName = resourceName . replace ( ".properties" , "" ) ; } } if ( locale != null ) { if ( UtilValidate . isNotEmpty ( locale . toString ( ) ) ) { resourceName = resourceName + "_" + locale ; } } return resourceName ; }
create a localized resource name based on a resource name and a locale .
