code: public static LocaleFacet createFor(final String localeString, final Log log) throws MojoExecutionException {
  
          // Check sanity
          Validate.notNull(log, "log");
          Validate.notEmpty(localeString, "localeString");
  
          final StringTokenizer tok = new StringTokenizer(localeString, ",", false);
          final int numTokens = tok.countTokens();
          if (numTokens > 3 || numTokens == 0) {
              throw new MojoExecutionException("A localeString must consist of up to 3 comma-separated parts on the "
                      + "form <language>[,<country>[,<variant>]]. Received incorrect value '" + localeString + "'");
          }
  
          // Extract the locale configuration data.
          final String language = tok.nextToken().trim();
          final String country = numTokens > 1 ? tok.nextToken().trim() : null;
          final String variant = numTokens > 2 ? tok.nextToken().trim() : null;
  
          // All done.
          return new LocaleFacet(log, findOptimumLocale(language, country, variant));
      }
docs: Helper method used to parse a locale configuration string into a Locale instance.
  
  @param localeString A configuration string parameter on the form
  {@code &lt;language&gt;[,&lt;country&gt;[,&lt;variant&gt;]]}
  @param log          The active Maven Log. Cannot be null.
  @return A fully constructed Locale.
  @throws MojoExecutionException if the localeString was not supplied on the required form.