mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Add Localization Helper
This commit is contained in:
parent
0c654f5e43
commit
5cb5b5277d
1 changed files with 18 additions and 0 deletions
18
app/Util/Localization/Localization.php
Normal file
18
app/Util/Localization/Localization.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Util\Localization;
|
||||||
|
|
||||||
|
use Cache;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
|
||||||
|
class Localization {
|
||||||
|
|
||||||
|
public static function languages()
|
||||||
|
{
|
||||||
|
return Cache::remember('core:localization:languages', now()->addDays(14), function() {
|
||||||
|
$dir = resource_path('lang');
|
||||||
|
return Arr::flatten(array_diff(scandir($dir), array('..', '.', 'vendor')));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue