Notify with translation.

@todo: Refactor this method to the core package ?

@param  string  $action
@param  array   $replace
@param  array   $context

@return string
544398
protected function transNotification($action, array $replace = [], array $context = [])
    {
        $title   = trans("seo::redirects.messages.{$action}.title");
        $message = trans("seo::redirects.messages.{$action}.message", $replace);

        Log::info($message, $context);
        $this->notifySuccess($message, $title);

        return $message;
    }
854037
protected function process(Action $action, EnvironmentInterface $environment)
    {
        if ($environment->getDataDefinition()->getBasicDefinition()->isEditOnlyMode()) {
            return $environment->getView()->edit($action);
        }

        $modelId      = ModelId::fromSerialized($environment->getInputProvider()->getParameter('id'));
        $dataProvider = $environment->getDataProvider($modelId->getDataProviderName());
        $translator   = $environment->getTranslator();
        $model        = $this->getModel($environment);
        $data         = $this->convertModel($model, $environment);

        $template = (new ContaoBackendViewTemplate('dcbe_general_show'))
            ->set('headline', $this->getHeadline($translator, $model))
            ->set('arrFields', $data['values'])
            ->set('arrLabels', $data['labels']);

        if ($dataProvider instanceof MultiLanguageDataProviderInterface) {
            $template
                ->set('languages', $environment->getController()->getSupportedLanguages($model->getId()))
                ->set('currentLanguage', $dataProvider->getCurrentLanguage())
                ->set('languageSubmit', $translator->translate('MSC.showSelected'))
                ->set('backBT', StringUtil::specialchars($translator->translate('MSC.backBT')));
        } else {
            $template->set('languages', null);
        }

        return $template->parse();
    }
26221
function translate( $context, $source, $comment = null )
    {
        $msg = $this->findMessage( $context, $source, $comment );
        if ( $msg !== null )
        {
            return $msg["translation"];
        }

        return null;
    }
1105270
public function action($action, $parameters = [], $absolute = true)
    {
        $getProjectConfig = Config::get('project');
        //add language if current language
        if($getProjectConfig['multilanguage'] && App::getLocale() != Language::getDefault('slug')) {
            $langParameter = array('lang'=> App::getLocale() );
        }else{
            $langParameter = array('lang'=>"");
        }

        $parameters = array_merge($langParameter, $parameters);
        $method = Theme::getNamespace().$action;
        $url = action($method, $parameters);
        return $url;
    }
603533
public static function processMessage(string $message, $replace) : string {
		if (is_json($replace)) {
			$replace = json_decode($replace, true);
		}
		foreach ($replace as $k => $v) {
			if (is_string($v)) {
				if (substr($v, 0, 2) == '~~') {
					$v = substr($v, 2);
				} else {
					$v = i18n(null, $v);
				}
			} else {
				$v = \Format::id($v);
			}
			$replace[$k] = $v;
		}
		return i18n(null, $message, ['replace' => $replace]);
	}
1171044
public function replaceText($search, $replace)
    {
        if (!$this->open('r+')) {
            return false;
        }

        if ($this->lock !== null && flock($this->handle, LOCK_EX) === false) {
            return false;
        }

        $replaced = $this->write(str_replace($search, $replace, $this->read()), 'w', true);

        if ($this->lock !== null) {
            flock($this->handle, LOCK_UN);
        }
        $this->close();

        return $replaced;
    }
1151600
public static function replacePrefix(string $s, string $search, string $replacement = ''): string
	{
		if (strncmp($s, $search, strlen($search)) === 0) {
			$s = $replacement . substr($s, strlen($search));
		}

		return $s;
	}
660437
public static function replace($match, $replace, $org)
    {
        //if $match satisfies regular expression
        if (is::regex($match)) {
            return preg_replace($match, $replace, $org);
        } else {
            return str_replace($match, $replace, $org);
        }
    }
788851
public function setSuccessOn($clause, IContext &$context = null)
    {
        $isSuccess = is_callable($clause) ? $clause($context) : $clause;
        $isSuccess ? $this->setSuccess($context) : $this->setFail($context);

        return $context;
    }
1172374
public static function translateContext(string $context, string $message, ...$args): string
    {
        $message = self::$translator->translateContext($context, $message);

        return sprintf($message, ...$args);
    }
117043
public function trans($key, array $replace = [], $locale = null)
    {
        return $this->get($key, $replace, $locale);
    }
842152
function translate( $context, $source, $comment = null )
    {
        if ( !is_string( $context ) or $context == "" )
            $context = "default";
        $trans = null;
        for ( $i = 0; $i < count( $this->Handlers ) and $trans === null; ++$i )
        {
            $handler = $this->Handlers[$i];
            $trans = $handler->translate( $context, $source, $comment );
        }
        return $trans;
    }
784114
public function actionify($action)
    {
        if (false !== ($pos = strrpos($action, '.'))) {
            $action = substr($action, $pos + 1);
        }

        // if this is a service rather than just a controller name, the suffix
        // Action is not automatically appended to the method name
        if (false === strpos($this->baseControllerName, ':')) {
            $action .= 'Action';
        }

        return lcfirst(str_replace(' ', '', ucwords(strtr($action, '_-', '  '))));
    }
1206195
protected function _makeStatusMessage($action, $type = 'success')
    {
        $messages = array();
        $messages[] = strtoupper('COM-'.$this->_mixer->getIdentifier()->package.'-PROMPT-'.$this->_mixer->getIdentifier()->name.'-'.$action.'-'.$type);
        $messages[] = strtoupper('LIB-AN-MESSAGE-'.$this->_mixer->getIdentifier()->name.'-'.$action.'-'.$type);
        $messages[] = strtoupper('LIB-AN-MESSAGE-'.$action.'-'.$type);
        $messages[] = 'LIB-AN-PROMPT-COMMIT-'.strtoupper($type);
        $message = translate($messages, false);

        return $message;
    }
1290784
public function get($key, array $replace = array(), $locale = null, $fallback = true)
    {
        // Get without fallback
        $result = parent::get($key, $replace, $locale, false);
        if($result === $key){
            $this->notifyMissingKey($key);

            // Reget with fallback
            $result = parent::get($key, $replace, $locale, $fallback);
            
        }

        return $result;
    }
912074
final public function execute($action, AnCommandContext $context)
    {
        $method = '_'.AnInflector::variablize('authorize.'.$action);

        $result = self::AUTH_NOT_IMPLEMENTED;

        if (method_exists($this, $method)) {
            $this->_entity = $context->mixer;
            $this->_viewer = $context->viewer;
            $result = $this->$method($context);
        }

        return $result;
    }
1160150
public static function replaceAssoc(array $replace, string $subject){
        return str_replace(array_keys($replace), array_values($replace), $subject);
    }