code: private NameAndLocale getNameAndLocale(CmsResource bundleRes) {
  
          String fileName = bundleRes.getName();
          if (TYPE_PROPERTIES_BUNDLE.equals(OpenCms.getResourceManager().getResourceType(bundleRes).getTypeName())) {
              String localeSuffix = CmsStringUtil.getLocaleSuffixForName(fileName);
              if (localeSuffix == null) {
                  return new NameAndLocale(fileName, null);
              } else {
                  String base = fileName.substring(
                      0,
                      fileName.lastIndexOf(localeSuffix) - (1 /* cut off trailing underscore, too*/));
                  Locale locale = CmsLocaleManager.getLocale(localeSuffix);
                  return new NameAndLocale(base, locale);
              }
          } else {
              return new NameAndLocale(fileName, null);
          }
      }
docs: Extracts the locale and base name from a resource's file name.<p>
  
  @param bundleRes the resource for which to get the base name and locale
  @return a bean containing the base name and locale