public static function get_string_from_input($string) {
        $string = trim($string);

        if (preg_match('|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9\.:/_-]*)$|', $string, $matches)) {
            if ($matches[2] === 'moodle') {
                $matches[2] = 'core';
            }

            if (get_string_manager()->string_exists($matches[1], $matches[2])) {
                $string = get_string($matches[1], $matches[2]);
            }
        }

        return $string;
    }
public static function get_string_from_input($string) {
        $string = trim($string);

        if (preg_match('|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9\.:/_-]*)$|', $string, $matches)) {
            if ($matches[2] === 'moodle') {
                $matches[2] = 'core';
            }

            if (get_string_manager()->string_exists($matches[1], $matches[2])) {
                $string = get_string($matches[1], $matches[2]);
            }
        }

        return $string;
    }
public static function get_string_from_input ( $ string ) { $ string = trim ( $ string ) ; if ( preg_match ( '|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9\.:/_-]*)$|' , $ string , $ matches ) ) { if ( $ matches [ 2 ] === 'moodle' ) { $ matches [ 2 ] = 'core' ; } if ( get_string_manager ( ) -> string_exists ( $ matches [ 1 ] , $ matches [ 2 ] ) ) { $ string = get_string ( $ matches [ 1 ] , $ matches [ 2 ] ) ; } } return $ string ; }
Attempt to fetch any matching langstring if the string is in the
format identifier,component.

@param   string  $string
@return  string
Attempt to fetch any matching langstring if the string is in the format identifier component .