-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(provisioning_api): Translate exceptions shown in the frontend #43234
Conversation
@@ -1432,7 +1412,7 @@ public function removeFromGroup(string $userId, string $groupid): DataResponse { | |||
|
|||
if (count($userSubAdminGroups) <= 1) { | |||
// Subadmin must not be able to remove a user from all their subadmin groups. | |||
throw new OCSException('Not viable to remove user from the last group you are SubAdmin of', 105); | |||
throw new OCSException($this->l10n->t('Not viable to remove user from the last group you are SubAdmin of'), 105); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you use "SubAdmin" or "subadmin". Please align all occurences. My vote goes to "sub-admin"
btw. I do not get the meaning of this sentence:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you use "SubAdmin" or "subadmin". Please align all occurences. My vote goes to "sub-admin"
Done ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw. I do not get the meaning of this sentence
If I understand this correctly a sub-admin is not allowed to remove a user from all groups that user is sub-admin of, meaning the user must stay sub-admin of at least one groupe (maybe @nickvergessen, as the author, can help)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think so, to avoid users that are managed by no one
46b36b7
to
5b5da71
Compare
5b5da71
to
8a25bee
Compare
Made wording consistent "sub-admin", please re-review
Reverted to deprecated function, please re-review
8a25bee
to
4ea985b
Compare
@Pytal also added translations for the missing exceptions - at least if it makes sense. |
…eplace some deprecations Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
4ea985b
to
a025611
Compare
Summary
This exception messages are used by the front end to be displayed to the user, using hint exceptions would be quite breaking as hint exceptions are handled as HTTP error 500 for OCS controllers.
But I think it should be ok to simply translate the messages as for programmatically usage you should not use the message but the status code.
Also fixed some minor deprecation issue.
Checklist