public function addSubresource($subresource, string $locale): void
    {
        if ($subresource instanceof Resource) {
            $resource = $subresource;
        } elseif (is_string($subresource)) {
            $resource = ResourceBuilder::fromFile($subresource, $locale);
        } elseif (is_array($subresource)) {
            $resource = ResourceBuilder::fromArray($subresource, $locale);
        } else {
            throw new \InvalidArgumentException('Invalid subresource');
        }

        if (isset($this->data[$locale])) {
            $this->data[$locale]->merge($resource);
        } else {
            $this->data[$locale] = $resource;
        }
    }