1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-17 03:51:06 +01:00
openstamanager/app/helpers.php
2021-04-12 09:46:50 +02:00

24 lines
397 B
PHP

<?php
/**
* Gets the current locale.
*/
function locale(): string
{
$locale = app()->getLocale();
$dot = strpos($locale, '.');
return substr($locale, 0, $dot === false ? null : $dot);
}
/**
* Get the language portion of the locale.
* (ex. en_GB returns en).
*/
function localeLanguage(): string
{
$locale = locale();
return substr($locale, 0, strpos($locale, '_'));
}