diff --git a/modules/cms/controllers/Index.php b/modules/cms/controllers/Index.php index 094fdb7a92..a99cd8e7f1 100644 --- a/modules/cms/controllers/Index.php +++ b/modules/cms/controllers/Index.php @@ -134,7 +134,7 @@ public function index() $this->bodyClass = 'compact-container'; $this->pageTitle = 'cms::lang.cms.menu_label'; - $this->pageTitleTemplate = '%s '.trans($this->pageTitle); + $this->pageTitleTemplate = '%s '.Lang::get($this->pageTitle); if (Request::ajax() && Request::input('formWidgetAlias')) { $this->bindFormWidgetToController(); @@ -380,7 +380,7 @@ public function onGetTemplateList() public function onExpandMarkupToken() { if (!$alias = post('tokenName')) { - throw new ApplicationException(trans('cms::lang.component.no_records')); + throw new ApplicationException(Lang::get('cms::lang.component.no_records')); } // Can only expand components at this stage @@ -389,15 +389,15 @@ public function onExpandMarkupToken() } if (!($names = (array) post('component_names')) || !($aliases = (array) post('component_aliases'))) { - throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias])); + throw new ApplicationException(Lang::get('cms::lang.component.not_found', ['name' => $alias])); } if (($index = array_get(array_flip($aliases), $alias, false)) === false) { - throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias])); + throw new ApplicationException(Lang::get('cms::lang.component.not_found', ['name' => $alias])); } if (!$componentName = array_get($names, $index)) { - throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $alias])); + throw new ApplicationException(Lang::get('cms::lang.component.not_found', ['name' => $alias])); } $manager = ComponentManager::instance(); @@ -556,7 +556,7 @@ protected function canResetTemplate($template) protected function validateRequestTheme() { if ($this->theme->getDirName() != Request::input('theme')) { - throw new ApplicationException(trans('cms::lang.theme.edit.not_match')); + throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_match')); } } @@ -576,7 +576,7 @@ protected function resolveTypeClassName($type) ]; if (!array_key_exists($type, $types)) { - throw new ApplicationException(trans('cms::lang.template.invalid_type')); + throw new ApplicationException(Lang::get('cms::lang.template.invalid_type')); } return $types[$type]; @@ -593,7 +593,7 @@ protected function loadTemplate($type, $path) $class = $this->resolveTypeClassName($type); if (!($template = call_user_func([$class, 'load'], $this->theme, $path))) { - throw new ApplicationException(trans('cms::lang.template.not_found')); + throw new ApplicationException(Lang::get('cms::lang.template.not_found')); } /** @@ -628,7 +628,7 @@ protected function createTemplate($type) $class = $this->resolveTypeClassName($type); if (!($template = $class::inTheme($this->theme))) { - throw new ApplicationException(trans('cms::lang.template.not_found')); + throw new ApplicationException(Lang::get('cms::lang.template.not_found')); } return $template; @@ -645,7 +645,7 @@ protected function getTabTitle($type, $template) if ($type === 'page') { $result = $template->title ?: $template->getFileName(); if (!$result) { - $result = trans('cms::lang.page.new'); + $result = Lang::get('cms::lang.page.new'); } return $result; @@ -654,7 +654,7 @@ protected function getTabTitle($type, $template) if ($type === 'partial' || $type === 'layout' || $type === 'content' || $type === 'asset') { $result = in_array($type, ['asset', 'content']) ? $template->getFileName() : $template->getBaseFileName(); if (!$result) { - $result = trans('cms::lang.'.$type.'.new'); + $result = Lang::get('cms::lang.'.$type.'.new'); } return $result; @@ -681,7 +681,7 @@ protected function makeTemplateFormWidget($type, $template, $alias = null) ]; if (!array_key_exists($type, $formConfigs)) { - throw new ApplicationException(trans('cms::lang.template.not_found')); + throw new ApplicationException(Lang::get('cms::lang.template.not_found')); } $widgetConfig = $this->makeConfig($formConfigs[$type]); @@ -708,12 +708,12 @@ protected function upgradeSettings($settings, $prevSettings) if ($componentProperties !== null) { if ($componentNames === null || $componentAliases === null) { - throw new ApplicationException(trans('cms::lang.component.invalid_request')); + throw new ApplicationException(Lang::get('cms::lang.component.invalid_request')); } $count = count($componentProperties); if (count($componentNames) != $count || count($componentAliases) != $count) { - throw new ApplicationException(trans('cms::lang.component.invalid_request')); + throw new ApplicationException(Lang::get('cms::lang.component.invalid_request')); } for ($index = 0; $index < $count; $index++) {