src/Upload.php
function translate($str, $tokens = [])
    {
        if (array_key_exists($str, $this->translation)) {
            $str = $this->translation[$str];
        }
        if (is_array($tokens) && sizeof($tokens) > 0) {
            $str = vsprintf($str, $tokens);
        }

        return $str;
    }
function translate($str, $tokens = [])
    {
        if (array_key_exists($str, $this->translation)) {
            $str = $this->translation[$str];
        }
        if (is_array($tokens) && sizeof($tokens) > 0) {
            $str = vsprintf($str, $tokens);
        }

        return $str;
    }
function translate ( $ str , $ tokens = [ ] ) { if ( array_key_exists ( $ str , $ this -> translation ) ) { $ str = $ this -> translation [ $ str ] ; } if ( is_array ( $ tokens ) && sizeof ( $ tokens ) > 0 ) { $ str = vsprintf ( $ str , $ tokens ) ; } return $ str ; }
Translate error messages

@access private

@param string $str    Message to translate
@param array  $tokens Optional token values

@return string Translated string
Translate error messages