Mcamara\LaravelLocalization\LaravelLocalization::getCurrentLocaleDirection PHP Method

getCurrentLocaleDirection() public method

Returns current locale direction
public getCurrentLocaleDirection ( ) : string
return string current locale direction
    public function getCurrentLocaleDirection()
    {
        if (!empty($this->supportedLocales[$this->getCurrentLocale()]['dir'])) {
            return $this->supportedLocales[$this->getCurrentLocale()]['dir'];
        }
        switch ($this->getCurrentLocaleScript()) {
            // Other (historic) RTL scripts exist, but this list contains the only ones in current use.
            case 'Arab':
            case 'Hebr':
            case 'Mong':
            case 'Tfng':
            case 'Thaa':
                return 'rtl';
            default:
                return 'ltr';
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Returns current locale direction
  *
  * @return string current locale direction
  * @static 
  */
 public static function getCurrentLocaleDirection()
 {
     return \Mcamara\LaravelLocalization\LaravelLocalization::getCurrentLocaleDirection();
 }