]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Middleware/Localization.php
Show users link in top nav if user is signed in and only manages users
[bookstack] / app / Http / Middleware / Localization.php
index bdbf6ccbd9c57832cb29c560770900683e5c7938..528ff40478dbeb92f436ee747b0cb9f07b9071d8 100644 (file)
@@ -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);