src/I18n/TranslationPromise.php
protected function suggestLanguage()
    {
        if (Reaction::isDebug()) {
            Reaction::warning(__METHOD__ . ' call. Avoid it for performance reasons.');
        }
        $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS);
        $traceCount = count($trace) - 1;
        for ($i = $traceCount; $i >= 0; $i--) {
            if (!isset($trace[$i]['object']) || !$trace[$i]['object'] instanceof RequestLanguageGetterInterface) {
                continue;
            }
            /** @var RequestLanguageGetterInterface $object */
            $object = $trace[$i]['object'];
            $this->language = $object->getRequestLanguage();
            break;
        }
    }
protected function suggestLanguage()
    {
        if (Reaction::isDebug()) {
            Reaction::warning(__METHOD__ . ' call. Avoid it for performance reasons.');
        }
        $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS);
        $traceCount = count($trace) - 1;
        for ($i = $traceCount; $i >= 0; $i--) {
            if (!isset($trace[$i]['object']) || !$trace[$i]['object'] instanceof RequestLanguageGetterInterface) {
                continue;
            }
            /** @var RequestLanguageGetterInterface $object */
            $object = $trace[$i]['object'];
            $this->language = $object->getRequestLanguage();
            break;
        }
    }
Dirty method to suggest translation language