PassthroughTranslator.php in Backup and Migrate 8.4
File
lib/backup_migrate_core/src/Translation/PassthroughTranslator.php
View source
<?php
namespace BackupMigrate\Core\Translation;
use BackupMigrate\Core\Translation\TranslatorInterface;
class PassthroughTranslator implements TranslatorInterface {
public function translate($string, $replacements = [], $context = []) {
foreach ($replacements as $key => $value) {
switch (substr($key, 0, 1)) {
case '@':
case '%':
$replacements[$key] = strip_tags($value);
break;
}
}
return strtr($string, $replacements);
}
}
Classes
Name |
Description |
PassthroughTranslator |
This translator service simply passes through the us-english strings with the
replacement tokens substituted in. |