-
-
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
Translate all share exceptions #40164
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Fix drone Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Fix tests Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
3cfb95e
to
7cf9cdd
Compare
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.
Why all the $message_t intermediate var, just passed the result of the call to the exception constructor directly?
Also why in some places you rename an existing var?
The server/lib/private/Share20/Manager.php Lines 361 to 362 in aba3f99
Where the existing |
Hum @nextcloud/files what do you think? |
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.
Indeed, I would rather see the result used directly instead of having intermediate variables.
@come-nc where have you seen the variable rename ?
$message = $this->l->n('Cannot set expiration date more than %n day in the future', 'Cannot set expiration date more than %n days in the future', $defaultExpireDays); | ||
throw new GenericShareException($message, $message, 404); | ||
$message_t = $this->l->n('Cannot set expiration date more than %n day in the future', 'Cannot set expiration date more than %n days in the future', $defaultExpireDays); | ||
throw new GenericShareException($message_t, $message_t, 404); |
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.
@artonge Here (and a few other places below)
So, in fine, what's the status here? |
put the translation message straight into the Exception :) |
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.
According to previous reviews, there seems to be consensus to avoid using intermediate $message
or $message_t
variables, can this be updated?
Will do as soon as I find some time, no problem. 👍 |
Summary
Fixes ambiguous messages like :
![image](https://private-user-images.githubusercontent.com/12234510/264356150-d077d5b8-a501-4194-b0fa-18efbe6d6593.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2MDIwODUsIm5iZiI6MTcyMTYwMTc4NSwicGF0aCI6Ii8xMjIzNDUxMC8yNjQzNTYxNTAtZDA3N2Q1YjgtYTUwMS00MTk0LWIwZmEtMThlZmJlNmQ2NTkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIxVDIyNDMwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTljZGZhMDlkNGFjZGZjZGRjOGFjZGFhMWE3NDk0NjJiNjIwODI3ZjIxYWRjZDYxYzJlZDBlMjEyMDU5Y2RmNDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.d2Nc5IQrwNNNtpXmRyOe3smgvwoIlnkld6Amt48H77M)
Checklist