@Override
  public final @Nullable Component translate(final @NotNull TranslatableComponent component, final @NotNull Locale locale) {
    final String miniMessageString = this.getMiniMessageString(component.key(), locale);

    if (miniMessageString == null) {
      return null;
    }

    Component resultingComponent;
    Pointered target = new LocalePointered(locale);

    final List<TranslationArgument> translationArguments = component.arguments();

    if (translationArguments.isEmpty()) {
      resultingComponent = this.miniMessage.deserialize(miniMessageString, target);
    } else {
      final TagResolver.Builder tagResolverBuilder = TagResolver.builder();
      final List<Tag> indexedArguments = new ArrayList<>(translationArguments.size());
      boolean targetAlreadyOverridden = false;

      for (final TranslationArgument argument : translationArguments) {
        final Object value = argument.value();

        if (value instanceof VirtualComponent) {
          final VirtualComponentRenderer<?> renderer = ((VirtualComponent) value).renderer();

          if (renderer instanceof MiniMessageTranslatorTarget) {
            if (targetAlreadyOverridden) {
              throw new IllegalArgumentException("Multiple Argument.target() translation arguments have been set!");
            }

            target = ((MiniMessageTranslatorTarget) renderer).pointered();
            targetAlreadyOverridden = true;
            continue;
          } else if (renderer instanceof MiniMessageTranslatorArgument<?>) {
            final MiniMessageTranslatorArgument<?> translatorArgument = (MiniMessageTranslatorArgument<?>) renderer;
            final Object data = translatorArgument.data();

            if (data instanceof TranslationArgumentLike) {
              final Tag tag = Tag.selfClosingInserting((TranslationArgumentLike) data);
              tagResolverBuilder.tag(translatorArgument.name(), tag);
              indexedArguments.add(tag);
              continue;
            } else if (data instanceof Tag) {
              final Tag tag = (Tag) data;
              tagResolverBuilder.tag(translatorArgument.name(), tag);
              indexedArguments.add(tag);
              continue;
            } else if (data instanceof TagResolver) {
              tagResolverBuilder.resolvers((TagResolver) data);
            } else {
              throw new IllegalArgumentException("Unknown translator argument type: " + data.getClass());
            }
          }
        }

        indexedArguments.add(Tag.selfClosingInserting(argument));
      }

      resultingComponent = this.miniMessage.deserialize(miniMessageString, target, new ArgumentTag(indexedArguments, tagResolverBuilder.build()));
    }

    final Style style = component.style();
    if (!style.isEmpty()) {
      resultingComponent = resultingComponent.applyFallbackStyle(style);
    }

    return resultingComponent.append(component.children());
  }
Returns a raw MiniMessage string for the given key.

<p>If no string is found for the given key, returning {@code null} will use the
{@link TranslatableComponent#fallback() translatable component's fallback} (or the
key itself).</p>

@param key the key
@param locale the locale
@return the resulting MiniMessage string
@since 4.20.0
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/translation/MiniMessageTranslator.java