public function _f(string $key, $strings, ?string $lang = null): string
    {
        if ($lang === null) {
            $lang = $this->lang;
        }
        
        if (!isset($this->data[$lang])) {
            throw new \OutOfBoundsException("Invalid language: $lang");
        }
        
        if (!isset($this->data[$lang][$key])) {
            throw new \OutOfBoundsException("Invalid key: $key");
        }
        
        if ($strings === null) {
            $strings = '';
        }
        
        if (is_string($strings) || is_float($strings) || is_int($strings)) {
            return sprintf($this->data[$lang][$key], $strings);
        }
        
        if (is_array($strings)) {
            return vsprintf($this->data[$lang][$key], $strings);
        }
        
        throw new \InvalidArgumentException('Strings must be a string or array to return a formatted localized string.');
    }