Browse Source

Move breadcrumb transliteration from models to page templates

Visman 3 năm trước cách đây
mục cha
commit
64b259f6ae
42 tập tin đã thay đổi với 142 bổ sung187 xóa
  1. 20 12
      app/Models/Page.php
  2. 3 6
      app/Models/Pages/Admin.php
  3. 2 5
      app/Models/Pages/Admin/Bans.php
  4. 2 5
      app/Models/Pages/Admin/Categories.php
  5. 5 11
      app/Models/Pages/Admin/Forums.php
  6. 5 11
      app/Models/Pages/Admin/Groups.php
  7. 10 15
      app/Models/Pages/Admin/Logs.php
  8. 9 7
      app/Models/Pages/Admin/Parser/BBCode.php
  9. 1 4
      app/Models/Pages/Admin/Parser/Smilies.php
  10. 3 12
      app/Models/Pages/Admin/Statistics.php
  11. 10 16
      app/Models/Pages/Admin/Users/Action.php
  12. 3 6
      app/Models/Pages/Admin/Users/NewUser.php
  13. 2 2
      app/Models/Pages/Admin/Users/Result.php
  14. 1 1
      app/Models/Pages/Admin/Users/Stat.php
  15. 1 1
      app/Models/Pages/Delete.php
  16. 1 1
      app/Models/Pages/Edit.php
  17. 1 1
      app/Models/Pages/Email.php
  18. 14 14
      app/Models/Pages/Moderate.php
  19. 4 4
      app/Models/Pages/PM/AbstractPM.php
  20. 3 9
      app/Models/Pages/PM/PMBlock.php
  21. 1 4
      app/Models/Pages/PM/PMConfig.php
  22. 1 1
      app/Models/Pages/PM/PMDelete.php
  23. 1 1
      app/Models/Pages/PM/PMEdit.php
  24. 2 8
      app/Models/Pages/PM/PMPost.php
  25. 1 4
      app/Models/Pages/PM/PMTopic.php
  26. 1 1
      app/Models/Pages/PM/PMView.php
  27. 2 2
      app/Models/Pages/Post.php
  28. 2 2
      app/Models/Pages/Profile.php
  29. 1 1
      app/Models/Pages/Profile/Config.php
  30. 1 1
      app/Models/Pages/Profile/Edit.php
  31. 2 2
      app/Models/Pages/Profile/Email.php
  32. 2 2
      app/Models/Pages/Profile/Mod.php
  33. 2 2
      app/Models/Pages/Profile/Pass.php
  34. 1 1
      app/Models/Pages/Report.php
  35. 3 3
      app/Models/Pages/Rules.php
  36. 4 4
      app/Models/Pages/Search.php
  37. 1 1
      app/Models/Pages/Userlist.php
  38. 3 0
      app/lang/en/common.po
  39. 3 0
      app/lang/ru/common.po
  40. 4 0
      app/templates/forum.forkbb.php
  41. 3 3
      app/templates/layouts/crumbs.forkbb.php
  42. 1 1
      app/templates/topic_in_search.forkbb.php

+ 20 - 12
app/Models/Page.php

@@ -476,9 +476,16 @@ abstract class Page extends Model
             // модель
             if ($crumb instanceof Model) {
                 do {
-                    $name     = $crumb->name ?? '<no name>';
-                    $result[] = [$crumb, $name, $active];
-                    $active   = null;
+                    $name = $crumb->name ?? '<no name>';
+
+                    if (\is_array($name)) {
+                        $result[] = [$crumb, $name, $active];
+                    } else {
+                        $result[] = [$crumb, ['%s', $name], $active];
+                    }
+
+                    $active = null;
+                    $name   = __($name);
 
                     if ($crumb->page > 1) {
                         $name .= __([' Page %s', $crumb->page]);
@@ -486,23 +493,24 @@ abstract class Page extends Model
 
                     $this->titles = $name;
                     $crumb        = $crumb->parent;
-                } while ($crumb instanceof Model && null !== $crumb->parent);
+                } while (
+                    $crumb instanceof Model
+                    && null !== $crumb->parent
+                );
             // ссылка (передана массивом)
-            } elseif (
-                \is_array($crumb)
-                && isset($crumb[0], $crumb[1])
-            ) {
-                $result[]     = [$crumb[0], (string) $crumb[1], $active];
-                $this->titles = $crumb[1];
+            } elseif (\is_array($crumb)) {
+                $result[]     = [$crumb[0], $crumb[1], $active];
+                $this->titles = __($crumb[1]);
             // строка
             } else {
                 $result[]     = [null, (string) $crumb, $active];
-                $this->titles = (string) $crumb;
+                $this->titles = __((string) $crumb);
             }
+
             $active = null;
         }
         // главная страница
-        $result[] = [$this->c->Router->link('Index'), __('Index'), $active];
+        $result[] = [$this->c->Router->link('Index'), 'Index', $active];
 
         return \array_reverse($result);
     }

+ 3 - 6
app/Models/Pages/Admin.php

