Transforms the Key to a string

@param mixed $key

@return string
187059
public static function create($key)
    {
        // Ignore arrays and objects
        if (is_object($key) or is_array($key)) {
            $key = '';
        }

        $key_string = strval($key);

        $key = new self;
        $key->raw = $key_string;

        $keys = explode('.', $key_string);

        foreach ($keys as $value) {
            $key->push($value);
        }

        $key->rewind();

        return $key;
    }
536267
public function normalize($key)
    {
        if (strlen($key) > $this->length) {
            $checksum = dechex(crc32($key));
            return substr($key, 0, $this->length - strlen($checksum)) . $checksum;
        }

        return $key;
    }
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;
    }
964284
protected function parseKey(&$key) {
        $key   =  trim($key);
        if(!is_numeric($key) && !preg_match('/[,\'\"\*\(\)\[.\s]/',$key)) {
           $key = '['.$key.']';
        }
        return $key;   
    }
681598
protected function _normalizeKey($key)
    {
        if (!is_string($key) && !is_numeric($key))
            $key = md5(Std\flatten($key));

        return $key;
    }
200087
protected function getHash(string $key): string
    {
        if ('' == $key) {
            return 'empty,' . time();
        } elseif (preg_match('/[^A-Za-z0-9~_,\.\/\-]|(\.{2})/', $key)) {
            return md5($key);
        }
        return str_replace('/', ',', $key);
    }
873964
private function prepareKey($key)
    {
        if (!preg_match('/^[a-zA-Z0-9_-]+$/', $key)) {
            throw new InvalidArgumentException($key);
        }

        return $this->keyPrefix . strtr($key, '-', '_');
    }
949861
public function convertToArraySyntax($key)
    {
        if (strpos($key, '.') === false) {
            return $key;
        }
        $key = str_replace('.', '][', $key);
        $key = preg_replace('#\]#', '', $key, 1);

        return $key.']';
    }
1030559
public function getKey($key) {
		$out = NULL;
		if ($this->hasKey($key)) {
			$out = $this->key[$key];
			unset($this->key[$key]);
		}
		return $out;
	}
596136
protected function getCompositeKey(string $key) : string
    {
        $keys = $this->keys;
        $keys[] = $key;
        $output = implode('.', $keys);
        return trim($output, '.');
    }
469543
protected function prettyHeaderKey(string $key) : string
    {
        return strtr(ucwords(strtr(strtr(strtolower($key), "_", " "), "-", " ")), " ", "-");
    }
716183
private static function stringifyArrayKey(array $key): string
    {
        ksort($key);

        foreach ($key as &$value) {
            if (is_array($value)) {
                $value = self::stringifyArrayKey($value);
            } elseif (is_object($value)) {
                $value = self::stringifyKey($value);
            }
        }

        return json_encode($key);
    }
133134
protected function buildParameterPattern(string $key) : string
	{
		return '(' . str_replace('~', '\\~', $this->parameterPattern[$key] ?? self::ALLOWED_CHARS) . ')';
	}
1291233
public function getKey(string $key)
    {
        $keys = explode('.', $key);
        $file = array_shift($keys);
        $keys = explode('/', implode('.', $keys));

        if (!isset($this->translations[$file])) {
            $this->addFile($file);
        }

        return $this->findKey($file, $keys);
    }
661841
public static function normalizeKey($key)
    {
        $key = strtr(strtolower($key), '_', '-');
        if (strpos($key, 'http-') === 0) {
            $key = substr($key, 5);
        }

        return $key;
    }
104701
public function getKey($key)
    {
        $key = strtolower($key);
        if (!isset($this->keys[$key])) {
            return null;
        }
        return (string)$this->keys[$key];
    }
684341
protected function hashIt(/*# string */ $key)/*# : string */
    {
        $md5  = md5($key);
        $hash = $this->file_pref . $md5 . $this->file_suff;

        // no hash
        if (!$this->hash_level) {
            return $hash;
        }

        // hash
        $pref = '';
        for ($i = 0; $i < $this->hash_level; $i++) {
            $pref .= $md5[$i] . '/';
        }
        return $pref . $hash;
    }