/** * @param Section $section * @return StackCategory */ public static function getCategoryFromMultilingualSection(Section $section) { $sc = null; if ($section->isDefaultMultilingualSection()) { return static::getFromDefaultMultilingualSection(); } else { // we find the stack category located at /paths/locale $text = Core::make('helper/text'); $locale = $section->getLocale(); $path = STACKS_PAGE_PATH . '/' . $locale; $page = \Page::getByPath($path); if (is_object($page) && !$page->isError()) { $sc = new StackCategory($page); } } return $sc; }