/** * 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); }); }
/** * Prepares the list data */ public function prepareLocaleVars() { $this->vars['defaultLocale'] = $this->defaultLocale; $this->vars['locales'] = Locale::listAvailable(); $this->vars['field'] = $this->makeRenderFormField(); }