Locale

Introduction

The locale service is a simple class that provides more information on a given locale.

Basic Usage

You can use the locale utility by using the \Anomaly\Streams\Platform\Support\Locale class.

use \Anomaly\Streams\Platform\Support\Locale;

$locale = new Locale('en');

isRtl

The isRtl method returns if the locale is rtl or not.

use \Anomaly\Streams\Platform\Support\Locale;

$locale = new Locale('en');

echo $locale->isRtl();
// false

echo $locale->isRtl('en');
// false

name

The name method returns the translated locale name.

use \Anomaly\Streams\Platform\Support\Locale;

$locale = new Locale('en');

echo $locale->name();
// English

echo $locale->name('en');
// English

name

The name method returns the translated locale name.

use \Anomaly\Streams\Platform\Support\Locale;

$locale = new Locale('en');

echo $locale->name();
// English

echo $locale->name('en');
// English