@@ -97,16 +97,13 @@ abstract class Admin extends Page
     {
         if ('index' !== $this->aIndex) {
             if (isset($this->aNavigation[$this->aIndex])) {
-                $crumbs[] = [
-                    $this->aNavigation[$this->aIndex][0],
-                    __($this->aNavigation[$this->aIndex][1]),
-                ];
+                $crumbs[] = $this->aNavigation[$this->aIndex];
             } else {
-                $crumbs[] = 'unknown';
+                $crumbs[] = [null, ['%s', 'unknown']];
             }
         }
 
-        $crumbs[] = [$this->c->Router->link('Admin'), __('Admin title')];
+        $crumbs[] = [$this->c->Router->link('Admin'), 'Admin title'];
 
         return parent::crumbs(...$crumbs);
     }

+ 2 - 5
app/Models/Pages/Admin/Bans.php

@@ -389,7 +389,7 @@ class Bans extends Admin
                     'data' => $args['data'],
                 ]
             ),
-            __('Results head'),
+            'Results head',
         ];
         $this->formResult = $this->form($banList, $startNum, $args);
         $this->pagination = $this->c->Func->paginate(
@@ -719,10 +719,7 @@ class Bans extends Admin
             }
         }
 
-        $this->aCrumbs[] = [
-            $this->c->Router->link($this->formBanPage, $args),
-            __($this->formBanSubHead),
-        ];
+        $this->aCrumbs[] = [$this->c->Router->link($this->formBanPage, $args), $this->formBanSubHead];
         $this->formBan   = $this->formBan($data, $args);
 
         return $this;

+ 2 - 5
app/Models/Pages/Admin/Categories.php

@@ -178,11 +178,8 @@ class Categories extends Admin
 
         $this->nameTpl   = 'admin/form';
         $this->aIndex    = 'categories';
-        $this->aCrumbs[] = [
-            $this->c->Router->link('AdminCategoriesDelete', $args),
-            __('Delete category head'),
-        ];
-        $this->aCrumbs[] = __(['"%s"', $category['cat_name']]);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminCategoriesDelete', $args), 'Delete category head'];
+        $this->aCrumbs[] = [null, ['"%s"', $category['cat_name']]];
         $this->form      = $this->formDelete($args, $category);
         $this->classForm = ['deletecategory'];
         $this->titleForm = 'Delete category head';

+ 5 - 11
app/Models/Pages/Admin/Forums.php

@@ -269,9 +269,9 @@ class Forums extends Admin
                     'id' => $forum->id,
                 ]
             ),
-            __('Delete forum head'),
+            'Delete forum head',
         ];
-        $this->aCrumbs[] = __(['"%s"', $forum->forum_name]);
+        $this->aCrumbs[] = [null, ['"%s"', $forum->forum_name]];
         $this->form      = $this->formDelete($args, $forum);
         $this->classForm = ['deleteforum'];
         $this->titleForm = 'Delete forum head';
@@ -336,20 +336,14 @@ class Forums extends Admin
         if (empty($args['id'])) {
             $forum           = $this->c->forums->create();
             $marker          = 'AdminForumsNew';
-            $this->aCrumbs[] = [
-                $this->c->Router->link($marker),
-                __('Add forum head'),
-            ];
+            $this->aCrumbs[] = [$this->c->Router->link($marker), 'Add forum head'];
             $this->titleForm = 'Add forum head';
             $this->classForm = ['createforum'];
         } else {
             $forum           = $this->c->forums->loadTree($args['id']); //?????
             $marker          = 'AdminForumsEdit';
-            $this->aCrumbs[] = [
-                $this->c->Router->link($marker, $args),
-                __('Edit forum head'),
-            ];
-            $this->aCrumbs[] = __(['"%s"', $forum->forum_name]);
+            $this->aCrumbs[] = [$this->c->Router->link($marker, $args), 'Edit forum head'];
+            $this->aCrumbs[] = [null, ['"%s"', $forum->forum_name]];
             $this->titleForm = 'Edit forum head';
             $this->classForm = ['editforum'];
         }

+ 5 - 11
app/Models/Pages/Admin/Groups.php

@@ -203,11 +203,8 @@ class Groups extends Admin
             $marker          = 'AdminGroupsEdit';
             $vars            = ['id' => $group->g_id];
             $notNext        .= ',' . $group->g_id;
-            $this->aCrumbs[] = [
-                $this->c->Router->link($marker, $vars),
-                __('Edit group'),
-            ];
-            $this->aCrumbs[] = __(['"%s"', $group->g_title]);
+            $this->aCrumbs[] = [$this->c->Router->link($marker, $vars), 'Edit group'];
+            $this->aCrumbs[] = [null, ['"%s"', $group->g_title]];
             $this->titleForm = 'Edit group';
             $this->classForm = ['editgroup'];
         } else {
@@ -215,7 +212,7 @@ class Groups extends Admin
             $vars            = ['base' => $group->g_id];
             $group->g_title  = '';
             $group->g_id     = null;
-            $this->aCrumbs[] = __('Create new group');
+            $this->aCrumbs[] = 'Create new group';
             $this->titleForm = 'Create new group';
             $this->classForm = ['creategroup'];
         }
@@ -811,11 +808,8 @@ class Groups extends Admin
 
 
         $this->nameTpl   = 'admin/form';
-        $this->aCrumbs[] = [
-            $this->c->Router->link('AdminGroupsDelete', $args),
-            __('Group delete'),
-        ];
-        $this->aCrumbs[] = __(['"%s"', $group->g_title]);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminGroupsDelete', $args), 'Group delete'];
+        $this->aCrumbs[] = [null, ['"%s"', $group->g_title]];
         $this->form      = $this->formDelete($args, $group, $count, $groups);
         $this->titleForm = 'Group delete';
         $this->classForm = ['deletegroup'];

