Find the translation.

@param string $locale
@param string $dictionary
@param array $keys
@return string|array|null
760842
private function find($locale, $dictionary, $keys)
    {
        if (!isset($this->entries[$locale][$dictionary])) {
            if (!isset($this->entries[$locale])) {
                $this->entries[$locale] = [];
            }
            $file = $this->dictionaryFile($dictionary, $locale);
            /** @noinspection PhpIncludeInspection */
            $this->entries[$locale][$dictionary] = $file !== null && file_exists($file) ? include $file : [];
        }

        $entries = $this->entries[$locale][$dictionary];
        foreach ($keys as $key) {
            if (!isset($entries[$key])) {
                return null;
            }
            $entries = $entries[$key];
        }

        return $entries;
    }
67231
public function translate($key, $translation, $locale = null, $driver = null) {
        $driver = ! is_null($driver) ? $this->getDriver($driver) : $this->driver();

        return $driver->translate(
            $key, $translation, $locale
        );
    }
1374533
public function get($key, array $replace = array(), $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.
		foreach ($this->parseLocale($locale) as $locale)
		{
			$this->load($namespace, $group, $locale);

			$line = $this->getLine(
				$namespace, $group, $locale, $item, $replace
			);

			// If we cannot find the translation group in the database nor as a file
			// an entry in the database will be added to the translations.
			// Keep in mind that a file cannot be used from that point.
			if(!self::isNamespaced($namespace) && is_null($line)) {
				// Database stuff
				$this->database->addTranslation($locale, $group, $key);
			}

			if ( ! is_null($line)) break;
		}

		// If the line doesn't exist, we will return back the key which was requested as
		// that will be quick to spot in the UI if language keys are wrong or missing
		// from the application's language files. Otherwise we can return the line.
		if ( ! isset($line)) return $key;

		return $line;
	}
1277682
public function t($key, array $options = [], $locale = null)
    {
        return $this->translate($key, $options, $locale);
    }
448200
public function has($key, $locale = null) {
        $locale = $this->locale($locale);

        return Lang::has($key, $locale);
    }
165554
public function get($key, $locale = null)
    {
        if(!$locale){
            $locale = $this->getLocale();
        }

        if($locale == config('translator.default')){
            return $key;
        }

        $this->load($locale);

        if (!isset($this->languages[$locale][$key])){
            $this->setMissing($key, $locale);
            return $key;
        }

        return $this->languages[$locale][$key]["value"];
    }
1253315
public function getchangedI18N($locale=null) {
		if(!$locale)
			return array_keys($this->translationschanged);
		elseif(isset($this->translationschanged[$locale]))
			return array_keys($this->translationschanged[$locale]);
		else
			return [];
	}
863565
public static function get($key, $default = null, $locale = null)
    {
        return self::all($locale)->get($key, $default);
    }
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;
    }
455395
protected function getTranslation(string $locale): ?Model
    {
        if (isset($this->translationCache[$locale])) {
            return $this->translationCache[$locale];
        }

        if (!$this->exists) {
            return null;
        }

        $translation = $this->translations
            ->where('locale', $locale)
            ->first();

        if ($translation) {
            $this->translationCache[$locale] = $translation;
        }

        return $translation;
    }
309728
public function get($key, $replacement = array(), $locale = null) {
        $locale = $this->locale($locale);

        return Lang::get($key, $replacement, $locale);
    }
633805
public function translate($locale) {
		$localeEntity = clone $this;
		$localeEntity->setLocale($locale);
		if(isset($this->data['translations'][$locale]))
			$localeEntity->_set($this->data['translations'][$locale]);
		unset($localeEntity->data['translations'][$locale]);
		$localeEntity->data['translations'][$this->getLocale()] = $this->data['properties'];

		return $localeEntity;
	}
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;
    }
205167
public function getTranslations(Locale $locale)
    {
        $localeID = $locale->getID();
        $translations = isset($this->translations[$localeID]) ? $this->translations[$localeID][1] : null;
        if ($translations === null) {
            $translations = clone $this->getSourceStrings(true);
            $translations->setLanguage($locale->getID());
            $this->setTranslations($locale, $translations);
        }

        return $translations;
    }
533329
public function getTranslationByLocale($locale)
    {
        foreach ($this->getTranslations() as $valueTranslation) {
            if ($valueTranslation->getLocale() === $locale) {
                return $valueTranslation;
            }
        }

        return null;
    }
970379
public function translate($entity, $locale)
    {
        $metadata = $this->metadataCollection->getMetadata($entity);
        if($metadata === null) {
            return null;
        }

        //translation data is stored inside the object
        if($locale === $this->defaultLocale) {
            return;
        }

        $accessor = PropertyAccess::createPropertyAccessor();   
        if($metadata !== null) {
            foreach($metadata->getProperties() as $property) {
                $strategy = $this->strategyResolver->getStrategy($property->getStrategy());
                $value = $strategy->getTranslation($entity, $property, $locale, $metadata);
                $accessor->setValue($entity, $property->getName(), $value);
            }
        }
    }
814886
public function get($key, $locale = null)
    {
        return $this->translator->get("log-viewer::levels.$key", [], $locale ?: $this->getLocale());
    }