public static function t($msg, $args = array())
    {
        assert('is_string($msg)');
        if (extension_loaded('gettext')) {
            bindtextdomain("phptoolkit", dirname(dirname(__DIR__)).'/locale');
            textdomain('phptoolkit');

            $translatedMsg = gettext($msg);
        } else {
            $translatedMsg = $msg;
        }
        if (!empty($args)) {
            $params = array_merge(array($translatedMsg), $args);
            $translatedMsg = call_user_func_array('sprintf', $params);
        }
        return $translatedMsg;
    }
public static function t($msg, $args = array())
    {
        assert('is_string($msg)');
        if (extension_loaded('gettext')) {
            bindtextdomain("phptoolkit", dirname(dirname(__DIR__)).'/locale');
            textdomain('phptoolkit');

            $translatedMsg = gettext($msg);
        } else {
            $translatedMsg = $msg;
        }
        if (!empty($args)) {
            $params = array_merge(array($translatedMsg), $args);
            $translatedMsg = call_user_func_array('sprintf', $params);
        }
        return $translatedMsg;
    }
public static function t ( $ msg , $ args = array ( ) ) { assert ( 'is_string($msg)' ) ; if ( extension_loaded ( 'gettext' ) ) { bindtextdomain ( "phptoolkit" , dirname ( dirname ( __DIR__ ) ) . '/locale' ) ; textdomain ( 'phptoolkit' ) ; $ translatedMsg = gettext ( $ msg ) ; } else { $ translatedMsg = $ msg ; } if ( ! empty ( $ args ) ) { $ params = array_merge ( array ( $ translatedMsg ) , $ args ) ; $ translatedMsg = call_user_func_array ( 'sprintf' , $ params ) ; } return $ translatedMsg ; }
Translates any string. Accepts args

@param string $msg Message to be translated
@param array|null $args Arguments

@return string $translatedMsg  Translated text
Translates any string . Accepts args