Fetches the translation for the specified string.

@param string $string

@return string
8348
public function getString($string)
    {
        // Exact match?
        if (isset($this->strings[$string])) {
            return $this->strings[$string];
        } else {
            return $string;
        }
    }
334968
public function translate($string)
    {
        $args = func_get_args();
        $translated = array_shift($args);
        $extraParams = $args;
        if (count($extraParams)>0)
        {
            $translated = vsprintf($translated, $extraParams);
        }

        return $translated;
    }
924671
public function fetchFromString($string ="", $data = [])
    {
        $data = array_merge($this->defaultVariables, $data);

        return $this->environment->createTemplate($string)->render($data);
    }
431946
public static function up($string): string
    {
        if (self::isMBString()) {
            return mb_strtoupper($string, self::$encoding);
        }

        return strtoupper($string); // @codeCoverageIgnore
    }
1038668
public function transform($string)
    {
        foreach ($this->collection->getTransformers() as $transformer) {
            $string = $transformer->transform($string);
        }
        return $string;
    }
58293
public static function strtoupper($string)
    {
        if(!defined('UTF8_NOMBSTRING') && function_exists('mb_strtolower'))
            return mb_strtoupper($string,'utf-8');

        //global $utf8_lower_to_upper;
        $uni = self::utf8_to_unicode($string);
        $cnt = count($uni);
        for ($i=0; $i < $cnt; $i++){
            if(self::$utf8_lower_to_upper[$uni[$i]]){
                $uni[$i] = self::$utf8_lower_to_upper[$uni[$i]];
            }
        }
        return self::unicode_to_utf8($uni);
    }
855085
protected static function loadTranslation($string, $text_domain)
    {
        /**
         * Locale file path
         *
         * @var string $file
         */
        $file = static::$dir . '/' . static::$locale . '/' . $text_domain . '.php';

        /**
         * Check if we have already loaded this file
         */
        if (array_key_exists($file, static::$loaded)) {

            /**
             * Save missing string if configured to
             */
            if (static::$autoGenerate && (!isset(static::$loaded[$file][$string]))) {
                return static::addTranslation($file, $string);
            }

            /** return processed string */
            return isset(static::$loaded[$file][$string]) && !empty(static::$loaded[$file][$string])
                ? self::$loaded[$file][$string] : $string;
        }

        /**
         * Check if the file exists
         */
        if (!file_exists($file)) {

            /**
             * Create file if not in configured to
             */
            if (static::$autoGenerate) {
                static::saveTranslationFile($file, [$string => '']);
            }

            return $string;
        }
        /** @noinspection PhpIncludeInspection */
        static::$loaded[$file] = (array)require $file;

        /**
         * Save missing string if not in production
         */
        if (static::$autoGenerate && (!isset(static::$loaded[$file][$string]))) {
            return static::addTranslation($file, $string);
        }

        /** return processed string */
        return isset(static::$loaded[$file][$string]) && !empty(static::$loaded[$file][$string])
            ? static::$loaded[$file][$string] : $string;
    }
745498
public function translate($string)
    {
        $args = func_get_args();
        $unstranslatedString = array_shift($args);
        $extraParams = $args;
        $translated = $this->getAdaptor()->translate($unstranslatedString);
        if (count($extraParams)>0)
        {
            $translated = vsprintf($translated, $extraParams);
        }

        return $translated;
    }
371153
public function getValue($string)
    {
        // now just drop the msb and reorder it + parse it in own string
        $valuestring = '';
        $string_length = strlen($string);

        $i = 1;

        while ($string_length > $i) {
            // unset msb string and reorder it
            $valuestring = substr($string, $i, 7) . $valuestring;
            $i += 8;
        }

        // now interprete it
        return bindec($valuestring);
    }
1339199
public function parseString($string)
    {
        $string = (string) $string;
        $string = preg_replace_callback("/\\$\{(.*?)\}/",
            function ($k) {
                return $this->get($k[1]);
            }, $string);

        return $string;
    }
673154
public static function strtoupper($string): string
    {
        if (in_array(self::$locale->language()->code(), self::DOTLESS_I_LOCALES, true)) {
            $string = strtr($string, self::DOTLESS_I_TOUPPER);
        }

        return mb_strtoupper($string);
    }
800043
public static function ucfirst(string $string): string
    {
        return self::strtoupper(self::substr($string, 0, 1)) . self::substr($string, 1);
    }
1036165
public static function stringToArray($string)
    {
        if (!preg_match("@^{.*?}$@", $string)) {
            return $string;
        }
        $parts = explode(',', substr($string, 1, -1));
        foreach ($parts as &$part) {
            $part = self::stringToArray($part);
        }
        return $parts;
    }
838611
public function resolveLinksInString($string)
    {
        return preg_replace_callback(
            '/(?<!\\\){@(.*?)}/',
            function ($matches) {
                try {
                    return $this->offsetGet($matches[1]);
                } catch (\OutOfBoundsException $e) {
                    return $matches[0];
                }
            },
            $string
        );
    }
1169023
public function translate_string($string) {
		if ($this->language->name_short == Config::$base_language) {
			return $string;
		}

		if (!isset($this->strings[$string])) {
			$this->add_to_po($string);
		}

		if ($this->strings[$string] == '') {
			if (Config::$debug) {
				return '[NT]' . $string;
			} else {
				return $string;
			}
		}

		return $this->strings[$string];
	}
127766
public function parseKeyword($string)
    {
        $matches = $this->parseKeywordText($string);
        return $this->parseKeywordToText($matches['keywords'], $matches['alias']);
    }
1226147
protected function getEol( $string ) {
		$pattern = '~[\s\S]*?([\r\n]+)[\s\S]*~m';
		$eol = preg_replace( $pattern, '$1', $string );
		return strlen( $eol ) > 0 ? $eol : PHP_EOL;
	}