src/Charcoal/Admin/Widget/FormGroupWidget.php
public function languages()
    {
        $currentLocale = $this->translator()->getLocale();
        $languages = [];
        foreach ($this->translator()->locales() as $locale => $localeStruct) {
            /**
             * @see \Charcoal\Admin\Widget\FormSidebarWidget::languages()
             * @see \Charcoal\Property\LangProperty::localeChoices()
             */
            if (isset($localeStruct['name'])) {
                $label = $this->translator()->translation($localeStruct['name']);
            } else {
                $trans = 'locale.'.$locale;
                if ($trans === $this->translator()->translate($trans)) {
                    $label = strtoupper($locale);
                } else {
                    $label = $this->translator()->translation($trans);
                }
            }

            $languages[] = [
                'ident'   => $locale,
                'name'    => $this->translator()->translation($label),
                'current' => ($locale === $currentLocale)
            ];
        }

        return $languages;
    }
public function languages()
    {
        $currentLocale = $this->translator()->getLocale();
        $languages = [];
        foreach ($this->translator()->locales() as $locale => $localeStruct) {
            /**
             * @see \Charcoal\Admin\Widget\FormSidebarWidget::languages()
             * @see \Charcoal\Property\LangProperty::localeChoices()
             */
            if (isset($localeStruct['name'])) {
                $label = $this->translator()->translation($localeStruct['name']);
            } else {
                $trans = 'locale.'.$locale;
                if ($trans === $this->translator()->translate($trans)) {
                    $label = strtoupper($locale);
                } else {
                    $label = $this->translator()->translation($trans);
                }
            }

            $languages[] = [
                'ident'   => $locale,
                'name'    => $this->translator()->translation($label),
                'current' => ($locale === $currentLocale)
            ];
        }

        return $languages;
    }
public function languages ( ) { $ currentLocale = $ this -> translator ( ) -> getLocale ( ) ; $ languages = [ ] ; foreach ( $ this -> translator ( ) -> locales ( ) as $ locale => $ localeStruct ) { /**
             * @see \Charcoal\Admin\Widget\FormSidebarWidget::languages()
             * @see \Charcoal\Property\LangProperty::localeChoices()
             */ if ( isset ( $ localeStruct [ 'name' ] ) ) { $ label = $ this -> translator ( ) -> translation ( $ localeStruct [ 'name' ] ) ; } else { $ trans = 'locale.' . $ locale ; if ( $ trans === $ this -> translator ( ) -> translate ( $ trans ) ) { $ label = strtoupper ( $ locale ) ; } else { $ label = $ this -> translator ( ) -> translation ( $ trans ) ; } } $ languages [ ] = [ 'ident' => $ locale , 'name' => $ this -> translator ( ) -> translation ( $ label ) , 'current' => ( $ locale === $ currentLocale ) ] ; } return $ languages ; }
Retrieve the available languages, formatted for the sidebar language-switcher.

@see    FormSidebarWidget::languages()
@return array
Retrieve the available languages formatted for the sidebar language - switcher .