API: i18n for warnings and errors
[lhc/web/wiklou.git] / includes / api / ApiQueryUsers.php
index 9b45b91..65d3797 100644 (file)
@@ -226,7 +226,7 @@ class ApiQueryUsers extends ApiQueryBase {
                                        foreach ( $params['token'] as $t ) {
                                                $val = call_user_func( $tokenFunctions[$t], $user );
                                                if ( $val === false ) {
-                                                       $this->setWarning( "Action '$t' is not allowed for the current user" );
+                                                       $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
                                                } else {
                                                        $data[$name][$t . 'token'] = $val;
                                                }
@@ -253,7 +253,7 @@ class ApiQueryUsers extends ApiQueryBase {
                                                foreach ( $params['token'] as $t ) {
                                                        $val = call_user_func( $tokenFunctions[$t], $iwUser );
                                                        if ( $val === false ) {
-                                                               $this->setWarning( "Action '$t' is not allowed for the current user" );
+                                                               $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
                                                        } else {
                                                                $data[$u][$t . 'token'] = $val;
                                                        }