Try selecting page localization by request parameter.

@param string $key
@return Localization
163424
private function searchLocalizationByRequestKey($key)
	{
		$localizationId = $this->getRequestInput()->get($key);

		// Fix for news application filter folders
		if (strpos($localizationId, '_') !== false) {
			$localizationId = strstr($localizationId, '_', true);
		}

		if (empty($localizationId)) {
			return null;
		}

		return $this->getEntityManager()
				->find(Localization::CN(), $localizationId);
	}
923633
public function translate($key)
    {
        if ($this->translations === null) {
            $this->loadTranslations();
        }

        if (!isset($this->translations[$key])) {
            // the key if $this is already the fallback translator
            return $this !== self::$fallbackTranslator ? self::$fallbackTranslator->translate($key) : $key;
        }

        return  $this->translations[$key];
    }
68111
public function translate($key) {

		//First: check the cache:
		if(isset($this->cache[$key])) {
			if($this->cache[$key] instanceof DictionaryEntryNotFoundException) {
				throw $this->cache[$key];
			}
			return $this->cache[$key];
		}

		//If the key could not be found in cache,
		//and we do not have a valid domDocument to parse (ie. the dictionary was
		//initialized by restore rather than load)
		//throw an Entry Not Found Exception.
		if(null == $this->domDocument) {
		    $exception = new DictionaryEntryNotFoundException($key);
			$this->cache[$key] = $exception;
			throw $exception;
		}

		$xpath = new \DOMXPath($this->domDocument);

		//Find the entry (whose key attribute is as specified):
		$domNodeList = $xpath->evaluate('/fig:dictionary/entry[@key="' . $key . '"]');

		if($domNodeList->length == 0) {
			//The translation for this key was not found in the current dictionary.
            $exception = new DictionaryEntryNotFoundException($key);
			$this->cache[$key] = $exception;
			throw $exception;
		}

		//The Value part is the inner contents of the entry tag.
		$result = $this->domDocument->saveXML($domNodeList->item(0));
		$result = preg_replace('/^<entry[^>]+>/', '', $result);
		$result = preg_replace('/<\/entry>$/', '', $result);

		return ($this->cache[$key] = $result);
	}
1245964
public function get($key)
	{
		if (is_null($this->activeLocale))
		{
			throw new NoLocaleLoadedException('No locale was loaded for this collection.');
		}

		$locale = $this->activeLocale;
		return $this->locales[$locale]->get($key);
	}
308474
function keyTranslate( $key )
    {
        $msg = $this->findKey( $key );
        if ( $msg !== null )
            return $msg["translation"];
        else
        {
            return null;
        }
    }
906208
public String get(final String key) {
        return get(Keys.LANGUAGE, key, Locales.getLocale());
    }
365096
protected function getText($key)
    {
        return isset($this->texts[$key]) ? $this->texts[$key] : GetOpt::translate($key);
    }
1114439
public function getParamByKey($key){

         if( array_key_exists( $key, array_dot( $this->service['param'] ) ) ){

             return array_get($this->service['param'], $key);
         }
    }
568181
public function get($key) 
    {
        return isset($this->langs[$key]) ? $this->langs[$key] : $key;
    }
31812
protected function hasTemplateOption($key)
    {
        if ($this->templateOptions === null) {
            $this->templateOptions = $this->buildTemplateOptions();
        }

        return isset($this->templateOptions[$key]);
    }
567687
public function get($key)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        if (!isset($this->language[$key])) {
            $this->language[$key] = $key;
        }
        
        return $this->language[$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;
    }
1147852
function getLocale (key) {
    var locale;

    if (key && key._locale && key._locale._abbr) {
        key = key._locale._abbr;
    }

    if (!key) {
        return globalLocale;
    }

    if (!isArray$2(key)) {
        //short-circuit everything else
        locale = loadLocale(key);
        if (locale) {
            return locale;
        }
        key = [key];
    }

    return chooseLocale(key);
}
192861
public function server(string $key): string
    {
        if (array_key_exists($key, $this->server)) {
            return $this->server[$key];
        }

        return '';
    }
477331
public function translate($key)
    {
        $normalizeKey = $this->normalize($key);

        if ($this->exists($normalizeKey, false)) {
            $string = $this->strings[$normalizeKey];

            // In debug mode, we notice user this is a translated string.
            if ($this->debug) {
                $string = '**' . $string . '**';
            }

            // Store used keys
            if (!in_array($normalizeKey, $this->used)) {
                $this->used[] = $normalizeKey;
            }

            return $string;
        }

        // In debug mode, we notice user this is a translating string but not found.
        if ($this->debug) {
            $this->orphans[$normalizeKey] = $this->backtrace($normalizeKey, $this->traceLevelOffset + 2);

            $key = '??' . $key . '??';
        }

        return $key;
    }
533733
public function searchHelpTextByKeyLocale($translationKey, $locale)
    {
        $qb = $this->createQueryBuilder('h');
        $qb->where('h.locale LIKE :locale')
            ->andWhere('h.translationKey LIKE :translationKey')
            ->orderBy('h.id', 'asc')
            ->setParameter(':locale', substr($locale, 0, 2).'%')
            ->setParameter(':translationKey', $translationKey.'%');

        return $qb->getQuery()->getResult();
    }
888660
public function translate(string $key, ?string $lang = null): ?string
    {
        try {
            // Validate key
            $key = strtolower($key);
            if (!preg_match('/^[a-z0-9\.\-\_]+$/', $key)) {
                throw new TranslatorException('Invalid translation key');
            }

            // Get current language
            $language = $this->_language($lang);
            $translation = $language->get($key);

            if ($translation) { // Translation found
                return $translation;
            }

            // Fallback
            try {
                $fallback = $this->_fallback();
            } catch (LanguageException $e) {
                throw new LanguageException('[Fallback] ' . $e->getMessage());
            }

            if ($fallback && $fallback->name() !== $language->name()) {
                $translation = $fallback->get($key);
                if ($translation) {
                    return $translation;
                }
            }
        } catch (TranslatorException $e) {
            trigger_error(sprintf('Translation error [%s]: %s', $key, $e->getMessage()), E_USER_WARNING);
        }

        return null;
    }