mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-02 03:51:22 +08:00
Notifications: Aligned how user language is used
- This ensures content notifications are not translated to receiver language. - This adds actual plaintext support for content notifications (Was previously just HTML as text view). - Shares same base class across all mail notifications. - Also cleaned up existing notification classes. Future cleanup requested via #4501
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
namespace BookStack\Translation;
|
||||
|
||||
use BookStack\Users\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LanguageManager
|
||||
@ -80,6 +81,15 @@ class LanguageManager
|
||||
return setting()->getUser($user, 'language', $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the language for the given user.
|
||||
*/
|
||||
public function getLanguageForUser(User $user): string
|
||||
{
|
||||
$default = config('app.locale');
|
||||
return setting()->getUser($user, 'language', $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given BookStack language value is a right-to-left language.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user