/** * @param Form $form */ protected function determineLocaleField(Form $form) { if (locale_count() > 1) { $locales = []; foreach (locales() as $locale) { $locales[$locale] = trans('general.' . $locale); } $form->addAfter('type', 'locale', 'select', ['inline' => true, 'choices' => $locales, 'selected' => env('REACTOR_LOCALE')]); } }
/** * Checks if the node can have more translations * * @return bool */ public function canHaveMoreTranslations() { return locale_count() > count($this->translations); }