listAvailable() public static method

Lists available locales, used on the back-end.
public static listAvailable ( ) : array
return array
Exemplo n.º 1
0
 /**
  * Removes localized content files from templates collection
  * @param \October\Rain\Database\Collection $templates
  * @return \October\Rain\Database\Collection
  */
 public function pruneTranslatedContentTemplates($templates)
 {
     $locales = LocaleModel::listAvailable();
     $extensions = array_map(function ($ext) {
         return '.' . $ext;
     }, array_keys($locales));
     return $templates->filter(function ($template) use($extensions) {
         return !Str::endsWith($template->getBaseFileName(), $extensions);
     });
 }
Exemplo n.º 2
0
 /**
  * Prepares the list data
  */
 public function prepareLocaleVars()
 {
     $this->vars['defaultLocale'] = $this->defaultLocale;
     $this->vars['locales'] = Locale::listAvailable();
     $this->vars['field'] = $this->makeRenderFormField();
 }