/** * Registers locales. * * @param LocaleEvent $event */ public function onSystemLocale(LocaleEvent $event) { $event->addMessages(['short' => __('DATE_SHORT'), 'medium' => __('DATE_MEDIUM'), 'long' => __('DATE_LONG'), 'full' => __('DATE_FULL'), 'shortdays' => [__('Mon'), __('Tue'), __('Wed'), __('Thu'), __('Fri'), __('Sat'), __('Sun')], 'longdays' => [__('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'), __('Sunday')], 'shortmonths' => [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')], 'longmonths' => [__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')]], 'date'); }
/** * @Route("/system/locale") * @Response("json") */ public function localeAction() { $this['events']->dispatch('system.locale', $event = new LocaleEvent()); return $event->getMessages(); }