public function TranslatableTrait::t in Backup and Migrate 8.4
Translate the given string if there is a translator service available.
Parameters
$string:
$replacements:
$context:
Return value
mixed
8 calls to TranslatableTrait::t()
- ConfigurableTrait::configErrors in lib/
backup_migrate_core/ src/ Config/ ConfigurableTrait.php - Get any validation errors in the config.
- DBExcludeFilter::configSchema in lib/
backup_migrate_core/ src/ Filter/ DBExcludeFilter.php - Get a definition for user-configurable settings.
- DirectoryDestination::configSchema in lib/
backup_migrate_core/ src/ Destination/ DirectoryDestination.php - Get a definition for user-configurable settings.
- DrupalEncrypt::configSchema in src/
Filter/ DrupalEncrypt.php - Get a default (blank) schema.
- DrupalUtils::configSchema in src/
Filter/ DrupalUtils.php - Get a default (blank) schema.
File
- lib/
backup_migrate_core/ src/ Translation/ TranslatableTrait.php, line 39
Class
- TranslatableTrait
- This trait can be used to implement the TranslatableInterface.
Namespace
BackupMigrate\Core\TranslationCode
public function t($string, $replacements = [], $context = []) {
// If there is no translation service available use a passthrough to send
// back the original (en-us) string.
if (empty($this->translator)) {
$this->translator = new PassthroughTranslator();
}
return $this->translator
->translate($string, $replacements, $context);
}