code: public CmsMessages getMessages(
          String bundleName,
          String language,
          String country,
          String variant,
          String defaultLanguage) {
  
          try {
              if ((defaultLanguage != null) && CmsStringUtil.isEmpty(language)) {
                  language = defaultLanguage;
              }
              if (language == null) {
                  language = "";
              }
              if (country == null) {
                  country = "";
              }
              if (variant == null) {
                  variant = "";
              }
              return getMessages(bundleName, new Locale(language, country, variant));
          } catch (Throwable t) {
              handleException(t);
          }
          return null;
      }
docs: Generates an initialized instance of {@link CmsMessages} for
  convenient access to localized resource bundles.<p>
  
  @param bundleName the name of the ResourceBundle to use
  @param language language identifier for the locale of the bundle
  @param country 2 letter country code for the locale of the bundle
  @param variant a vendor or browser-specific variant code
  @param defaultLanguage default for the language, will be used
  if language is null or empty String "", and defaultLanguage is not null
  @return CmsMessages a message bundle initialized with the provided values
  
  @see java.util.ResourceBundle
  @see org.opencms.i18n.CmsMessages