+ 10 - 15
app/Models/Pages/Admin/Logs.php

@@ -130,14 +130,11 @@ class Logs extends Admin
             return $this->c->Redirect->page('AdminLogs')->message('Failed to delete log redirect');
         }
 
-        $this->nameTpl    = 'admin/form';
-        $this->titleForm  = 'Delete log head';
-        $this->classForm  = ['logdel'];
-        $this->form       = $this->formDelete($path, $args);
-        $this->aCrumbs[]  = [
-            $this->c->Router->link('AdminLogsAction', $args),
-            __('Delete log head'),
-        ];
+        $this->nameTpl   = 'admin/form';
+        $this->titleForm = 'Delete log head';
+        $this->classForm = ['logdel'];
+        $this->form      = $this->formDelete($path, $args);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminLogsAction', $args), 'Delete log head'];
 
         return $this;
     }
@@ -171,15 +168,13 @@ class Logs extends Admin
         foreach ($data as &$cur) {
             $cur['context'] = \print_r($cur['context'], true);
         }
+
         unset($cur);
 
-        $this->nameTpl    = 'admin/logs';
-        $this->logData    = $data;
-        $this->logName    = $this->c->LogViewer->getName($path);
-        $this->aCrumbs[]  = [
-            $this->c->Router->link('AdminLogsAction', $args),
-            __(['Log %s', $this->logName]),
-        ];
+        $this->nameTpl   = 'admin/logs';
+        $this->logData   = $data;
+        $this->logName   = $this->c->LogViewer->getName($path);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminLogsAction', $args), ['Log %s', $this->logName]];
 
         return $this;
     }

+ 9 - 7
app/Models/Pages/Admin/Parser/BBCode.php

@@ -104,7 +104,7 @@ class BBCode extends Parser
         }
 
         $this->nameTpl   = 'admin/form';
-        $this->aCrumbs[] = [$this->AdminBBCodeUrl, __('BBCode management')];
+        $this->aCrumbs[] = [$this->AdminBBCodeUrl, 'BBCode management'];
         $this->form      = $this->formView();
         $this->titleForm = 'BBCode head';
         $this->classForm = ['bbcode'];
@@ -264,9 +264,9 @@ class BBCode extends Parser
         $this->titleForm = 'Delete bbcode head';
         $this->form      = $this->formDelete($args, $formAction, $tagData['bb_tag']);
 
-        $this->aCrumbs[] = [$formAction, __($this->titleForm)];
-        $this->aCrumbs[] = __(['"%s"', $tagData['bb_tag']]);
-        $this->aCrumbs[] = [$this->AdminBBCodeUrl, __('BBCode management')];
+        $this->aCrumbs[] = [$formAction, $this->titleForm];
+        $this->aCrumbs[] = [null, ['"%s"', $tagData['bb_tag']]];
+        $this->aCrumbs[] = [$this->AdminBBCodeUrl, 'BBCode management'];
 
         return $this;
     }
@@ -423,11 +423,13 @@ class BBCode extends Parser
                 $this->fIswev = $v->getErrors();
         }
 
-        $this->aCrumbs[] = [$this->formAction, __($title)];
+        $this->aCrumbs[] = [$this->formAction, $title];
+
         if ($id > 0) {
-            $this->aCrumbs[] = __(['"%s"', $this->c->bbcode->bbcodeTable[$id]['bb_tag']]);
+            $this->aCrumbs[] = [null, ['"%s"', $this->c->bbcode->bbcodeTable[$id]['bb_tag']]];
         }
-        $this->aCrumbs[] = [$this->AdminBBCodeUrl, __('BBCode management')];
+
+        $this->aCrumbs[] = [$this->AdminBBCodeUrl, 'BBCode management'];
         $this->form      = $this->formEdit($id, $structure);
         $this->titleForm = $title;
         $this->classForm = ['editbbcode'];

+ 1 - 4
app/Models/Pages/Admin/Parser/Smilies.php

@@ -120,10 +120,7 @@ class Smilies extends Parser
         }
 
         $this->nameTpl         = 'admin/smilies';
-        $this->aCrumbs[]       = [
-            $this->c->Router->link('AdminSmilies'),
-            __('Smilies management'),
-        ];
+        $this->aCrumbs[]       = [$this->c->Router->link('AdminSmilies'), 'Smilies management'];
         $this->formSmilies     = $this->formSmilies($data);
         $this->formImages      = $this->formImages();
         $this->formUploadImage = $this->formUploadImage();

+ 3 - 12
app/Models/Pages/Admin/Statistics.php

@@ -72,14 +72,8 @@ class Statistics extends Admin
 
         $this->nameTpl    = 'admin/phpinfo';
         $this->mainSuffix = '-one-column';
-        $this->aCrumbs[]  = [
-            $this->c->Router->link('AdminInfo'),
-            'phpinfo()',
-        ];
-        $this->aCrumbs[]  = [
-            $this->c->Router->link('AdminStatistics'),
-            __('Server statistics'),
-        ];
+        $this->aCrumbs[]  = [$this->c->Router->link('AdminInfo'), ['%s', 'phpinfo()']];
+        $this->aCrumbs[]  = [$this->c->Router->link('AdminStatistics'), 'Server statistics'];
         $this->phpinfo    = $phpinfo;
 
         return $this;
@@ -111,10 +105,7 @@ class Statistics extends Admin
         $this->c->Lang->load('admin_index');
 
         $this->nameTpl   = 'admin/statistics';
-        $this->aCrumbs[] = [
-            $this->c->Router->link('AdminStatistics'),
-            __('Server statistics'),
-        ];
+        $this->aCrumbs[] = [$this->c->Router->link('AdminStatistics'), 'Server statistics'];
         $this->linkInfo  = $this->c->Router->link('AdminInfo');
 
         // Get the server load averages (if possible)

+ 10 - 16
app/Models/Pages/Admin/Users/Action.php

@@ -141,14 +141,11 @@ class Action extends Users
             return $this->c->Redirect->page('AdminUsers')->message('Users delete redirect');
         }
 
-        $this->nameTpl    = 'admin/form';
-        $this->classForm  = ['delete-users'];
-        $this->titleForm  = 'Deleting users';
-        $this->aCrumbs[]  = [
-            $this->c->Router->link('AdminUsersAction', $args),
-            __('Deleting users'),
-        ];
-        $this->form       = $this->formDelete($args);
+        $this->nameTpl   = 'admin/form';
+        $this->classForm = ['delete-users'];
+        $this->titleForm = 'Deleting users';
+        $this->aCrumbs[] = [$this->c->Router->link('AdminUsersAction', $args), 'Deleting users'];
+        $this->form      = $this->formDelete($args);
 
         return $this;
     }
@@ -296,14 +293,11 @@ class Action extends Users
             $this->fIswev = $v->getErrors();
         }
 
-        $this->nameTpl    = 'admin/form';
-        $this->classForm  = ['change-group'];
-        $this->titleForm  = 'Change user group';
-        $this->aCrumbs[]  = [
-            $this->c->Router->link('AdminUsersAction', $args),
-            __('Change user group'),
-        ];
-        $this->form       = $this->formChange($args, $profile, $link, 'absent' !== $rulePass);
+        $this->nameTpl   = 'admin/form';
+        $this->classForm = ['change-group'];
+        $this->titleForm = 'Change user group';
+        $this->aCrumbs[] = [$this->c->Router->link('AdminUsersAction', $args), 'Change user group'];
+        $this->form      = $this->formChange($args, $profile, $link, 'absent' !== $rulePass);
 
         return $this;
     }

+ 3 - 6
app/Models/Pages/Admin/Users/NewUser.php

@@ -73,12 +73,9 @@ class NewUser extends Users
                 $data         = $v->getData();
         }
 
-        $this->nameTpl    = 'admin/users';
-        $this->formNew    = $this->formNew($data);
-        $this->aCrumbs[]  = [
-            $this->c->Router->link('AdminUsersNew'),
-            __('Add user'),
-        ];
+        $this->nameTpl   = 'admin/users';
+        $this->formNew   = $this->formNew($data);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminUsersNew'), 'Add user'];
 
         return $this;
     }

+ 2 - 2
app/Models/Pages/Admin/Users/Result.php

@@ -35,10 +35,10 @@ class Result extends Users
             }
 
             $idsN   = $this->forIP($data['ip']);
-            $crName = $data['ip'];
+            $crName = ['%s', $data['ip']];
         } else {
             $idsN   = $this->forFilter($data);
-            $crName = __('Results head');
+            $crName = 'Results head';
         }
 
         $number = \count($idsN);

+ 1 - 1
app/Models/Pages/Admin/Users/Stat.php

@@ -52,7 +52,7 @@ class Stat extends Users
                     'id' => $args['id'],
                 ]
             ),
-            $user->username,
+            ['%s', $user->username],
         ];
         $this->formResult = $this->form($stat, $startNum);
         $this->pagination = $this->c->Func->paginate(

+ 1 - 1
app/Models/Pages/Delete.php

@@ -75,7 +75,7 @@ class Delete extends Page
         $this->canonical  = $post->linkDelete;
         $this->robots     = 'noindex';
         $this->formTitle  = $deleteTopic ? 'Delete topic' : 'Delete post';
-        $this->crumbs     = $this->crumbs(__($this->formTitle), $topic);
+        $this->crumbs     = $this->crumbs($this->formTitle, $topic);
         $this->posts      = [$post];
         $this->postsTitle = $deleteTopic ? 'Delete topic info' : 'Delete info';
         $this->form       = $this->formDelete($args, $post, $deleteTopic);

+ 1 - 1
app/Models/Pages/Edit.php

@@ -129,7 +129,7 @@ class Edit extends Page
         $this->canonical = $post->linkEdit;
         $this->robots    = 'noindex';
         $this->formTitle = $firstPost ? 'Edit topic' : 'Edit post';
-        $this->crumbs    = $this->crumbs(__($this->formTitle), $topic);
+        $this->crumbs    = $this->crumbs($this->formTitle, $topic);
         $this->form      = $this->messageForm($post, 'EditPost', $args, true, $firstPost, false);
 
         return $this;

+ 1 - 1
app/Models/Pages/Email.php

@@ -125,7 +125,7 @@ class Email extends Page
 
         $this->nameTpl   = 'email';
         $this->robots    = 'noindex';
-        $this->crumbs    = $this->crumbs(__(['Send email to %s', $this->curUser->username]));
+        $this->crumbs    = $this->crumbs([null, ['Send email to %s', $this->curUser->username]]);
         $this->form      = $this->formEmail($args, $data);
 
         return $this;

+ 14 - 14
app/Models/Pages/Moderate.php

@@ -290,8 +290,8 @@ class Moderate extends Page
                 $this->formTitle   = ['Open topic title', $this->numObj];
                 $this->buttonValue = ['Open topic btn', $this->numObj];
                 $this->crumbs      = $this->crumbs(
-                    __($this->formTitle),
-                    __('Moderate'),
+                    [null, $this->formTitle],
+                    'Moderate',
                     $v->topic ? $this->curTopic : $this->curForum
                 );
                 $this->form        = $this->formConfirm($topics, $v);
@@ -317,8 +317,8 @@ class Moderate extends Page
                 $this->formTitle   = ['Close topic title', $this->numObj];
                 $this->buttonValue = ['Close topic btn', $this->numObj];
                 $this->crumbs      = $this->crumbs(
-                    __($this->formTitle),
-                    __('Moderate'),
+                    [null, $this->formTitle],
+                    'Moderate',
                     $v->topic ? $this->curTopic : $this->curForum
                 );
                 $this->form        = $this->formConfirm($topics, $v);
@@ -371,8 +371,8 @@ class Moderate extends Page
                     $this->numObj,
                 ];
                 $this->crumbs      = $this->crumbs(
-                    __($this->formTitle),
-                    __('Moderate'),
+                    [null, $this->formTitle],
+                    'Moderate',
                     $v->topic ? $this->curTopic : $this->curForum
                 );
                 $this->form        = $this->formConfirm($objects, $v);
@@ -404,8 +404,8 @@ class Moderate extends Page
                 $this->formTitle   = ['Move topic title', $this->numObj];
                 $this->buttonValue = ['Move topic btn', $this->numObj];
                 $this->crumbs      = $this->crumbs(
-                    __($this->formTitle),
-                    __('Moderate'),
+                    [null, $this->formTitle],
+                    'Moderate',
                     $v->topic ? $this->curTopic : $this->curForum
                 );
                 $this->chkRedirect = true;
@@ -444,7 +444,7 @@ class Moderate extends Page
             case 1:
                 $this->formTitle   = 'Merge topics title';
                 $this->buttonValue = 'Merge btn';
-                $this->crumbs      = $this->crumbs(__($this->formTitle), __('Moderate'), $this->curForum);
+                $this->crumbs      = $this->crumbs($this->formTitle, 'Moderate', $this->curForum);
                 $this->chkRedirect = true;
                 $this->form        = $this->formConfirm($topics, $v);
 
@@ -469,8 +469,8 @@ class Moderate extends Page
                 $this->formTitle   = ['Unstick topic title', $this->numObj];
                 $this->buttonValue = ['Unstick btn', $this->numObj];
                 $this->crumbs      = $this->crumbs(
-                    __($this->formTitle),
-                    __('Moderate'),
+                    [null, $this->formTitle],
+                    'Moderate',
                     $v->topic ? $this->curTopic : $this->curForum
                 );
                 $this->form        = $this->formConfirm($topics, $v);
@@ -499,8 +499,8 @@ class Moderate extends Page
                 $this->formTitle   = ['Stick topic title', $this->numObj];
                 $this->buttonValue = ['Stick btn', $this->numObj];
                 $this->crumbs      = $this->crumbs(
-                    __($this->formTitle),
-                    __('Moderate'),
+                    [null, $this->formTitle],
+                    'Moderate',
                     $v->topic ? $this->curTopic : $this->curForum
                 );
                 $this->form        = $this->formConfirm($topics, $v);
@@ -529,7 +529,7 @@ class Moderate extends Page
                 $this->formTitle   = 'Split posts title';
                 $this->buttonValue = 'Split btn';
                 $this->needSubject = true;
-                $this->crumbs      = $this->crumbs(__($this->formTitle), __('Moderate'), $this->curTopic);
+                $this->crumbs      = $this->crumbs($this->formTitle, 'Moderate', $this->curTopic);
                 $this->form        = $this->formConfirm($posts, $v);
 
                 return $this;

+ 4 - 4
app/Models/Pages/PM/AbstractPM.php

@@ -142,7 +142,7 @@ abstract class AbstractPM extends Page
             case Cnst::ACTION_CONFIG:
                 break;
             default:
-                $crumbs[] = 'unknown';
+                $crumbs[] = [null, ['%s', 'unknown']];
         }
 
         if ($viewArea) {
@@ -177,7 +177,7 @@ abstract class AbstractPM extends Page
                                 'action' => $pms->area,
                             ]
                         ),
-                        __(['"%s"', $this->targetUser->username]),
+                        ['"%s"', $this->targetUser->username],
                     ];
                 }
 
@@ -196,7 +196,7 @@ abstract class AbstractPM extends Page
                         'action' => $pms->area,
                     ]
                 ),
-                __($m),
+                $m,
             ];
 
             if (null === $this->title) {
@@ -204,7 +204,7 @@ abstract class AbstractPM extends Page
             }
         }
 
-        $crumbs[] = [$this->c->Router->link('PM'), __('PM')];
+        $crumbs[] = [$this->c->Router->link('PM'), 'PM'];
 
         return parent::crumbs(...$crumbs);
     }

+ 3 - 9
app/Models/Pages/PM/PMBlock.php

@@ -32,10 +32,7 @@ class PMBlock extends AbstractPM
     {
         $this->nameTpl    = 'pm/block';
         $this->blockList  = $this->c->pms->block->list;
-        $this->pmCrumbs[] = [
-            $this->c->Router->link('PMAction', $args),
-            __('Blocked users'),
-        ];
+        $this->pmCrumbs[] = [$this->c->Router->link('PMAction', $args), 'Blocked users'];
 
         return $this;
     }
@@ -144,12 +141,9 @@ class PMBlock extends AbstractPM
         $this->form       = $this->formBlock($args, $blockStatus, $blockUser);
         $this->pmCrumbs[] = [
             $this->c->Router->link('PMAction', $args),
-            __([$blockStatus ? 'Unblock user %s crumb' : 'Block user %s crumb', $blockUser->username]),
-        ];
-        $this->pmCrumbs[] = [
-            $this->linkPMBlk,
-            __('Blocked users'),
+            [$blockStatus ? 'Unblock user %s crumb' : 'Block user %s crumb', $blockUser->username],
         ];
+        $this->pmCrumbs[] = [$this->linkPMBlk, 'Blocked users'];
 
         return $this;
     }

+ 1 - 4
app/Models/Pages/PM/PMConfig.php

@@ -63,10 +63,7 @@ class PMConfig extends AbstractPM
         $this->formTitle  = 'PM Config title';
         $this->formClass  = 'pmconfig';
         $this->form       = $this->formConfig($args);
-        $this->pmCrumbs[] = [
-            $this->c->Router->link('PMAction', $args),
-            __('PM Config'),
-        ];
+        $this->pmCrumbs[] = [$this->c->Router->link('PMAction', $args), 'PM Config'];
 
         return $this;
     }

+ 1 - 1
app/Models/Pages/PM/PMDelete.php

@@ -115,7 +115,7 @@ class PMDelete extends AbstractPM
         $this->posts      = [$post];
         $this->pmCrumbs[] = [
             $this->c->Router->link('PMAction', $args),
-            __($deleteTopic ? 'Delete  dialogue' : 'Delete  message'),
+            $deleteTopic ? 'Delete  dialogue' : 'Delete  message',
         ];
         $this->pmCrumbs[] = $topic;
 

+ 1 - 1
app/Models/Pages/PM/PMEdit.php

@@ -87,7 +87,7 @@ class PMEdit extends AbstractPM
         $this->form       = $this->messageFormPM(null, 'PMAction', $args, true, $firstPost, false);
         $this->pmCrumbs[] = [
             $this->c->Router->link('PMAction', $args),
-            __($firstPost ? 'Edit dialogue' : 'Edit message'),
+            $firstPost ? 'Edit dialogue' : 'Edit message',
         ];
         $this->pmCrumbs[] = $topic;
 

+ 2 - 8
app/Models/Pages/PM/PMPost.php

@@ -53,10 +53,7 @@ class PMPost extends AbstractPM
             $this->targetUser = $this->c->users->load($args['more1']);
             $this->newTopic   = true;
             $this->formTitle  = 'New PT title';
-            $this->pmCrumbs[] = [
-                $this->c->Router->link('PMAction', $args),
-                __('New dialogue'),
-            ];
+            $this->pmCrumbs[] = [$this->c->Router->link('PMAction', $args), 'New dialogue'];
             $topic            = $this->pms->create(Cnst::PTOPIC);
             $topic->sender    = $this->user;
             $topic->recipient = $this->targetUser;
@@ -72,10 +69,7 @@ class PMPost extends AbstractPM
             $this->pms->area  = $this->pms->inArea($topic);
             $this->newTopic   = false;
             $this->formTitle  = Cnst::ACTION_ARCHIVE === $this->pms->area ? 'New PM title archive' : 'New PM title';
-            $this->pmCrumbs[] = [
-                $this->c->Router->link('PMAction', $args),
-                __('New message'),
-            ];
+            $this->pmCrumbs[] = [$this->c->Router->link('PMAction', $args), 'New message'];
             $this->pmCrumbs[] = $topic;
         } else {
             return $this->c->Message->message('Not Found', true, 404);

+ 1 - 4
app/Models/Pages/PM/PMTopic.php

@@ -130,10 +130,7 @@ class PMTopic extends AbstractPM
         $this->form       = $this->formSend($args);
         $this->postsTitle = 'Send info';
         $this->posts      = [$this->pms->load(Cnst::PPOST, $this->model->first_post_id)];
-        $this->pmCrumbs[] = [
-            $this->c->Router->link('PMAction', $args),
-            __('Send  dialogue'),
-        ];
+        $this->pmCrumbs[] = [$this->c->Router->link('PMAction', $args), 'Send  dialogue'];
         $this->pmCrumbs[] = $this->model;
 
         return $this;

+ 1 - 1
app/Models/Pages/PM/PMView.php

@@ -67,7 +67,7 @@ class PMView extends AbstractPM
                     $this->form       = $this->formConfirm($v, $this->args);
                     $this->formClass  = 'post';
                     $this->formTitle  = Cnst::PT_ARCHIVE === $this->vStatus ? 'InfoSaveQt' : 'InfoDeleteQt';
-                    $this->pmCrumbs[] = __(Cnst::PT_ARCHIVE === $this->vStatus ? 'InfoSaveQ' : 'InfoDeleteQ');
+                    $this->pmCrumbs[] = Cnst::PT_ARCHIVE === $this->vStatus ? 'InfoSaveQ' : 'InfoDeleteQ';
 
                     return $this;
                 } elseif (1 !== $v->confirm) {

+ 2 - 2
app/Models/Pages/Post.php

@@ -89,7 +89,7 @@ class Post extends Page
         );
         $this->robots    = 'noindex';
         $this->formTitle = 'Post new topic';
-        $this->crumbs    = $this->crumbs(__($this->formTitle), $forum);
+        $this->crumbs    = $this->crumbs($this->formTitle, $forum);
         $this->form      = $this->messageForm($forum, 'NewTopic', $args, false, true, false);
 
         return $this;
@@ -160,7 +160,7 @@ class Post extends Page
         );
         $this->robots     = 'noindex';
         $this->formTitle  = 'Post a reply';
-        $this->crumbs     = $this->crumbs(__($this->formTitle), $topic);
+        $this->crumbs     = $this->crumbs($this->formTitle, $topic);
         $this->form       = $this->messageForm($topic, 'NewReply', $args, false, false, false);
         $this->postsTitle = 'Topic review';
         $this->posts      = $topic->review();

+ 2 - 2
app/Models/Pages/Profile.php

@@ -65,8 +65,8 @@ abstract class Profile extends Page
      */
     protected function crumbs(/* mixed */ ...$crumbs): array
     {
-        $crumbs[] = [$this->curUser->link, __(['User %s', $this->curUser->username])];
-        $crumbs[] = [$this->c->Router->link('Userlist'), __('User list')];
+        $crumbs[] = [$this->curUser->link, ['User %s', $this->curUser->username]];
+        $crumbs[] = [$this->c->Router->link('Userlist'), 'User list'];
 
         return parent::crumbs(...$crumbs);
     }

+ 1 - 1
app/Models/Pages/Profile/Config.php

@@ -110,7 +110,7 @@ class Config extends Profile
         $this->crumbs     = $this->crumbs(
             [
                 $this->c->Router->link('EditUserBoardConfig', $args),
-                __('Board configuration'),
+                'Board configuration',
             ]
         );
         $this->form       = $this->form($args);

+ 1 - 1
app/Models/Pages/Profile/Edit.php

@@ -158,7 +158,7 @@ class Edit extends Profile
         $this->crumbs     = $this->crumbs(
             [
                 $this->c->Router->link('EditUserProfile', $args),
-                __('Editing profile'),
+                'Editing profile',
             ]
         );
         $this->form       = $this->form($args);

+ 2 - 2
app/Models/Pages/Profile/Email.php

@@ -199,11 +199,11 @@ class Email extends Profile
         $this->crumbs     = $this->crumbs(
             [
                 $this->c->Router->link('EditUserEmail', $args),
-                __('Change email'),
+                'Change email',
             ],
             [
                 $this->c->Router->link('EditUserProfile', $args),
-                __('Editing profile'),
+                'Editing profile',
             ]
         );
         $this->form       = $this->form($args);

+ 2 - 2
app/Models/Pages/Profile/Mod.php

@@ -71,11 +71,11 @@ class Mod extends Profile
         $this->crumbs     = $this->crumbs(
             [
                 $this->c->Router->link('EditUserModeration', $args),
-                __('Moderator rights'),
+                'Moderator rights',
             ],
             [
                 $this->c->Router->link('EditUserProfile', $args),
-                __('Editing profile'),
+                'Editing profile',
             ]
         );
         $this->form       = $this->form($args);

+ 2 - 2
app/Models/Pages/Profile/Pass.php

@@ -75,11 +75,11 @@ class Pass extends Profile
         $this->crumbs     = $this->crumbs(
             [
                 $this->c->Router->link('EditUserPass', $args),
-                __('Change pass'),
+                'Change pass',
             ],
             [
                 $this->c->Router->link('EditUserProfile', $args),
-                __('Editing profile'),
+                'Editing profile',
             ]
         );
         $this->form       = $this->form($args);

+ 1 - 1
app/Models/Pages/Report.php

@@ -109,7 +109,7 @@ class Report extends Page
 //        $this->onlinePos = 'forum-' . $forum->id;
 //        $this->canonical = $this->c->Router->link('NewTopic', ['id' => $forum->id]);
         $this->robots    = 'noindex';
-        $this->crumbs    = $this->crumbs(__('Report post'), $topic);
+        $this->crumbs    = $this->crumbs('Report post', $topic);
         $this->form      = $this->formReport($args, $data);
 
         return $this;

+ 3 - 3
app/Models/Pages/Rules.php

@@ -27,7 +27,7 @@ class Rules extends Page
         $this->crumbs     = $this->crumbs(
             [
                 $this->c->Router->link('Rules'),
-                __('Forum rules'),
+                'Forum rules',
             ]
         );
         $this->rules      = $this->c->config->o_rules_message;
@@ -47,10 +47,10 @@ class Rules extends Page
         $this->onlinePos  = 'rules';
         $this->robots     = 'noindex';
         $this->crumbs     = $this->crumbs(
-            __('Forum rules'),
+            'Forum rules',
             [
                 $this->c->Router->link('Register'),
-                __('Register'),
+                'Register',
             ]
         );
         $this->rules      = 1 === $this->c->config->b_rules ? $this->c->config->o_rules_message : __('If no rules');

+ 4 - 4
app/Models/Pages/Search.php

@@ -438,9 +438,9 @@ class Search extends Page
                     $asTopicsList  = false;
                 }
                 if ('*' === $args['author']) {
-                    $model->name   = __(['Search query: %s', $args['keywords']]);
+                    $model->name   = ['Search query: %s', $args['keywords']];
                 } else {
-                    $model->name   = __(['Search query: %1$s and Author: %2$s', $args['keywords'], $args['author']]);
+                    $model->name   = ['Search query: %1$s and Author: %2$s', $args['keywords'], $args['author']];
                 }
                 $model->linkMarker = $advanced ? 'SearchAdvanced' : 'Search';
                 $model->linkArgs   = $args;
@@ -488,7 +488,7 @@ class Search extends Page
                 } else {
                     $list = $model->actionP($action, $forum, $user->id);
                 }
-                $model->name       = __(['Quick search user ' . $action, $user->username]);
+                $model->name       = ['Quick search user ' . $action, $user->username];
                 $model->linkMarker = 'SearchAction';
                 if ($forum->id) {
                     $model->linkArgs = ['action' => $action, 'uid' => $user->id, 'forum' => $forum->id];
@@ -544,7 +544,7 @@ class Search extends Page
      */
     protected function crumbs(/* mixed */ ...$crumbs): array
     {
-        $crumbs[] = [$this->c->Router->link('Search'), __('Search')];
+        $crumbs[] = [$this->c->Router->link('Search'), 'Search'];
 
         return parent::crumbs(...$crumbs);
     }

+ 1 - 1
app/Models/Pages/Userlist.php

@@ -152,7 +152,7 @@ class Userlist extends Page
         $this->crumbs       = $this->crumbs(
             [
                 $this->c->Router->link('Userlist'),
-                __('User list'),
+                'User list',
             ]
         );
         $this->pagination   = $this->c->Func->paginate($pages, $page, 'Userlist', $args);

+ 3 - 0
app/lang/en/common.po

@@ -460,3 +460,6 @@ msgstr "This post is moved from the topic &quot;%s&quot;"
 
 msgid "The search may be case sensitive"
 msgstr "The search may be case sensitive for non-Basic Latin characters."
+
+msgid "%s"
+msgstr "%s"

+ 3 - 0
app/lang/ru/common.po

@@ -462,3 +462,6 @@ msgstr "Это сообщение перенесено из темы &quot;%s&qu
 
 msgid "The search may be case sensitive"
 msgstr "Поиск может быть чувствителен к регистру символов не относящихся к основной латинице."
+
+msgid "%s"
+msgstr "%s"

+ 4 - 0
app/templates/forum.forkbb.php

@@ -56,7 +56,11 @@
     </div>
 @if ($p->topics)
     <section id="fork-forum" class="f-main">
+    @if (\is_array($p->model->name))
+      <h2>{!! __($p->model->name) !!}</h2>
+    @else
       <h2>{{ $p->model->forum_name or $p->model->name }}</h2>
+    @endif
       <div class="f-ftlist">
         <ol class="f-table">
           <li class="f-row f-thead" value="0">

+ 3 - 3
app/templates/layouts/crumbs.forkbb.php

@@ -4,14 +4,14 @@
     @foreach ($p->crumbs as $cur)
         @if (\is_object($cur[0]))
           <li class="f-crumb @if ($cur[0]->is_subscribed) f-subscribed @endif"><!-- inline -->
-            <a class="f-crumb-a @if ($cur[2]) active @endif" href="{{ $cur[0]->link }}">{{ $cur[1] }}</a>
+            <a class="f-crumb-a @if ($cur[2]) active @endif" href="{{ $cur[0]->link }}">{!! __($cur[1]) !!}</a>
           </li><!-- endinline -->
         @else
           <li class="f-crumb"><!-- inline -->
             @if ($cur[0])
-            <a class="f-crumb-a @if ($cur[2]) active @endif" href="{{ $cur[0] }}">{{ $cur[1] }}</a>
+            <a class="f-crumb-a @if ($cur[2]) active @endif" href="{{ $cur[0] }}">{!! __($cur[1]) !!}</a>
             @else
-            <span @if ($cur[2]) class="active" @endif>{{ $cur[1] }}</span>
+            <span @if ($cur[2]) class="active" @endif>{!! __($cur[1]) !!}</span>
             @endif
           </li><!-- endinline -->
         @endif

+ 1 - 1
app/templates/topic_in_search.forkbb.php

@@ -30,7 +30,7 @@
 @endif
     </div>
     <section id="fork-topic-ins" class="f-main">
-      <h2>{{ $p->model->name }}</h2>
+      <h2>{!! __($p->model->name) !!}</h2>
 @foreach ($p->posts as $id => $post)
     @if (empty($post->id) && $iswev = ['e' => [['Message %s was not found in the database', $id]]])
         @include ('layouts/iswev')