{@inheritdoc}

@param string $key
@param array  $replace (optional)
@param string $locale  (optional)

@return string
344455
public function get($key, array $replace = [])
    {
        return $this->translator->get($this->composeKey($key), $replace, $this->locale);
    }
451177
private function cleanArrayKey($key, &$array, $replaceWith)
    {
        $keys = explode('.', $key);

        foreach ($keys as $k) {

            $array = &$array[$k];
        }

        return $array = $this->cleanString($array, $replaceWith);
    }
1277682
public function t($key, array $options = [], $locale = null)
    {
        return $this->translate($key, $options, $locale);
    }
1185231
public function locale($locale = null)
    {
        if ($locale) {
            // Normalize the language
            self::$locale = strtolower(str_replace([' ', '_'], '-', $locale));
        }

        return self::$locale;
    }
700308
static function item($name,$replace = []){
		
		// get info name and key
		$prop = self::engineName($name);
		
		$lang = $prop->key;
		
		// check language
		if(isset(self::$language[$prop->app][$prop->key])){
			$lang = self::$language[$prop->app][$prop->key];
		}

		$map_replace = [
			'today' => date(Config::read('App.Base.fmt_date'))
		];
		
		// replace string
		$replace = array_merge($replace,$map_replace);
		foreach($replace as $index => $text){
			$i[] = '{'.$index.'}';
			$t[] = $text;
		}
		$lang = str_replace($i,$t,$lang);

		return $lang;
	}
1264169
private function transformLocale($locale)
    {
        $theme = $this->themeContext->getTheme();

        if (null === $theme) {
            return $locale;
        }

        if (null === $locale) {
            $locale = $this->getLocale();
        }

        $locale = $locale . '@' . str_replace('/', '-', $theme->getName());

        return $locale;
    }
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;
    }
264569
public static function replace($string, $replace = '***', $santize = false, $dict = '', $attr = null) {
        if ($santize) {
            $string = self::santize($string);
        }
        $keys = self::keywords($string, 500, $dict, $attr);
        if ($keys) {
            foreach ($keys as $key) {
                $string = str_replace($key, $replace, $string);
            }
        }

        return $string;
    }
836061
public static function formatLocale($locale)
    {
        if (\is_string($locale)) {
            $locale = strtolower($locale);
            $locale = str_replace('-', '_', $locale);
        }

        return $locale;
    }
1108985
public function getLine($key, $replace = [], $locale = null, $fallback = true)
	{
		list($namespace, $group, $item) = $this->parseKey($key);

		// Here we will get the locale that should be used for the language line. If one
		// was not passed, we will use the default locales which was given to us when
		// the translator was instantiated. Then, we can load the lines and return.
		$locales = $fallback ? $this->localeArray($locale)
							 : [$locale ?: $this->locale];

		foreach ($locales as $locale) {
			if (! is_null($line = $this->read(
				$namespace, $group, $locale, $item, $replace
			))) {
				break;
			}
		}

		return isset($line) ? $line : null;
	}
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]);
	}
940024
protected function getTranslation($key, $locale) {
        if( isset($this->translations[$locale][$key]) )
            return $this->translations[$locale][$key];

        return $key;
    }
1107662
public function getTranslation(string $key, string $locale = null)
    {
        $this->throwExceptionIfAttributeIsNotTranslatable($key);

        $translations = $this->getTranslations($key);

        if (count($translations)) {
            $locale = $locale ?: config('app.locale');

            if (isset($translations[$locale])) {
                $translation = $translations[$locale];
            } else {
                $translation = $translations[$this->getDefaultLocale()] ?? head($translations);
            }

        } else {
            $translation = null;
        }

        if ($this->hasGetMutator($key)) {
            return $this->mutateAttribute($key, $translation);
        }

        return $translation;
    }
1281820
private function translate($key, $locale = null)
    {
        if (is_null($locale))
            $locale = $this->translator->getLocale();

        $translation = $this->translator->trans($key, [], $locale);

        // @codeCoverageIgnoreStart
        if ( ! is_string($translation))
            throw new InvalidTranslationException(
                "The translation key [{$key}] for locale [{$locale}] should return a string value."
            );
        // @codeCoverageIgnoreEnd

        return (string) $translation;
    }
512300
public function getName(string $key, string $locale = null)
    {
        return $this->get($key, $locale);
    }
1000498
protected function replacePlaceholders(
        /*# string */ $key,
        array &$bindings,
        array $settings
    )/*# : string */ {
        $escape = $this->escape;

        $value = $this->parameters[$key];
        if ($settings['positionedParam']) {
            $bindings[] = $value;
            return '?';
        } elseif ($settings['namedParam'] && $this->isNamedParam($value)) {
            return $value;
        } else {
            return $escape($value);
        }
    }
431823
protected function t($key, array $parameters = [], $domain = null, $locale = null)
    {
        return $this->getContainer()->get('translator')->trans($key, $parameters, $domain, $locale);
    }