mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-02-23 07:01:24 +01:00
Fix getting the site languages
This commit is contained in:
@@ -594,6 +594,11 @@ class Admin
|
||||
return $page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the languages available in the admin
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function adminLanguages()
|
||||
{
|
||||
$languages = [];
|
||||
@@ -604,6 +609,22 @@ class Admin
|
||||
return $languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the languages available in the site
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function siteLanguages()
|
||||
{
|
||||
$languages = [];
|
||||
$lang_data = Grav::instance()['config']->get('system.languages.supported', []);
|
||||
|
||||
foreach ($lang_data as $index => $lang) {
|
||||
$languages[$lang] = LanguageCodes::getNativeName($lang);
|
||||
}
|
||||
return $languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static helper method to return current route.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user