function TranslatableStringFactory::createTranslatableMessage

File

core/modules/package_manager/src/TranslatableStringFactory.php, line 38

Class

TranslatableStringFactory
Creates translatable strings that can interoperate with Composer Stager.

Namespace

Drupal\package_manager

Code

public function createTranslatableMessage(string $message, ?TranslationParametersInterface $parameters = NULL, ?string $domain = NULL) : TranslatableInterface {
    return new TranslatableStringAdapter($message, $parameters?->getAll() ?? [], [
        'context' => $domain ?? '',
    ], $this->translation);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.