Find all language versions of template by key.

@param string $key

@return EmailTemplateTranslation[]|null
543253
public function getAll($key)
    {
        $template = EmailTemplate::find()
            ->byKey($key)
            ->with('translations')
            ->one();

        return empty($template->translations) ? null : $template->translations;
    }
154245
protected function getConditionsFromKey($key)
    {
        if (is_int($key) || ctype_digit($key)) {
            return array(self::MATCH_USER_ID => $key);
        }
        if (strpos($key, '@') !== false) {
            return array(self::MATCH_USER_EMAIL => $key);
        }
        return array(self::MATCH_USER_LOGIN => $key);
    }
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"];
    }
1135851
public function getOriginal($key)
    {
        $key = $this->reFormatForCompatibility($key);

        return (array_key_exists($key, $this->attributes)) ? $this->attributes[$key] : null;
    }
224814
public function getByKeyWithTranslation($key, $language)
    {
        return EmailTemplate::find()
            ->byKey($key)
            ->withTranslation($language)
            ->one();
    }
1077124
public function get(string $key)
    {
        $slug = $this->splitKey($key);

        if (is_string($slug)) {
            if (isset($this[$slug])) {
                return $this[$slug];
            }
            return null;
        }

        $array = $this->toArray();

        foreach ($slug as $search) {
            if (isset($array[$search])) {
                $array = $array[$search];
            } else {
                return;
            }
        }

        return $array;
    }
772022
public static function getTranslation($key)
  {
    $_key = strtoupper($key);
    if ( isset(self::$translations[$_key]) ){
      return self::$translations[$_key];
    }
    
    return $key;
  }
797147
protected function getPageByRequestKey($key)
	{
		$page = $this->searchPageByRequestKey($key);

		if (is_null($page)) {
			$localization = $this->searchLocalizationByRequestKey($key);

			if ( ! is_null($localization)) {
				$page = $localization->getMaster();
			}
		}

		return $page;
	}
332640
public function find($key)
    {
        $template = $this->getCollection()->get($key);

        if ($template !== null) {
            return $template;
        }

        throw new NotFoundException("Media template $key not found.");
    }
118276
function findKey( $key )
    {
        $msg = null;
        if ( isset( $this->Messages[$key] ) )
        {
            $msg = $this->Messages[$key];
        }
        return $msg;
    }
520839
public function checkLanguage(string $key): bool
    {
        $locale = $this->getOption('locale', []);

        if (array_key_exists($key, Arr::wrap($locale))) {
            return filter_var($locale[$key], FILTER_VALIDATE_BOOLEAN);
        }

        return false;
    }
1207279
public function findByKey(string $key) {
        if (!$this->root) {
            return null;
        }

        return $this->root->findByKey($key);
    }
1257139
protected function getOutTemplate($template = 'default') {
		// check for current locale
		if ($this->locale != '') {
			$templatefile = $this->templatespath.'/'.$this->locale.'/'.$this->outtemplateprefix.$template.'.htm';
			
			if (file_exists($templatefile)) {
				return $this->locale.'/'.$this->outtemplateprefix.$template;
			}
		}
		
		// if not found, check for default locale
		if ($this->deflocale != '') {
			$templatefile = $this->templatespath.'/'.$this->deflocale.'/'.$this->outtemplateprefix.$template.'.htm';
			
			if (file_exists($templatefile)) {
				return $this->deflocale.'/'.$this->outtemplateprefix.$template;
			}
		}
		
		// if not found then check in root
		$templatefile = $this->templatespath.'/'.$this->outtemplateprefix.$template.'.htm';
			
		if (file_exists($templatefile)) {
			return $this->outtemplateprefix.$template;
		}
		
		// out template not found
		return null;
	}
156983
public function getTranslations($key): array
    {
        $this->guardAgainstNonTranslatableAttribute($key);
        $value = json_decode($this->getAttributes()[$key] ?? '' ?: '{}', true);

        // Inject default translation if none supplied
        if (! is_array($value)) {
            $oldValue = $value;

            if ($this->hasSetMutator($key)) {
                $method = 'set'.studly_case($key).'Attribute';
                $value = $this->{$method}($value);
            }

            $value = [$locale = app()->getLocale() => $value];

            $this->attributes[$key] = $this->asJson($value);
            event(new TranslationHasBeenSet($this, $key, $locale, $oldValue, $value));
        }

        return $value;
    }
1046892
function keyTranslate( $key )
    {
        $trans = null;
        for ( $i = 0; $i < count( $this->Handlers ) and $trans === null; ++$i )
        {
            $handler = $this->Handlers[$i];
            if ( $handler->isKeyBased() )
                $trans = $handler->keyTranslate( $key );
        }
        return $trans;
    }
121497
protected function getNested(string $key)
    {
        $parts = explode('.', $key);
        $result = $this->settings[$parts[0]];

        for ($i = 1; $i < count($parts); ++$i) {
            $value = $parts[$i];

            if (is_array($result) && array_key_exists($value, $result)) {
                $result = $result[$value];
                continue;
            }

            $result = null;
            break;
        }

        return $result;
    }
295649
public function getCachedVersion($key)
    {
        $key = strtolower($key);
        if ('www.' === substr($key, 0, 4)) {
            $key = substr($key, 4);
        }

        if (\array_key_exists($key, $this->cache)) {
            return $this->cache[$key];
        }

        return false;
    }