Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

TranslatableInterface.php

Same filename in this branch
  1. 11.1.x vendor/symfony/translation-contracts/TranslatableInterface.php
  2. 11.1.x core/lib/Drupal/Core/TypedData/TranslatableInterface.php
  3. 11.1.x core/lib/Drupal/Core/Entity/TranslatableInterface.php

Namespace

PhpTuf\ComposerStager\API\Translation\Value

File

vendor/php-tuf/composer-stager/src/API/Translation/Value/TranslatableInterface.php

View source
<?php

declare (strict_types=1);
namespace PhpTuf\ComposerStager\API\Translation\Value;

use PhpTuf\ComposerStager\API\Translation\Service\TranslatorInterface;
use Stringable;

/**
 * Handles a translatable message.
 *
 * This interface is modeled after the Symfony Translation component. However,
 * there is no guarantee of functional equivalence. Do not depend on undocumented
 * behavior.
 *
 * The behavior when cast to string is technically unspecified--it's left to
 * implementations--and should not be depended upon, as a rule. The default is
 * to perform placeholder substitution without attempting actual translation.
 *
 * @see \PhpTuf\ComposerStager\API\Translation\Service\TranslatorInterface
 *
 * @package Translation
 *
 * @api This interface is subject to our backward compatibility promise and may be safely depended upon.
 */
interface TranslatableInterface extends Stringable {
    
    /** Translates the message. */
    public function trans(?TranslatorInterface $translator = null, ?string $locale = null) : string;

}

Interfaces

Title Deprecated Summary
TranslatableInterface Handles a translatable message.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal