mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-19 21:10:49 +01:00
25 lines
340 B
PHP
25 lines
340 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* Gets the current locale.
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
function locale(): string
|
||
|
{
|
||
|
return app()->getLocale();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get the language portion of the locale.
|
||
|
* (ex. en_GB returns en)
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
function localeLanguage(): string
|
||
|
{
|
||
|
$locale = locale();
|
||
|
|
||
|
return substr($locale, 0, strpos($locale, "_"));
|
||
|
}
|