mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added base RTL support
For #939 - Adds way to check if current language is RTL via config system. - Made TinyMCE default direction be based on current language text direction. - Fixed bullet points to be RTL compatible. - Set page content body to have direction based on content.
This commit is contained in:
@ -6,6 +6,9 @@ use Illuminate\Http\Request;
|
||||
|
||||
class Localization
|
||||
{
|
||||
|
||||
protected $rtlLocales = ['ar'];
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
@ -23,6 +26,11 @@ class Localization
|
||||
$locale = setting()->getUser(user(), 'language', $defaultLang);
|
||||
}
|
||||
|
||||
// Set text direction
|
||||
if (in_array($locale, $this->rtlLocales)) {
|
||||
config()->set('app.rtl', true);
|
||||
}
|
||||
|
||||
app()->setLocale($locale);
|
||||
Carbon::setLocale($locale);
|
||||
return $next($request);
|
||||
|
Reference in New Issue
Block a user