code: protected static MetaLocale parse(String tag) {
      if (tag.indexOf('_') != -1) {
        tag = tag.replace('_', SEP);
      }
      Maybe<Pair<MetaLocale, CharSequence>> result = P_LANGUAGE_TAG.parse(tag);
      // This parser is for internal use only during code generation, so we blow up
      // severely if a language tag fails to parse..
      if (result.isNothing()) {
        throw new IllegalArgumentException("Failed to parse language tag: '" + tag + "'");
      }
      return result.get()._1;
    }
docs: Internal method for parsing well-formed language tags.