-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allow different language in public link share email #31656
Conversation
0a85bfa
to
91ace1c
Compare
Codecov Report
@@ Coverage Diff @@
## master #31656 +/- ##
============================================
+ Coverage 62.89% 62.91% +0.01%
- Complexity 18418 18422 +4
============================================
Files 1154 1154
Lines 69157 69177 +20
Branches 1260 1260
============================================
+ Hits 43499 43521 +22
+ Misses 25289 25287 -2
Partials 369 369
Continue to review full report at Codecov.
|
91ace1c
to
115cac1
Compare
Unless @PVince81 has a different opinion I think CLI should be enough for this. Default value should be "English" btw. And for CLI to be a good solution, this needs documentation (for the command and possible values)!! Please take care. /cc @settermjd |
If not too much effort we can add a setting in the settings page. I expect this to be a matter of copying the existing language selection box and adjusting. Let's do this in a separate PR (optional task). @pmaier1 we need to keep in mind the difference between the sysadmin and OC admin roles. Only the sysadmin has access to CLI and OC admin needs to setup everything from the web UI. |
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.
Looks good, see my comment for clarification
lib/private/legacy/template.php
Outdated
// fix translation when app is something like core/lostpassword | ||
$parts = \explode('/', $app); | ||
|
||
$languageCode = $l10n === null ? null : $l10n->getLanguageCode(); |
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.
if the language code of the injected is different, doesn't it mean you can simply reuse that instance instead of re-getting it ?
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.
@PVince81 I did it this way in the previous PR, but this was incorrect as l10n instance depends both on the app and locale. So we need to create an l10n instance with app matching $app
ctor arg
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.
can you add a PHP comment so future onlookers will not wonder ?
also adjust the constructor PHPDoc and clarify which IL10N instance needs to be injected (generic vs app specific vs ...)
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.
@PVince81 I thought it over, let's pass just a language code instead of an object that is not fully suitable.
115cac1
to
d96956b
Compare
Hm, yes, agreed. Taking this into account a dropdown in admin "General" settings would be good. |
disagree. Why in "General", when it is related to sharing and applicable only in case mail notifications for public links are enabled? |
d96956b
to
405ec37
Compare
Hmm ok, good point. I thought it would apply to other notifications or potential future notifications as well. If it's just for link shares and will continue to be then probably next to the setting to enable link share sending in the "Sharing" settings fits better. |
@VicDeo add UI selector in this PR or separately ? |
@PVince81 better separately, unless you want me to c&p most of code from https://github.com/owncloud/core/blob/master/settings/Panels/Personal/Profile.php |
@VicDeo please backport |
I just tried a quick backport but there are conflicts on the template level. |
Stable10: #31767 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Allow set another language for email notification when sharing with link
Related Issue
https://github.com/owncloud/enterprise/issues/2435
Motivation and Context
How Has This Been Tested?
Case 1
expected
email notification has language in accordance with language set in owner personal settings
Case 2
php occ config:app:set core shareapi_public_notification_lang --value 'ru'
expected
Note: in both cases
personal message
is not translatedScreenshots (if appropriate):
Types of changes
Checklist: