src/Services/Translator.php
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;
    }
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;
    }
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 ; }
Find the translation.

@param string $locale
@param string $dictionary
@param array $keys
@return string|array|null
Find the translation .