code: public static final boolean isValid(final String value) {
          if (value == null) {
              return true;
          }
          final Locale locale;
          final int p = value.indexOf("__");
          if (p > -1) {
              locale = new Locale(value.substring(0, p), null, value.substring(p + 2));
          } else {
              final StringTokenizer tok = new StringTokenizer(value, "_");
              if (tok.countTokens() == 1) {
                  locale = new Locale(value);
              } else if (tok.countTokens() == 2) {
                  locale = new Locale(tok.nextToken(), tok.nextToken());
              } else if (tok.countTokens() == 3) {
                  locale = new Locale(tok.nextToken(), tok.nextToken(), tok.nextToken());
              } else {
                  return false;
              }
          }
          return LocaleConverter.validLocale(locale);
      }
docs: Check that a given string is a valid {@link java.util.Locale}.
  
  @param value
  Value to check.
  
  @return Returns <code>true</code> if it's a valid Localed else <code>false</code> is returned.