question: 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 ; }
target:  Create a localized resource name based on a resource name and a locale.