Visman пре 5 година
родитељ
комит
8eb4b6ea9c
64 измењених фајлова са 1098 додато и 1057 уклоњено
  1. 2 1
      app/Core/Func.php
  2. 2 1
      app/Core/Validator.php
  3. 2 2
      app/Models/Online/Info.php
  4. 7 6
      app/Models/Page.php
  5. 13 12
      app/Models/Pages/Admin.php
  6. 60 59
      app/Models/Pages/Admin/Bans.php
  7. 16 15
      app/Models/Pages/Admin/Categories.php
  8. 11 10
      app/Models/Pages/Admin/Censoring.php
  9. 45 44
      app/Models/Pages/Admin/Forums.php
  10. 84 83
      app/Models/Pages/Admin/Groups.php
  11. 3 2
      app/Models/Pages/Admin/Host.php
  12. 20 19
      app/Models/Pages/Admin/Maintenance.php
  13. 177 176
      app/Models/Pages/Admin/Options.php
  14. 26 25
      app/Models/Pages/Admin/Permissions.php
  15. 10 9
      app/Models/Pages/Admin/Reports.php
  16. 6 5
      app/Models/Pages/Admin/Statistics.php
  17. 12 11
      app/Models/Pages/Admin/Users.php
  18. 19 18
      app/Models/Pages/Admin/Users/Action.php
  19. 10 9
      app/Models/Pages/Admin/Users/NewUser.php
  20. 16 15
      app/Models/Pages/Admin/Users/Result.php
  21. 7 6
      app/Models/Pages/Admin/Users/Stat.php
  22. 38 37
      app/Models/Pages/Admin/Users/View.php
  23. 22 21
      app/Models/Pages/Auth.php
  24. 2 1
      app/Models/Pages/Ban.php
  25. 1 1
      app/Models/Pages/Debug.php
  26. 8 7
      app/Models/Pages/Delete.php
  27. 2 1
      app/Models/Pages/Edit.php
  28. 7 6
      app/Models/Pages/Forum.php
  29. 4 2
      app/Models/Pages/Index.php
  30. 56 55
      app/Models/Pages/Install.php
  31. 3 2
      app/Models/Pages/Maintenance.php
  32. 3 2
      app/Models/Pages/Message.php
  33. 38 37
      app/Models/Pages/Moderate.php
  34. 6 5
      app/Models/Pages/Post.php
  35. 17 16
      app/Models/Pages/PostFormTrait.php
  36. 2 1
      app/Models/Pages/PostValidatorTrait.php
  37. 11 10
      app/Models/Pages/Profile.php
  38. 70 69
      app/Models/Pages/Profile/Config.php
  39. 43 42
      app/Models/Pages/Profile/Edit.php
  40. 11 10
      app/Models/Pages/Profile/Email.php
  41. 6 5
      app/Models/Pages/Profile/Mod.php
  42. 8 7
      app/Models/Pages/Profile/Pass.php
  43. 36 35
      app/Models/Pages/Profile/View.php
  44. 3 2
      app/Models/Pages/Redirect.php
  45. 27 26
      app/Models/Pages/Register.php
  46. 12 11
      app/Models/Pages/Report.php
  47. 8 7
      app/Models/Pages/Rules.php
  48. 42 41
      app/Models/Pages/Search.php
  49. 8 7
      app/Models/Pages/Topic.php
  50. 17 16
      app/Models/Pages/Userlist.php
  51. 0 1
      app/Models/Rules/Profile.php
  52. 0 1
      app/Models/Rules/Users.php
  53. 5 2
      app/Models/Search/ActionP.php
  54. 5 2
      app/Models/Search/ActionT.php
  55. 0 1
      app/Models/Search/Execute.php
  56. 3 6
      app/Models/Search/Index.php
  57. 0 5
      app/Models/Search/Model.php
  58. 1 6
      app/Models/Search/Prepare.php
  59. 0 5
      app/Models/Search/TruncateIndex.php
  60. 6 4
      app/Models/Topic/CalcStat.php
  61. 5 4
      app/Models/User/Model.php
  62. 2 1
      app/Models/Validators/Email.php
  63. 2 1
      app/Models/Validators/Username.php
  64. 10 8
      app/config/defaultBBCode.php

+ 2 - 1
app/Core/Func.php

@@ -3,6 +3,7 @@
 namespace ForkBB\Core;
 
 use ForkBB\Core\Container;
+use function \ForkBB\__;
 
 class Func
 {
@@ -134,7 +135,7 @@ class Func
 //            $pages[] = [null, 1, true];
         } else {
             if ($cur > 0) {
-                $pages[] = [\ForkBB\__($info, $cur, $all), 'info', null];
+                $pages[] = [__($info, $cur, $all), 'info', null];
                 $cur     = \min(\max(1, $cur), $all);
                 if ($cur > 1) {
                     $pages[] = [$this->c->Router->link($marker, ['page' => $cur - 1] + $args), 'prev', null];

+ 2 - 1
app/Core/Validator.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Container;
 use ForkBB\Core\File;
 use ForkBB\Core\Validators;
 use RuntimeException;
+use function \ForkBB\__;
 
 class Validator
 {
@@ -396,7 +397,7 @@ class Validator
             list($type, $error) = $error;
         }
 
-        $this->errors[$type][] = \ForkBB\__($error, [':alias' => \ForkBB\__($alias), ':attr' => $attr]);
+        $this->errors[$type][] = __($error, [':alias' => __($alias), ':attr' => $attr]);
         $this->error           = true;
     }
 

+ 2 - 2
app/Models/Online/Info.php

@@ -18,7 +18,7 @@ class Info extends Method
             return null;
         }
 
-        $this->model->maxNum = $this->c->config->st_max_users;
+        $this->model->maxNum  = $this->c->config->st_max_users;
         $this->model->maxTime = $this->c->config->st_max_users_time;
 
         $info = [];
@@ -42,7 +42,7 @@ class Info extends Method
         $s = 0;
         foreach ($this->model->bots as $bot => $arr) {
             $count = \count($arr);
-            $s += $count;
+            $s    += $count;
             if ($count > 1) {
                 $info[] = '[Bot] ' . $bot . ' (' . $count . ')';
             } else {

+ 7 - 6
app/Models/Page.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models;
 use ForkBB\Core\Container;
 use ForkBB\Models\Model;
 use RuntimeException;
+use function \ForkBB\__;
 
 abstract class Page extends Model
 {
@@ -119,7 +120,7 @@ abstract class Page extends Model
                     || $this->user->messages_new > 0
                 )
             ) { //????
-                $nav['pmsnew'] = ['pmsnew.php', 'PM']; //'<li id="nav"'.((PUN_ACTIVE_PAGE == 'pms_new' || $user['messages_new'] > 0) ? ' class="isactive"' : '').'><a href="pmsnew.php">'.\ForkBB\__('PM').(($user['messages_new'] > 0) ? ' (<span'.((empty($this->c->config->o_pms_flasher) || PUN_ACTIVE_PAGE == 'pms_new') ? '' : ' class="remflasher"' ).'>'.$user['messages_new'].'</span>)' : '').'</a></li>';
+                $nav['pmsnew'] = ['pmsnew.php', 'PM']; //'<li id="nav"'.((PUN_ACTIVE_PAGE == 'pms_new' || $user['messages_new'] > 0) ? ' class="isactive"' : '').'><a href="pmsnew.php">'.__('PM').(($user['messages_new'] > 0) ? ' (<span'.((empty($this->c->config->o_pms_flasher) || PUN_ACTIVE_PAGE == 'pms_new') ? '' : ' class="remflasher"' ).'>'.$user['messages_new'].'</span>)' : '').'</a></li>';
             }
             // New PMS
 
@@ -165,14 +166,14 @@ abstract class Page extends Model
             '1' == $this->c->config->o_maintenance
             && $this->user->isAdmin
         ) {
-            $this->fIswev = ['w', \ForkBB\__('Maintenance mode enabled', $this->c->Router->link('AdminMaintenance'))];
+            $this->fIswev = ['w', __('Maintenance mode enabled', $this->c->Router->link('AdminMaintenance'))];
         }
 
         if (
             $this->user->isAdmMod
             && $this->user->last_report_id < $this->c->reports->lastId()
         ) {
-            $this->fIswev = ['i', \ForkBB\__('New reports', $this->c->Router->link('AdminReports'))];
+            $this->fIswev = ['i', __('New reports', $this->c->Router->link('AdminReports'))];
         }
     }
 
@@ -190,7 +191,7 @@ abstract class Page extends Model
             $titles = $this->titles;
         }
         $titles[] = $this->c->config->o_board_title;
-        return \implode(\ForkBB\__('Title separator'), $titles);
+        return \implode(__('Title separator'), $titles);
     }
 
     /**
@@ -376,7 +377,7 @@ abstract class Page extends Model
                     $active   = null;
 
                     if ($crumb->page > 1) {
-                        $name .= ' ' . \ForkBB\__('Page %s', $crumb->page);
+                        $name .= ' ' . __('Page %s', $crumb->page);
                     }
 
                     $this->titles = $name;
@@ -397,7 +398,7 @@ abstract class Page extends Model
             $active = null;
         }
         // главная страница
-        $result[] = [$this->c->Router->link('Index'), \ForkBB\__('Index'), $active];
+        $result[] = [$this->c->Router->link('Index'), __('Index'), $active];
 
         return \array_reverse($result);
     }

+ 13 - 12
app/Models/Pages/Admin.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages;
 
 use ForkBB\Core\Container;
 use ForkBB\Models\Page;
+use function \ForkBB\__;
 
 class Admin extends Page
 {
@@ -49,30 +50,30 @@ class Admin extends Page
     {
         $r   = $this->c->Router;
         $nav = [
-            'index' => [$r->link('Admin'), \ForkBB\__('Admin index')],
-            'users' => [$r->link('AdminUsers'), \ForkBB\__('Users')],
+            'index' => [$r->link('Admin'), __('Admin index')],
+            'users' => [$r->link('AdminUsers'), __('Users')],
         ];
 
         if ($this->c->userRules->banUsers) {
-            $nav['bans'] = [$r->link('AdminBans'), \ForkBB\__('Bans')];
+            $nav['bans'] = [$r->link('AdminBans'), __('Bans')];
         }
         if (
             $this->user->isAdmin
             || '0' == $this->c->config->o_report_method
             || '2' == $this->c->config->o_report_method
         ) {
-            $nav['reports'] = [$r->link('AdminReports'), \ForkBB\__('Reports')];
+            $nav['reports'] = [$r->link('AdminReports'), __('Reports')];
         }
 
         if ($this->user->isAdmin) {
             $nav += [
-                'options'     => [$r->link('AdminOptions'), \ForkBB\__('Admin options')],
-                'permissions' => [$r->link('AdminPermissions'), \ForkBB\__('Permissions')],
-                'categories'  => [$r->link('AdminCategories'), \ForkBB\__('Categories')],
-                'forums'      => [$r->link('AdminForums'), \ForkBB\__('Forums')],
-                'groups'      => [$r->link('AdminGroups'), \ForkBB\__('User groups')],
-                'censoring'   => [$r->link('AdminCensoring'), \ForkBB\__('Censoring')],
-                'maintenance' => [$r->link('AdminMaintenance'), \ForkBB\__('Maintenance')]
+                'options'     => [$r->link('AdminOptions'), __('Admin options')],
+                'permissions' => [$r->link('AdminPermissions'), __('Permissions')],
+                'categories'  => [$r->link('AdminCategories'), __('Categories')],
+                'forums'      => [$r->link('AdminForums'), __('Forums')],
+                'groups'      => [$r->link('AdminGroups'), __('User groups')],
+                'censoring'   => [$r->link('AdminCensoring'), __('Censoring')],
+                'maintenance' => [$r->link('AdminMaintenance'), __('Maintenance')]
             ];
         }
 
@@ -97,7 +98,7 @@ class Admin extends Page
             }
         }
 
-        $crumbs[] = [$this->c->Router->link('Admin'), \ForkBB\__('Admin title')];
+        $crumbs[] = [$this->c->Router->link('Admin'), __('Admin title')];
 
         return parent::crumbs(...$crumbs);
     }

+ 60 - 59
app/Models/Pages/Admin/Bans.php

@@ -8,6 +8,7 @@ use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
 use ForkBB\Models\User\Model as User;
 use RuntimeException;
+use function \ForkBB\__;
 
 class Bans extends Admin
 {
@@ -78,8 +79,8 @@ class Bans extends Admin
     {
         $this->nameTpl        = 'admin/bans';
         $this->formBanPage    = 'AdminBansNew';
-        $this->formBanHead    = \ForkBB\__('New ban head');
-        $this->formBanSubHead = \ForkBB\__('Add ban subhead');
+        $this->formBanHead    = __('New ban head');
+        $this->formBanSubHead = __('Add ban subhead');
 
         if ('POST' === $method) {
             $v = $this->c->Validator->reset()
@@ -111,12 +112,12 @@ class Bans extends Admin
                 return $this->c->Redirect->page('AdminBansResult', ['data' => $this->encodeData($v->getData())]);
             }
 
-            $this->fIswev = $v->getErrors();
+            $this->fIswev     = $v->getErrors();
             $this->formSearch = $this->formSearch($v->getData());
         } else {
             $this->formSearch = $this->formSearch($data);
             if (empty($data)) {
-                $this->formBan    = $this->formBan();
+                $this->formBan = $this->formBan();
             }
         }
 
@@ -141,7 +142,7 @@ class Bans extends Admin
             'btns'   => [
                 'search' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Submit search'),
+                    'value'     => __('Submit search'),
                     'accesskey' => 's',
                 ],
             ],
@@ -150,7 +151,7 @@ class Bans extends Admin
             'info' => [
                 'info1' => [
                     'type'  => '', //????
-                    'value' => \ForkBB\__('Ban search info'),
+                    'value' => __('Ban search info'),
                 ],
             ],
         ];
@@ -158,25 +159,25 @@ class Bans extends Admin
         $fields['username'] = [
             'type'      => 'text',
             'maxlength' => 25,
-            'caption'   => \ForkBB\__('Username label'),
+            'caption'   => __('Username label'),
             'value'     => $data['username'] ?? null,
         ];
         $fields['ip'] = [
             'type'      => 'text',
             'maxlength' => 40,
-            'caption'   => \ForkBB\__('IP label'),
+            'caption'   => __('IP label'),
             'value'     => $data['ip'] ?? null,
         ];
         $fields['email'] = [
             'type'      => 'text',
             'maxlength' => 80,
-            'caption'   => \ForkBB\__('E-mail label'),
+            'caption'   => __('E-mail label'),
             'value'     => $data['email'] ?? null,
         ];
         $fields['message'] = [
             'type'      => 'text',
             'maxlength' => 255,
-            'caption'   => \ForkBB\__('Message label'),
+            'caption'   => __('Message label'),
             'value'     => $data['message'] ?? null,
         ];
         $fields['between1'] = [
@@ -188,7 +189,7 @@ class Bans extends Admin
             'type'      => 'text',
             'maxlength' => 100,
             'value'     => $data['expire_1'] ?? null,
-            'caption'   => \ForkBB\__('Expire date label'),
+            'caption'   => __('Expire date label'),
         ];
         $fields['expire_2'] = [
             'class'     => 'bend',
@@ -200,7 +201,7 @@ class Bans extends Admin
             'type' => 'endwrap',
         ];
         $form['sets']['filters'] = [
-            'legend' => \ForkBB\__('Ban search subhead'),
+            'legend' => __('Ban search subhead'),
             'fields' => $fields,
         ];
 
@@ -213,21 +214,21 @@ class Bans extends Admin
             'class'   => 'bstart',
             'type'    => 'select',
             'options' => [
-                'id'       => \ForkBB\__('Order by id'),
-                'username' => \ForkBB\__('Order by username'),
-                'ip'       => \ForkBB\__('Order by ip'),
-                'email'    => \ForkBB\__('Order by e-mail'),
-                'expire'   => \ForkBB\__('Order by expire'),
+                'id'       => __('Order by id'),
+                'username' => __('Order by username'),
+                'ip'       => __('Order by ip'),
+                'email'    => __('Order by e-mail'),
+                'expire'   => __('Order by expire'),
             ],
             'value'   => $data['order_by'] ?? 'id',
-            'caption' => \ForkBB\__('Order by label'),
+            'caption' => __('Order by label'),
         ];
         $fields['direction'] = [
             'class'   => 'bend',
             'type'    => 'select',
             'options' => [
-                'ASC'  => \ForkBB\__('Ascending'),
-                'DESC' => \ForkBB\__('Descending'),
+                'ASC'  => __('Ascending'),
+                'DESC' => __('Descending'),
             ],
             'value'   => $data['direction'] ?? 'DESC',
         ];
@@ -235,7 +236,7 @@ class Bans extends Admin
             'type' => 'endwrap',
         ];
         $form['sets']['sorting'] = [
-            'legend' => \ForkBB\__('Search results legend'),
+            'legend' => __('Search results legend'),
             'fields' => $fields,
         ];
 
@@ -261,7 +262,7 @@ class Bans extends Admin
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Submit'),
+                    'value'     => __('Submit'),
                     'accesskey' => 's',
                 ],
             ],
@@ -272,22 +273,22 @@ class Bans extends Admin
             $fields['username'] = [
                 'type'      => $this->banCount < 1 ? 'text' : 'str',
                 'maxlength' => 25,
-                'caption'   => \ForkBB\__('Username label'),
-                'info'      => $this->banCount < 1 ? \ForkBB\__('Username help') : null,
+                'caption'   => __('Username label'),
+                'info'      => $this->banCount < 1 ? __('Username help') : null,
                 'value'     => $data['username'] ?? null,
             ];
             $fields['ip'] = [
                 'type'      => 'text',
                 'maxlength' => 255,
-                'caption'   => \ForkBB\__('IP label'),
-                'info'      => \ForkBB\__('IP help'),
+                'caption'   => __('IP label'),
+                'info'      => __('IP help'),
                 'value'     => $data['ip'] ?? null,
             ];
             $fields['email'] = [
                 'type'      => 'text',
                 'maxlength' => 80,
-                'caption'   => \ForkBB\__('E-mail label'),
-                'info'      => \ForkBB\__('E-mail help'),
+                'caption'   => __('E-mail label'),
+                'info'      => __('E-mail help'),
                 'value'     => $data['email'] ?? null,
             ];
             $form['sets']['ban-attrs'] = [
@@ -300,29 +301,29 @@ class Bans extends Admin
         $fields['message'] = [
             'type'      => 'text',
             'maxlength' => 255,
-            'caption'   => \ForkBB\__('Ban message label'),
-            'info'      => \ForkBB\__('Ban message help'),
+            'caption'   => __('Ban message label'),
+            'info'      => __('Ban message help'),
             'value'     => $data['message'] ?? null,
         ];
         $fields['expire'] = [
             'type'      => 'text',
             'maxlength' => 100,
-            'caption'   => \ForkBB\__('Expire date label'),
-            'info'      => \ForkBB\__('Expire date help'),
+            'caption'   => __('Expire date label'),
+            'info'      => __('Expire date help'),
             'value'     => $data['expire'] ?? null,
         ];
 /*
-        $yn     = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
+        $yn     = [1 => __('Yes'), 0 => __('No')];
         $fields['o_default_dst'] = [
             'type'      => 'radio',
             'value'     => $config->o_default_dst,
             'values'    => $yn,
-            'caption'   => \ForkBB\__('DST label'),
-            'info'      => \ForkBB\__('DST help'),
+            'caption'   => __('DST label'),
+            'info'      => __('DST help'),
         ];
 */
         $form['sets']['ban-exp'] = [
-            'legend' => \ForkBB\__('Message expiry subhead'),
+            'legend' => __('Message expiry subhead'),
             'fields' => $fields,
         ];
 
@@ -393,7 +394,7 @@ class Bans extends Admin
 
         $number = \count($idsN);
         if (0 == $number) {
-            $this->fIswev = ['i', \ForkBB\__('No bans found')];
+            $this->fIswev = ['i', __('No bans found')];
             return $this->view([], 'GET', $data);
         }
 
@@ -410,7 +411,7 @@ class Bans extends Admin
 
         $this->nameTpl    = 'admin/bans_result';
         $this->mainSuffix = '-one-column';
-        $this->aCrumbs[]  = [$this->c->Router->link('AdminBansResult', ['data' => $args['data']]), \ForkBB\__('Results head')];
+        $this->aCrumbs[]  = [$this->c->Router->link('AdminBansResult', ['data' => $args['data']]), __('Results head')];
         $this->formResult = $this->form($banList, $startNum, $args);
         $this->pagination = $this->c->Func->paginate($pages, $page, 'AdminBansResult', ['data' => $args['data']]);
 
@@ -460,13 +461,13 @@ class Bans extends Admin
             $fields["l{$number}-username"] = [
                 'class'   => '' == $ban['username'] ? ['result', 'username', 'no-data'] : ['result', 'username'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results username head'),
+                'caption' => __('Results username head'),
                 'value'   => $ban['username'],
             ];
             $fields["l{$number}-email"] = [
                 'class'   => '' == $ban['email'] ? ['result', 'email', 'no-data'] : ['result', 'email'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results e-mail head'),
+                'caption' => __('Results e-mail head'),
                 'value'   => $ban['email'],
             ];
             $fields[] = [
@@ -475,25 +476,25 @@ class Bans extends Admin
             $fields["l{$number}-ips"] = [
                 'class'   => '' == $ban['ip'] ? ['result', 'ips', 'no-data'] : ['result', 'ips'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results IP address head'),
+                'caption' => __('Results IP address head'),
                 'value'   => $ban['ip'],
             ];
             $fields["l{$number}-expire"] = [
                 'class'   => empty($ban['expire']) ? ['result', 'expire', 'no-data'] : ['result', 'expire'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results expire head'),
+                'caption' => __('Results expire head'),
                 'value'   => empty($ban['expire']) ? '' : \ForkBB\dt($ban['expire'], true),
             ];
             $fields["l{$number}-message"] = [
                 'class'   => '' == $ban['message'] ? ['result', 'message', 'no-data'] : ['result', 'message'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results message head'),
+                'caption' => __('Results message head'),
                 'value'   => $ban['message'],
             ];
             $fields["l{$number}-creator"] = [
                 'class'   => ['result', 'creator'],
                 'type'    => '1' == $this->c->user->g_view_users && $ban['id_creator'] > 1 ? 'link' : 'str',
-                'caption' => \ForkBB\__('Results banned by head'),
+                'caption' => __('Results banned by head'),
                 'value'   => $ban['name_creator'],
                 'href'    => $this->c->Router->link('User', ['id' => $ban['id_creator'], 'name' => $ban['name_creator'],]), // ????
             ];
@@ -512,16 +513,16 @@ class Bans extends Admin
                 'class'   => ['result', 'btn-edit'],
                 'type'    => $ban['id'] > 0 ? 'btn' : 'str',
                 'value'   => '✎',
-                'caption' => \ForkBB\__('Results actions head'),
-                'title'   => \ForkBB\__('Edit'),
+                'caption' => __('Results actions head'),
+                'title'   => __('Edit'),
                 'link'    => $this->c->Router->link('AdminBansEdit', $arr),
             ];
             $fields["delete-btn{$number}"] = [
                 'class'   => ['result', 'btn-delete'],
                 'type'    => $ban['id'] > 0 ? 'btn' : 'str',
                 'value'   => '❌',
-                'caption' => \ForkBB\__('Results actions head'),
-                'title'   => \ForkBB\__('Delete'),
+                'caption' => __('Results actions head'),
+                'title'   => __('Delete'),
                 'link'    => $this->c->Router->link('AdminBansDelete', [
                     'id'    => $ban['id'],
                     'token' => $this->c->Csrf->create('AdminBansDelete', $arr),
@@ -580,7 +581,7 @@ class Bans extends Admin
 
             foreach ($userList as $user) {
                 if ($this->c->bans->isBanned($user)) {
-                    return $this->c->Message->message(\ForkBB\__('User is ban', $user->username));
+                    return $this->c->Message->message(__('User is ban', $user->username));
                 }
 
                 if ($this->c->userRules->canBanUser($user)) {
@@ -588,9 +589,9 @@ class Bans extends Admin
                 }
 
                 if ($user->isAdmin) {
-                    return $this->c->Message->message(\ForkBB\__('User is admin message', $user->username));
+                    return $this->c->Message->message(__('User is admin message', $user->username));
                 } elseif ($user->isAdmMod) {
-                    return $this->c->Message->message(\ForkBB\__('User is mod message', $user->username));
+                    return $this->c->Message->message(__('User is mod message', $user->username));
                 } elseif ($user->isGuest) { // ???? O_o
                     return $this->c->Message->message('Cannot ban guest message');
                 }
@@ -599,8 +600,8 @@ class Bans extends Admin
 
         $this->nameTpl        = 'admin/bans';
         $this->formBanPage    = 'AdminBansNew';
-        $this->formBanHead    = \ForkBB\__('New ban head');
-        $this->formBanSubHead = \ForkBB\__('Add ban subhead');
+        $this->formBanHead    = __('New ban head');
+        $this->formBanSubHead = __('Add ban subhead');
 
         return $this->ban(true, $args, $method, $userList);
     }
@@ -632,8 +633,8 @@ class Bans extends Admin
 
         $this->nameTpl        = 'admin/bans';
         $this->formBanPage    = 'AdminBansEdit';
-        $this->formBanHead    = \ForkBB\__('Edit ban head');
-        $this->formBanSubHead = \ForkBB\__('Edit ban subhead');
+        $this->formBanHead    = __('Edit ban head');
+        $this->formBanSubHead = __('Edit ban subhead');
 
         return $this->ban(false, $args, $method, $userList, $ban);
     }
@@ -770,14 +771,14 @@ class Bans extends Admin
             if (! $user instanceof User) { // ???? может ли вернутся несколько юзеров?
                 $v->addError('No user message');
             } elseif ($this->c->bans->isBanned($user)) {
-                $v->addError(\ForkBB\__('User is ban', $user->username));
+                $v->addError(__('User is ban', $user->username));
             } elseif (! $this->c->userRules->canBanUser($user)) {
                 if ($user->isGuest) { // ???? O_o
                     $v->addError('Cannot ban guest message');
                 } elseif ($user->isAdmin) {
-                    $v->addError(\ForkBB\__('User is admin message', $user->username));
+                    $v->addError(__('User is admin message', $user->username));
                 } elseif ($user->isAdmMod) {
-                    $v->addError(\ForkBB\__('User is mod message', $user->username));
+                    $v->addError(__('User is mod message', $user->username));
                 }
             }
         }
@@ -815,7 +816,7 @@ class Bans extends Admin
                     }
                 }
 
-                $v->addError(\ForkBB\__('Invalid IP message (%s)', $address));
+                $v->addError(__('Invalid IP message (%s)', $address));
                 break;
             }
         }

+ 16 - 15
app/Models/Pages/Admin/Categories.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Container;
 use ForkBB\Models\Page;
 use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\Pages\Admin;
+use function \ForkBB\__;
 
 class Categories extends Admin
 {
@@ -55,7 +56,7 @@ class Categories extends Admin
         $this->aIndex    = 'categories';
         $this->form      = $this->formEdit();
         $this->classForm = 'editcategories';
-        $this->titleForm = \ForkBB\__('Categories');
+        $this->titleForm = __('Categories');
 
         return $this;
     }
@@ -76,7 +77,7 @@ class Categories extends Admin
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save changes'),
+                    'value'     => __('Save changes'),
                     'accesskey' => 's',
                 ],
             ],
@@ -89,7 +90,7 @@ class Categories extends Admin
                 'type'      => 'text',
                 'maxlength' => 80,
                 'value'     => $row['cat_name'],
-                'caption'   => \ForkBB\__('Category name label'),
+                'caption'   => __('Category name label'),
                 'required'  => true,
             ];
             $fields["form[{$key}][disp_position]"] = [
@@ -98,13 +99,13 @@ class Categories extends Admin
                 'min'     => 0,
                 'max'     => 9999999999,
                 'value'   => $row['disp_position'],
-                'caption' => \ForkBB\__('Category position label'),
+                'caption' => __('Category position label'),
             ];
             $fields["delete-btn{$key}"] = [
                 'class'   => ['delete', 'category'],
                 'type'    => 'btn',
                 'value'   => '❌',
-                'caption' => \ForkBB\__('Delete'),
+                'caption' => __('Delete'),
                 'link'    => $this->c->Router->link('AdminCategoriesDelete', ['id' => $key]),
             ];
             $form['sets']["category{$key}"] = [
@@ -120,8 +121,8 @@ class Categories extends Admin
                     'class'     => 'new',
                     'type'      => 'text',
                     'maxlength' => 80,
-                    'caption'   => \ForkBB\__('Add category label'),
-                    'info'      => \ForkBB\__('Add category help', $this->c->Router->link('AdminForums'), \ForkBB\__('Forums')),
+                    'caption'   => __('Add category label'),
+                    'info'      => __('Add category help', $this->c->Router->link('AdminForums'), __('Forums')),
                 ],
             ],
         ];
@@ -174,11 +175,11 @@ class Categories extends Admin
 
         $this->nameTpl   = 'admin/form';
         $this->aIndex    = 'categories';
-        $this->aCrumbs[] = [$this->c->Router->link('AdminCategoriesDelete', ['id' => $args['id']]), \ForkBB\__('Delete category head')];
-        $this->aCrumbs[] = \ForkBB\__('"%s"', $category['cat_name']);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminCategoriesDelete', ['id' => $args['id']]), __('Delete category head')];
+        $this->aCrumbs[] = __('"%s"', $category['cat_name']);
         $this->form      = $this->formDelete($args, $category);
         $this->classForm = 'deletecategory';
-        $this->titleForm = \ForkBB\__('Delete category head');
+        $this->titleForm = __('Delete category head');
 
         return $this;
     }
@@ -202,9 +203,9 @@ class Categories extends Admin
                 'del' => [
                     'fields' => [
                         'confirm' => [
-                            'caption' => \ForkBB\__('Confirm delete'),
+                            'caption' => __('Confirm delete'),
                             'type'    => 'checkbox',
-                            'label'   => \ForkBB\__('I want to delete the category %s', $category['cat_name']),
+                            'label'   => __('I want to delete the category %s', $category['cat_name']),
                             'value'   => '1',
                             'checked' => false,
                         ],
@@ -214,7 +215,7 @@ class Categories extends Admin
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Delete category warn'),
+                            'value' => __('Delete category warn'),
                             'html'  => true,
                         ],
                     ],
@@ -223,12 +224,12 @@ class Categories extends Admin
             'btns'   => [
                 'delete' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Delete category'),
+                    'value'     => __('Delete category'),
                     'accesskey' => 's',
                 ],
                 'cancel' => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('Cancel'),
+                    'value'     => __('Cancel'),
                     'link'      => $this->c->Router->link('AdminCategories'),
                 ],
             ],

+ 11 - 10
app/Models/Pages/Admin/Censoring.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages\Admin;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
+use function \ForkBB\__;
 
 class Censoring extends Admin
 {
@@ -47,7 +48,7 @@ class Censoring extends Admin
         $this->aIndex    = 'censoring';
         $this->form      = $this->formEdit();
         $this->classForm = 'editcensorship';
-        $this->titleForm = \ForkBB\__('Censoring');
+        $this->titleForm = __('Censoring');
 
         return $this;
     }
@@ -70,9 +71,9 @@ class Censoring extends Admin
                         'o_censoring' => [
                             'type'    => 'radio',
                             'value'   => $this->c->config->o_censoring,
-                            'values'  => [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')],
-                            'caption' => \ForkBB\__('Censor words label'),
-                            'info'    => \ForkBB\__('Censor words help'),
+                            'values'  => [1 => __('Yes'), 0 => __('No')],
+                            'caption' => __('Censor words label'),
+                            'info'    => __('Censor words help'),
                         ],
                     ],
                 ],
@@ -80,7 +81,7 @@ class Censoring extends Admin
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Censoring info'),
+                            'value' => __('Censoring info'),
                             'html'  => true,
                         ],
                     ],
@@ -89,7 +90,7 @@ class Censoring extends Admin
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save changes'),
+                    'value'     => __('Save changes'),
                     'accesskey' => 's',
                 ],
             ],
@@ -102,14 +103,14 @@ class Censoring extends Admin
                 'type'      => 'text',
                 'maxlength' => 60,
                 'value'     => $row['search_for'],
-                'caption'   => \ForkBB\__('Censored word label'),
+                'caption'   => __('Censored word label'),
             ];
             $fieldset["form[{$id}][replace_with]"] = [
                 'class'     => ['censor'],
                 'type'      => 'text',
                 'maxlength' => 60,
                 'value'     => $row['replace_with'],
-                'caption'   => \ForkBB\__('Replacement label'),
+                'caption'   => __('Replacement label'),
             ];
         }
         $fieldset["form[0][search_for]"] = [
@@ -117,14 +118,14 @@ class Censoring extends Admin
             'type'      => 'text',
             'maxlength' => 60,
             'value'     => '',
-            'caption'   => \ForkBB\__('Censored word label'),
+            'caption'   => __('Censored word label'),
         ];
         $fieldset["form[0][replace_with]"] = [
             'class'     => ['censor'],
             'type'      => 'text',
             'maxlength' => 60,
             'value'     => '',
-            'caption'   => \ForkBB\__('Replacement label'),
+            'caption'   => __('Replacement label'),
         ];
 
         $form['sets']['cens'] = [

+ 45 - 44
app/Models/Pages/Admin/Forums.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Container;
 use ForkBB\Models\Page;
 use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\Pages\Admin;
+use function \ForkBB\__;
 
 class Forums extends Admin
 {
@@ -19,7 +20,7 @@ class Forums extends Admin
         $cid        = null;
         $categories = $this->c->categories->getList();
         $options    = [
-            ['', \ForkBB\__('Not selected')],
+            ['', __('Not selected')],
         ];
         $idxs       = [];
         $root = $this->c->forums->get(0);
@@ -27,28 +28,28 @@ class Forums extends Admin
             foreach ($this->c->forums->depthList($root, 0) as $f) {
                 if ($cid !== $f->cat_id) {
                     $cid       = $f->cat_id;
-                    $options[] = [-$cid, \ForkBB\__('Category prefix') . $f->cat_name];
+                    $options[] = [-$cid, __('Category prefix') . $f->cat_name];
                     $idxs[]    = -$cid;
                     unset($categories[$cid]);
                 }
 
-                $indent = \str_repeat(\ForkBB\__('Forum indent'), $f->depth);
+                $indent = \str_repeat(__('Forum indent'), $f->depth);
 
                 if (
                     $f->id === $forum->id
                     || isset($forum->descendants[$f->id])
                     || $f->redirect_url
                 ) {
-                    $options[] = [$f->id, $indent . \ForkBB\__('Forum prefix') . $f->forum_name, true];
+                    $options[] = [$f->id, $indent . __('Forum prefix') . $f->forum_name, true];
                 } else {
-                    $options[] = [$f->id, $indent . \ForkBB\__('Forum prefix') . $f->forum_name];
+                    $options[] = [$f->id, $indent . __('Forum prefix') . $f->forum_name];
                     $idxs[]    = $f->id;
                 }
             }
         }
         foreach ($categories as $key => $row) {
             $idxs[]    = -$key;
-            $options[] = [-$key, \ForkBB\__('Category prefix') . $row['cat_name']];
+            $options[] = [-$key, __('Category prefix') . $row['cat_name']];
         }
         $this->listOfIndexes  = $idxs;
         $this->listForOptions = $options;
@@ -123,7 +124,7 @@ class Forums extends Admin
         $this->aIndex    = 'forums';
         $this->form      = $this->formView();
         $this->classForm = ['editforums', 'inline'];
-        $this->titleForm = \ForkBB\__('Forums');
+        $this->titleForm = __('Forums');
 
         return $this;
     }
@@ -144,13 +145,13 @@ class Forums extends Admin
             'btns'   => [
                 'new' => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('New forum'),
+                    'value'     => __('New forum'),
                     'link'      => $this->c->Router->link('AdminForumsNew'),
                     'accesskey' => 'n',
                 ],
                 'update' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Update positions'),
+                    'value'     => __('Update positions'),
                     'accesskey' => 's',
                 ],
             ],
@@ -180,7 +181,7 @@ class Forums extends Admin
                     'class'   => ['name', 'forum', 'depth' . $forum->depth],
                     'type'    => 'btn',
                     'value'   => $forum->forum_name,
-                    'caption' => \ForkBB\__('Forum label'),
+                    'caption' => __('Forum label'),
                     'link'    => $this->c->Router->link('AdminForumsEdit', ['id' => $forum->id]),
                 ];
                 $fields["form[{$forum->id}][disp_position]"] = [
@@ -189,14 +190,14 @@ class Forums extends Admin
                     'min'     => 0,
                     'max'     => 9999999999,
                     'value'   => $forum->disp_position,
-                    'caption' => \ForkBB\__('Position label'),
+                    'caption' => __('Position label'),
                 ];
                 $disabled = (bool) $forum->subforums;
                 $fields["delete-btn{$forum->id}"] = [
                     'class'    => ['delete', 'forum'],
                     'type'     => 'btn',
                     'value'    => '❌',
-                    'caption'  => \ForkBB\__('Delete'),
+                    'caption'  => __('Delete'),
                     'link'     => $disabled ? '#' : $this->c->Router->link('AdminForumsDelete', ['id' => $forum->id]),
                     'disabled' => $disabled,
                 ];
@@ -258,11 +259,11 @@ class Forums extends Admin
 
         $this->nameTpl   = 'admin/form';
         $this->aIndex    = 'forums';
-        $this->aCrumbs[] = [$this->c->Router->link('AdminForumsDelete', ['id' => $forum->id]), \ForkBB\__('Delete forum head')];
-        $this->aCrumbs[] = \ForkBB\__('"%s"', $forum->forum_name);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminForumsDelete', ['id' => $forum->id]), __('Delete forum head')];
+        $this->aCrumbs[] = __('"%s"', $forum->forum_name);
         $this->form      = $this->formDelete($args, $forum);
         $this->classForm = 'deleteforum';
-        $this->titleForm = \ForkBB\__('Delete forum head');
+        $this->titleForm = __('Delete forum head');
 
         return $this;
     }
@@ -286,9 +287,9 @@ class Forums extends Admin
                 'confirm' => [
                     'fields' => [
                         'confirm' => [
-                            'caption' => \ForkBB\__('Confirm delete'),
+                            'caption' => __('Confirm delete'),
                             'type'    => 'checkbox',
-                            'label'   => \ForkBB\__('I want to delete forum %s', $forum->forum_name),
+                            'label'   => __('I want to delete forum %s', $forum->forum_name),
                             'value'   => '1',
                             'checked' => false,
                         ],
@@ -298,7 +299,7 @@ class Forums extends Admin
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Delete forum warn'),
+                            'value' => __('Delete forum warn'),
                             'html'  => true,
                         ],
                     ],
@@ -308,12 +309,12 @@ class Forums extends Admin
             'btns'   => [
                 'delete' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Delete forum'),
+                    'value'     => __('Delete forum'),
                     'accesskey' => 'd',
                 ],
                 'cancel' => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('Cancel'),
+                    'value'     => __('Cancel'),
                     'link'      => $this->c->Router->link('AdminForums'),
                 ],
             ],
@@ -336,15 +337,15 @@ class Forums extends Admin
         if (empty($args['id'])) {
             $forum           = $this->c->forums->create();
             $marker          = 'AdminForumsNew';
-            $this->aCrumbs[] = [$this->c->Router->link($marker), \ForkBB\__('Add forum head')];
-            $this->titleForm = \ForkBB\__('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((int) $args['id']); //?????
             $marker          = 'AdminForumsEdit';
-            $this->aCrumbs[] = [$this->c->Router->link($marker, $args), \ForkBB\__('Edit forum head')];
-            $this->aCrumbs[] = \ForkBB\__('"%s"', $forum->forum_name);
-            $this->titleForm = \ForkBB\__('Edit forum head');
+            $this->aCrumbs[] = [$this->c->Router->link($marker, $args), __('Edit forum head')];
+            $this->aCrumbs[] = __('"%s"', $forum->forum_name);
+            $this->titleForm = __('Edit forum head');
             $this->classForm = 'editforum';
         }
 
@@ -443,14 +444,14 @@ class Forums extends Admin
         if ($forum->id > 0) {
             $form['btns']['reset'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Revert to default'),
+                'value'     => __('Revert to default'),
                 'accesskey' => 'r',
             ];
         }
 
         $form['btns']['submit'] = [
             'type'      => 'submit',
-            'value'     => empty($forum->id) ? \ForkBB\__('Add') : \ForkBB\__('Update'),
+            'value'     => empty($forum->id) ? __('Add') : __('Update'),
             'accesskey' => 's',
         ];
 
@@ -460,38 +461,38 @@ class Forums extends Admin
                     'type'      => 'text',
                     'maxlength' => 80,
                     'value'     => $forum->forum_name,
-                    'caption'   => \ForkBB\__('Forum name label'),
+                    'caption'   => __('Forum name label'),
                     'required'  => true,
                 ],
                 'forum_desc' => [
                     'type'    => 'textarea',
                     'value'   => $forum->forum_desc,
-                    'caption' => \ForkBB\__('Forum description label'),
+                    'caption' => __('Forum description label'),
                 ],
                 'parent' => [
                     'type'     => 'select',
                     'options'  => $this->listForOptions,
                     'value'    => $forum->parent_forum_id ? $forum->parent_forum_id : -$forum->cat_id,
-                    'caption'  => \ForkBB\__('Parent label'),
-                    'info'     => \ForkBB\__('Parent help'),
+                    'caption'  => __('Parent label'),
+                    'info'     => __('Parent help'),
                     'required' => true,
                 ],
                 'sort_by' => [
                     'type'    => 'select',
                     'options' => [
-                        0 => \ForkBB\__('Last post option'),
-                        1 => \ForkBB\__('Topic start option'),
-                        2 => \ForkBB\__('Subject option'),
+                        0 => __('Last post option'),
+                        1 => __('Topic start option'),
+                        2 => __('Subject option'),
                     ],
                     'value'   => $forum->sort_by,
-                    'caption' => \ForkBB\__('Sort by label'),
+                    'caption' => __('Sort by label'),
                 ],
                 'redirect_url' => [
                     'type'      => 'text',
                     'maxlength' => 255,
                     'value'     => $forum->redirect_url,
-                    'caption'   => \ForkBB\__('Redirect label'),
-                    'info'      => \ForkBB\__('Redirect help'),
+                    'caption'   => __('Redirect label'),
+                    'info'      => __('Redirect help'),
                     'disabled'  => $forum->num_topics || $forum->subforums ? true : null,
                 ],
             ],
@@ -501,7 +502,7 @@ class Forums extends Admin
             'info' => [
                 'info1' => [
                     'type'  => '', //????
-                    'value' => \ForkBB\__('Group permissions info', $this->c->Router->link('AdminGroups'), \ForkBB\__('User groups')),
+                    'value' => __('Group permissions info', $this->c->Router->link('AdminGroups'), __('User groups')),
                     'html'  => true,
                 ],
             ],
@@ -515,8 +516,8 @@ class Forums extends Admin
                 'class'    => $group->def_read_forum ? $aOn : $aOff,
                 'type'     => 'checkbox',
                 'value'    => '1',
-                'caption'  => \ForkBB\__('Read forum label'),
-                'label'    => \ForkBB\__('<span></span>'),
+                'caption'  => __('Read forum label'),
+                'label'    => __('<span></span>'),
                 'checked'  => $group->set_read_forum,
                 'disabled' => $group->dis_read_forum,
             ];
@@ -524,8 +525,8 @@ class Forums extends Admin
                 'class'    => $group->def_post_replies ? $aOn : $aOff,
                 'type'     => 'checkbox',
                 'value'    => '1',
-                'caption'  => \ForkBB\__('Post replies label'),
-                'label'    => \ForkBB\__('<span></span>'),
+                'caption'  => __('Post replies label'),
+                'label'    => __('<span></span>'),
                 'checked'  => $group->set_post_replies,
                 'disabled' => $group->dis_post_replies,
             ];
@@ -533,8 +534,8 @@ class Forums extends Admin
                 'class'    => $group->def_post_topics ? $aOn : $aOff,
                 'type'     => 'checkbox',
                 'value'    => '1',
-                'caption'  => \ForkBB\__('Post topics label'),
-                'label'    => \ForkBB\__('<span></span>'),
+                'caption'  => __('Post topics label'),
+                'label'    => __('<span></span>'),
                 'checked'  => $group->set_post_topics,
                 'disabled' => $group->dis_post_topics,
             ];

+ 84 - 83
app/Models/Pages/Admin/Groups.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Container;
 use ForkBB\Models\Page;
 use ForkBB\Models\Group\Model as Group;
 use ForkBB\Models\Pages\Admin;
+use function \ForkBB\__;
 
 class Groups extends Admin
 {
@@ -74,14 +75,14 @@ class Groups extends Admin
             ],
             'sets'   => [
                 'base' => [
-                    'legend' => \ForkBB\__('Add group subhead'),
+                    'legend' => __('Add group subhead'),
                     'fields' => [
                         'basegroup' => [
                             'type'      => 'select',
                             'options'   => $this->groupsNew,
                             'value'     => $this->c->config->o_default_user_group,
-                            'caption'   => \ForkBB\__('New group label'),
-                            'info'      => \ForkBB\__('New group help'),
+                            'caption'   => __('New group label'),
+                            'info'      => __('New group help'),
 #                           'autofocus' => true,
                         ],
                     ],
@@ -90,7 +91,7 @@ class Groups extends Admin
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Add'),
+                    'value'     => __('Add'),
                     'accesskey' => 'n',
                 ],
             ],
@@ -111,14 +112,14 @@ class Groups extends Admin
             ],
             'sets'   => [
                 'del' => [
-                    'legend' => \ForkBB\__('Default group subhead'),
+                    'legend' => __('Default group subhead'),
                     'fields' => [
                         'defaultgroup' => [
                             'type'    => 'select',
                             'options' => $this->groupsDefault,
                             'value'   => $this->c->config->o_default_user_group,
-                            'caption' => \ForkBB\__('Default group label'),
-                            'info'    => \ForkBB\__('Default group help'),
+                            'caption' => __('Default group label'),
+                            'info'    => __('Default group help'),
                         ],
                     ],
                 ],
@@ -126,7 +127,7 @@ class Groups extends Admin
             'btns'   => [
                 'submit'  => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Update'),
+                    'value'     => __('Update'),
                     'accesskey' => 's',
                 ],
             ],
@@ -209,17 +210,17 @@ class Groups extends Admin
             $marker          = 'AdminGroupsEdit';
             $vars            = ['id' => $group->g_id];
             $notNext        .= ',' . $group->g_id;
-            $this->aCrumbs[] = [$this->c->Router->link($marker, $vars), \ForkBB\__('Edit group')];
-            $this->aCrumbs[] = \ForkBB\__('"%s"', $group->g_title);
-            $this->titleForm = \ForkBB\__('Edit group');
+            $this->aCrumbs[] = [$this->c->Router->link($marker, $vars), __('Edit group')];
+            $this->aCrumbs[] = __('"%s"', $group->g_title);
+            $this->titleForm = __('Edit group');
             $this->classForm = 'editgroup';
         } else {
             $marker          = 'AdminGroupsNew';
             $vars            = ['base' => $group->g_id];
             $group->g_title  = '';
             $group->g_id     = null;
-            $this->aCrumbs[] = \ForkBB\__('Create new group');
-            $this->titleForm = \ForkBB\__('Create new group');
+            $this->aCrumbs[] = __('Create new group');
+            $this->titleForm = __('Create new group');
             $this->classForm = 'creategroup';
         }
 
@@ -335,12 +336,12 @@ class Groups extends Admin
         }
 
         if (null === $group->g_id) {
-            $message = \ForkBB\__('Group added redirect');
+            $message = __('Group added redirect');
             $this->c->groups->insert($group);
 
             $this->c->groups->Perm->copy($baseGroup, $group);
         } else {
-            $message = \ForkBB\__('Group edited redirect');
+            $message = __('Group edited redirect');
             $this->c->groups->update($group);
 
             if ($group->g_promote_min_posts) {
@@ -373,7 +374,7 @@ class Groups extends Admin
             'btns'   => [
                 'submit'  => [
                     'type'      => 'submit',
-                    'value'     => null === $group->g_id ? \ForkBB\__('Add') : \ForkBB\__('Update'),
+                    'value'     => null === $group->g_id ? __('Add') : __('Update'),
                     'accesskey' => 's',
                 ],
             ],
@@ -384,7 +385,7 @@ class Groups extends Admin
                 'info' => [
                     'info1' => [
                         'type'  => '', //????
-                        'value' => \ForkBB\__('Group settings info'),
+                        'value' => __('Group settings info'),
                     ],
                 ],
             ];
@@ -395,7 +396,7 @@ class Groups extends Admin
             'type'      => 'text',
             'maxlength' => 50,
             'value'     => $group->g_title,
-            'caption'   => \ForkBB\__('Group title label'),
+            'caption'   => __('Group title label'),
             'required'  => true,
 #           'autofocus' => true,
         ];
@@ -403,8 +404,8 @@ class Groups extends Admin
             'type'      => 'text',
             'maxlength' => 50,
             'value'     => $group->g_user_title,
-            'caption'   => \ForkBB\__('User title label'),
-            'info'      => \ForkBB\__('User title help', $group->groupGuest ? \ForkBB\__('Guest') : \ForkBB\__('Member')),
+            'caption'   => __('User title label'),
+            'info'      => __('User title help', $group->groupGuest ? __('Guest') : __('Member')),
         ];
 
         if ($group->groupAdmin) {
@@ -415,7 +416,7 @@ class Groups extends Admin
         }
 
         if (! $group->groupGuest) {
-            $options = [0 => \ForkBB\__('Disable promotion')];
+            $options = [0 => __('Disable promotion')];
 
             foreach ($this->groupsNew as $key => $title) {
                 if (
@@ -431,20 +432,20 @@ class Groups extends Admin
                 'type'    => 'select',
                 'options' => $options,
                 'value'   => $group->g_promote_next_group,
-                'caption' => \ForkBB\__('Promote users label'),
-                'info'    => \ForkBB\__('Promote users help', \ForkBB\__('Disable promotion')),
+                'caption' => __('Promote users label'),
+                'info'    => __('Promote users help', __('Disable promotion')),
             ];
             $fieldset['g_promote_min_posts'] = [
                 'type'    => 'number',
                 'min'     => 0,
                 'max'     => 9999999999,
                 'value'   => $group->g_promote_min_posts,
-                'caption' => \ForkBB\__('Number for promotion label'),
-                'info'    => \ForkBB\__('Number for promotion help'),
+                'caption' => __('Number for promotion label'),
+                'info'    => __('Number for promotion help'),
             ];
         }
 
-        $yn = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
+        $yn = [1 => __('Yes'), 0 => __('No')];
 
         if (
             ! $group->groupGuest
@@ -455,43 +456,43 @@ class Groups extends Admin
                 'type'    => 'radio',
                 'value'   => $group->g_moderator,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Mod privileges label'),
-                'info'    => \ForkBB\__('Mod privileges help'),
+                'caption' => __('Mod privileges label'),
+                'info'    => __('Mod privileges help'),
             ];
             $fieldset['g_mod_edit_users'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_mod_edit_users,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Edit profile label'),
-                'info'    => \ForkBB\__('Edit profile help'),
+                'caption' => __('Edit profile label'),
+                'info'    => __('Edit profile help'),
             ];
             $fieldset['g_mod_rename_users'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_mod_rename_users,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Rename users label'),
-                'info'    => \ForkBB\__('Rename users help'),
+                'caption' => __('Rename users label'),
+                'info'    => __('Rename users help'),
             ];
             $fieldset['g_mod_change_passwords'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_mod_change_passwords,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Change passwords label'),
-                'info'    => \ForkBB\__('Change passwords help'),
+                'caption' => __('Change passwords label'),
+                'info'    => __('Change passwords help'),
             ];
             $fieldset['g_mod_promote_users'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_mod_promote_users,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Mod promote users label'),
-                'info'    => \ForkBB\__('Mod promote users help'),
+                'caption' => __('Mod promote users label'),
+                'info'    => __('Mod promote users help'),
             ];
             $fieldset['g_mod_ban_users'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_mod_ban_users,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Ban users label'),
-                'info'    => \ForkBB\__('Ban users help'),
+                'caption' => __('Ban users label'),
+                'info'    => __('Ban users help'),
             ];
         }
 
@@ -499,29 +500,29 @@ class Groups extends Admin
             'type'    => 'radio',
             'value'   => $group->g_read_board,
             'values'  => $yn,
-            'caption' => \ForkBB\__('Read board label'),
-            'info'    => \ForkBB\__('Read board help'),
+            'caption' => __('Read board label'),
+            'info'    => __('Read board help'),
         ];
         $fieldset['g_view_users'] = [
             'type'    => 'radio',
             'value'   => $group->g_view_users,
             'values'  => $yn,
-            'caption' => \ForkBB\__('View user info label'),
-            'info'    => \ForkBB\__('View user info help'),
+            'caption' => __('View user info label'),
+            'info'    => __('View user info help'),
         ];
         $fieldset['g_post_replies'] = [
             'type'    => 'radio',
             'value'   => $group->g_post_replies,
             'values'  => $yn,
-            'caption' => \ForkBB\__('Post replies label'),
-            'info'    => \ForkBB\__('Post replies help'),
+            'caption' => __('Post replies label'),
+            'info'    => __('Post replies help'),
         ];
         $fieldset['g_post_topics'] = [
             'type'    => 'radio',
             'value'   => $group->g_post_topics,
             'values'  => $yn,
-            'caption' => \ForkBB\__('Post topics label'),
-            'info'    => \ForkBB\__('Post topics help'),
+            'caption' => __('Post topics label'),
+            'info'    => __('Post topics help'),
         ];
 
         if (! $group->groupGuest) {
@@ -529,37 +530,37 @@ class Groups extends Admin
                 'type'    => 'radio',
                 'value'   => $group->g_edit_posts,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Edit posts label'),
-                'info'    => \ForkBB\__('Edit posts help'),
+                'caption' => __('Edit posts label'),
+                'info'    => __('Edit posts help'),
             ];
             $fieldset['g_delete_posts'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_delete_posts,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Delete posts label'),
-                'info'    => \ForkBB\__('Delete posts help'),
+                'caption' => __('Delete posts label'),
+                'info'    => __('Delete posts help'),
             ];
             $fieldset['g_delete_topics'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_delete_topics,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Delete topics label'),
-                'info'    => \ForkBB\__('Delete topics help'),
+                'caption' => __('Delete topics label'),
+                'info'    => __('Delete topics help'),
             ];
             $fieldset['g_deledit_interval'] = [
                 'type'    => 'number',
                 'min'     => 0,
                 'max'     => 999999,
                 'value'   => $group->g_deledit_interval,
-                'caption' => \ForkBB\__('Delete-edit interval label'),
-                'info'    => \ForkBB\__('Delete-edit interval help'),
+                'caption' => __('Delete-edit interval label'),
+                'info'    => __('Delete-edit interval help'),
             ];
             $fieldset['g_set_title'] = [
                 'type'    => 'radio',
                 'value'   => $group->g_set_title,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Set own title label'),
-                'info'    => \ForkBB\__('Set own title help'),
+                'caption' => __('Set own title label'),
+                'info'    => __('Set own title help'),
             ];
         }
 
@@ -567,22 +568,22 @@ class Groups extends Admin
             'type'    => 'radio',
             'value'   => $group->g_post_links,
             'values'  => $yn,
-            'caption' => \ForkBB\__('Post links label'),
-            'info'    => \ForkBB\__('Post links help'),
+            'caption' => __('Post links label'),
+            'info'    => __('Post links help'),
         ];
         $fieldset['g_search'] = [
             'type'    => 'radio',
             'value'   => $group->g_search,
             'values'  => $yn,
-            'caption' => \ForkBB\__('User search label'),
-            'info'    => \ForkBB\__('User search help'),
+            'caption' => __('User search label'),
+            'info'    => __('User search help'),
         ];
         $fieldset['g_search_users'] = [
             'type'    => 'radio',
             'value'   => $group->g_search_users,
             'values'  => $yn,
-            'caption' => \ForkBB\__('User list search label'),
-            'info'    => \ForkBB\__('User list search help'),
+            'caption' => __('User list search label'),
+            'info'    => __('User list search help'),
         ];
 
         if (! $group->groupGuest) {
@@ -590,8 +591,8 @@ class Groups extends Admin
                 'type'    => 'radio',
                 'value'   => $group->g_send_email,
                 'values'  => $yn,
-                'caption' => \ForkBB\__('Send e-mails label'),
-                'info'    => \ForkBB\__('Send e-mails help'),
+                'caption' => __('Send e-mails label'),
+                'info'    => __('Send e-mails help'),
             ];
         }
 
@@ -600,16 +601,16 @@ class Groups extends Admin
             'min'     => 0,
             'max'     => 999999,
             'value'   => $group->g_post_flood,
-            'caption' => \ForkBB\__('Post flood label'),
-            'info'    => \ForkBB\__('Post flood help'),
+            'caption' => __('Post flood label'),
+            'info'    => __('Post flood help'),
         ];
         $fieldset['g_search_flood'] = [
             'type'    => 'number',
             'min'     => 0,
             'max'     => 999999,
             'value'   => $group->g_search_flood,
-            'caption' => \ForkBB\__('Search flood label'),
-            'info'    => \ForkBB\__('Search flood help'),
+            'caption' => __('Search flood label'),
+            'info'    => __('Search flood help'),
         ];
 
         if (! $group->groupGuest) {
@@ -618,16 +619,16 @@ class Groups extends Admin
                 'min'     => 0,
                 'max'     => 999999,
                 'value'   => $group->g_email_flood,
-                'caption' => \ForkBB\__('E-mail flood label'),
-                'info'    => \ForkBB\__('E-mail flood help'),
+                'caption' => __('E-mail flood label'),
+                'info'    => __('E-mail flood help'),
             ];
             $fieldset['g_report_flood'] = [
                 'type'    => 'number',
                 'min'     => 0,
                 'max'     => 999999,
                 'value'   => $group->g_report_flood,
-                'caption' => \ForkBB\__('Report flood label'),
-                'info'    => \ForkBB\__('Report flood help'),
+                'caption' => __('Report flood label'),
+                'info'    => __('Report flood help'),
             ];
         }
 
@@ -640,7 +641,7 @@ class Groups extends Admin
                 'info' => [
                     'info1' => [
                         'type'  => '', //????
-                        'value' => \ForkBB\__('Moderator info'),
+                        'value' => __('Moderator info'),
                     ],
                 ],
             ];
@@ -716,10 +717,10 @@ class Groups extends Admin
 
 
         $this->nameTpl   = 'admin/form';
-        $this->aCrumbs[] = [$this->c->Router->link('AdminGroupsDelete', $args), \ForkBB\__('Group delete')];
-        $this->aCrumbs[] = \ForkBB\__('"%s"', $group->g_title);
+        $this->aCrumbs[] = [$this->c->Router->link('AdminGroupsDelete', $args), __('Group delete')];
+        $this->aCrumbs[] = __('"%s"', $group->g_title);
         $this->form      = $this->formDelete($args, $group, $count, $groups);
-        $this->titleForm = \ForkBB\__('Group delete');
+        $this->titleForm = __('Group delete');
         $this->classForm = 'deletegroup';
 
         return $this;
@@ -746,12 +747,12 @@ class Groups extends Admin
             'btns'   => [
                 'delete' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Delete group'),
+                    'value'     => __('Delete group'),
                     'accesskey' => 's',
                 ],
                 'cancel' => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('Cancel'),
+                    'value'     => __('Cancel'),
                     'link'      => $this->c->Router->link('AdminGroups'),
                 ],
             ],
@@ -764,8 +765,8 @@ class Groups extends Admin
                         'type'    => 'select',
                         'options' => $groups,
                         'value'   => $this->c->config->o_default_user_group,
-                        'caption' => \ForkBB\__('Move users label'),
-                        'info'    => \ForkBB\__('Move users info', $group->g_title, $count),
+                        'caption' => __('Move users label'),
+                        'info'    => __('Move users info', $group->g_title, $count),
                     ],
                 ],
             ];
@@ -774,9 +775,9 @@ class Groups extends Admin
         $form['sets']['conf'] = [
             'fields' => [
                 'confirm' => [
-                    'caption' => \ForkBB\__('Confirm delete'),
+                    'caption' => __('Confirm delete'),
                     'type'    => 'checkbox',
-                    'label'   => \ForkBB\__('I want to delete this group', $group->g_title),
+                    'label'   => __('I want to delete this group', $group->g_title),
                     'value'   => '1',
                     'checked' => false,
                 ],
@@ -786,7 +787,7 @@ class Groups extends Admin
             'info' => [
                 'info1' => [
                     'type'  => '', //????
-                    'value' => \ForkBB\__('Confirm delete warn'),
+                    'value' => __('Confirm delete warn'),
                     'html'  => true,
                 ],
             ],

+ 3 - 2
app/Models/Pages/Admin/Host.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages\Admin;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
+use function \ForkBB\__;
 
 class Host extends Admin
 {
@@ -28,11 +29,11 @@ class Host extends Admin
         $host = @\gethostbyaddr($ip);
 
         $this->nameTpl = 'message';
-        $this->titles  = \ForkBB\__('Info');
+        $this->titles  = __('Info');
         $this->back    = true;
         $this->fIswev  = [
             'i',
-            \ForkBB\__('Host info', $ip, $host, $this->c->Router->link('AdminUsersResult', ['data' => "ip:{$ip}"])),
+            __('Host info', $ip, $host, $this->c->Router->link('AdminUsersResult', ['data' => "ip:{$ip}"])),
         ];
 
         return $this;

+ 20 - 19
app/Models/Pages/Admin/Maintenance.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
 use ForkBB\Models\Config\Model as Config;
+use function \ForkBB\__;
 
 class Maintenance extends Admin
 {
@@ -71,20 +72,20 @@ class Maintenance extends Admin
             ],
             'sets'   => [
                 'maint' => [
-                    'legend' => \ForkBB\__('Maintenance head'),
+                    'legend' => __('Maintenance head'),
                     'fields' => [
                         'o_maintenance' => [
                             'type'    => 'radio',
                             'value'   => $config->o_maintenance,
-                            'values'  => [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')],
-                            'caption' => \ForkBB\__('Maintenance mode label'),
-                            'info'    => \ForkBB\__('Maintenance mode help'),
+                            'values'  => [1 => __('Yes'), 0 => __('No')],
+                            'caption' => __('Maintenance mode label'),
+                            'info'    => __('Maintenance mode help'),
                         ],
                         'o_maintenance_message' => [
                             'type'    => 'textarea',
                             'value'   => $config->o_maintenance_message,
-                            'caption' => \ForkBB\__('Maintenance message label'),
-                            'info'    => \ForkBB\__('Maintenance message help'),
+                            'caption' => __('Maintenance message label'),
+                            'info'    => __('Maintenance message help'),
                         ],
                     ],
                 ],
@@ -92,7 +93,7 @@ class Maintenance extends Admin
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save changes'),
+                    'value'     => __('Save changes'),
                     'accesskey' => 's',
                 ],
             ],
@@ -116,36 +117,36 @@ class Maintenance extends Admin
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Rebuild index info'),
+                            'value' => __('Rebuild index info'),
                             'html'  => true,
                         ],
                     ],
                 ],
                 'indx' => [
-                    'legend' => \ForkBB\__('Rebuild index head'),
+                    'legend' => __('Rebuild index head'),
                     'fields' => [
                         'limit' => [
                             'type'    => 'number',
                             'min'     => 1,
                             'max'     => 9999,
                             'value'   => 100,
-                            'caption' => \ForkBB\__('Posts per cycle label'),
-                            'info'    => \ForkBB\__('Posts per cycle help'),
+                            'caption' => __('Posts per cycle label'),
+                            'info'    => __('Posts per cycle help'),
                         ],
                         'start' => [
                             'type'    => 'number',
                             'min'     => 1,
                             'max'     => 9999999999,
                             'value'   => 1,
-                            'caption' => \ForkBB\__('Starting post label'),
-                            'info'    => \ForkBB\__('Starting post help'),
+                            'caption' => __('Starting post label'),
+                            'info'    => __('Starting post help'),
                         ],
                         'clear' => [
                             'type'    => 'checkbox',
                             'value'   => '1',
                             'checked' => true,
-                            'caption' => \ForkBB\__('Empty index label'),
-                            'label'   => \ForkBB\__('Empty index help'),
+                            'caption' => __('Empty index label'),
+                            'label'   => __('Empty index help'),
                         ],
                     ],
                 ],
@@ -153,7 +154,7 @@ class Maintenance extends Admin
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Rebuild completed info'),
+                            'value' => __('Rebuild completed info'),
                             'html'  => true,
                         ],
                     ],
@@ -162,7 +163,7 @@ class Maintenance extends Admin
             'btns'   => [
                 'rebuild' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Rebuild index'),
+                    'value'     => __('Rebuild index'),
                     'accesskey' => 'r',
                 ],
             ],
@@ -184,7 +185,7 @@ class Maintenance extends Admin
             1 === $v->o_maintenance
             && 0 === \strlen($value)
         ) {
-            $value = \ForkBB\__('Default maintenance message');
+            $value = __('Default maintenance message');
         }
         return $value;
     }
@@ -248,7 +249,7 @@ class Maintenance extends Admin
             ];
             $args['token'] = $this->c->Csrf->create('AdminRebuildIndex', $args);
 
-            return $this->c->Redirect->page('AdminRebuildIndex', $args)->message(\ForkBB\__('Processed posts', $v->start, $last));
+            return $this->c->Redirect->page('AdminRebuildIndex', $args)->message(__('Processed posts', $v->start, $last));
         } else {
             return $this->c->Redirect->page('AdminMaintenance')->message('Rebuilding index end');
         }

+ 177 - 176
app/Models/Pages/Admin/Options.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
 use ForkBB\Models\Config\Model as Config;
+use function \ForkBB\__;
 
 class Options extends Admin
 {
@@ -119,7 +120,7 @@ class Options extends Admin
         $this->aIndex    = 'options';
         $this->nameTpl   = 'admin/form';
         $this->form      = $this->formEdit($config);
-        $this->titleForm = \ForkBB\__('Options head');
+        $this->titleForm = __('Options head');
         $this->classForm = 'editoptions';
 
         return $this;
@@ -194,102 +195,102 @@ class Options extends Admin
             'btns'   => [
                 'save'  => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save changes'),
+                    'value'     => __('Save changes'),
                     'accesskey' => 's',
                 ],
             ],
         ];
 
-        $yn     = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
+        $yn     = [1 => __('Yes'), 0 => __('No')];
         $langs  = $this->c->Func->getNameLangs();
         $styles = $this->c->Func->getStyles();
 
         $form['sets']['essentials'] = [
-            'legend' => \ForkBB\__('Essentials subhead'),
+            'legend' => __('Essentials subhead'),
             'fields' => [
                 'o_board_title' => [
                     'type'      => 'text',
                     'maxlength' => 255,
                     'value'     => $config->o_board_title,
-                    'caption'   => \ForkBB\__('Board title label'),
-                    'info'      => \ForkBB\__('Board title help'),
+                    'caption'   => __('Board title label'),
+                    'info'      => __('Board title help'),
                     'required'  => true,
 #                   'autofocus' => true,
                 ],
                 'o_board_desc' => [
                     'type'    => 'textarea',
                     'value'   => $config->o_board_desc,
-                    'caption' => \ForkBB\__('Board desc label'),
-                    'info'    => \ForkBB\__('Board desc help'),
+                    'caption' => __('Board desc label'),
+                    'info'    => __('Board desc help'),
                 ],
                 'o_default_timezone' => [
                     'type'    => 'select',
                     'options' => [
-                        '-12'   => \ForkBB\__('UTC-12:00'),
-                        '-11'   => \ForkBB\__('UTC-11:00'),
-                        '-10'   => \ForkBB\__('UTC-10:00'),
-                        '-9.5'  => \ForkBB\__('UTC-09:30'),
-                        '-9'    => \ForkBB\__('UTC-09:00'),
-                        '-8.5'  => \ForkBB\__('UTC-08:30'),
-                        '-8'    => \ForkBB\__('UTC-08:00'),
-                        '-7'    => \ForkBB\__('UTC-07:00'),
-                        '-6'    => \ForkBB\__('UTC-06:00'),
-                        '-5'    => \ForkBB\__('UTC-05:00'),
-                        '-4'    => \ForkBB\__('UTC-04:00'),
-                        '-3.5'  => \ForkBB\__('UTC-03:30'),
-                        '-3'    => \ForkBB\__('UTC-03:00'),
-                        '-2'    => \ForkBB\__('UTC-02:00'),
-                        '-1'    => \ForkBB\__('UTC-01:00'),
-                        '0'     => \ForkBB\__('UTC'),
-                        '1'     => \ForkBB\__('UTC+01:00'),
-                        '2'     => \ForkBB\__('UTC+02:00'),
-                        '3'     => \ForkBB\__('UTC+03:00'),
-                        '3.5'   => \ForkBB\__('UTC+03:30'),
-                        '4'     => \ForkBB\__('UTC+04:00'),
-                        '4.5'   => \ForkBB\__('UTC+04:30'),
-                        '5'     => \ForkBB\__('UTC+05:00'),
-                        '5.5'   => \ForkBB\__('UTC+05:30'),
-                        '5.75'  => \ForkBB\__('UTC+05:45'),
-                        '6'     => \ForkBB\__('UTC+06:00'),
-                        '6.5'   => \ForkBB\__('UTC+06:30'),
-                        '7'     => \ForkBB\__('UTC+07:00'),
-                        '8'     => \ForkBB\__('UTC+08:00'),
-                        '8.75'  => \ForkBB\__('UTC+08:45'),
-                        '9'     => \ForkBB\__('UTC+09:00'),
-                        '9.5'   => \ForkBB\__('UTC+09:30'),
-                        '10'    => \ForkBB\__('UTC+10:00'),
-                        '10.5'  => \ForkBB\__('UTC+10:30'),
-                        '11'    => \ForkBB\__('UTC+11:00'),
-                        '11.5'  => \ForkBB\__('UTC+11:30'),
-                        '12'    => \ForkBB\__('UTC+12:00'),
-                        '12.75' => \ForkBB\__('UTC+12:45'),
-                        '13'    => \ForkBB\__('UTC+13:00'),
-                        '14'    => \ForkBB\__('UTC+14:00'),
+                        '-12'   => __('UTC-12:00'),
+                        '-11'   => __('UTC-11:00'),
+                        '-10'   => __('UTC-10:00'),
+                        '-9.5'  => __('UTC-09:30'),
+                        '-9'    => __('UTC-09:00'),
+                        '-8.5'  => __('UTC-08:30'),
+                        '-8'    => __('UTC-08:00'),
+                        '-7'    => __('UTC-07:00'),
+                        '-6'    => __('UTC-06:00'),
+                        '-5'    => __('UTC-05:00'),
+                        '-4'    => __('UTC-04:00'),
+                        '-3.5'  => __('UTC-03:30'),
+                        '-3'    => __('UTC-03:00'),
+                        '-2'    => __('UTC-02:00'),
+                        '-1'    => __('UTC-01:00'),
+                        '0'     => __('UTC'),
+                        '1'     => __('UTC+01:00'),
+                        '2'     => __('UTC+02:00'),
+                        '3'     => __('UTC+03:00'),
+                        '3.5'   => __('UTC+03:30'),
+                        '4'     => __('UTC+04:00'),
+                        '4.5'   => __('UTC+04:30'),
+                        '5'     => __('UTC+05:00'),
+                        '5.5'   => __('UTC+05:30'),
+                        '5.75'  => __('UTC+05:45'),
+                        '6'     => __('UTC+06:00'),
+                        '6.5'   => __('UTC+06:30'),
+                        '7'     => __('UTC+07:00'),
+                        '8'     => __('UTC+08:00'),
+                        '8.75'  => __('UTC+08:45'),
+                        '9'     => __('UTC+09:00'),
+                        '9.5'   => __('UTC+09:30'),
+                        '10'    => __('UTC+10:00'),
+                        '10.5'  => __('UTC+10:30'),
+                        '11'    => __('UTC+11:00'),
+                        '11.5'  => __('UTC+11:30'),
+                        '12'    => __('UTC+12:00'),
+                        '12.75' => __('UTC+12:45'),
+                        '13'    => __('UTC+13:00'),
+                        '14'    => __('UTC+14:00'),
                     ],
                     'value'   => $config->o_default_timezone,
-                    'caption' => \ForkBB\__('Timezone label'),
-                    'info'    => \ForkBB\__('Timezone help'),
+                    'caption' => __('Timezone label'),
+                    'info'    => __('Timezone help'),
                 ],
                 'o_default_dst' => [
                     'type'    => 'radio',
                     'value'   => $config->o_default_dst,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('DST label'),
-                    'info'    => \ForkBB\__('DST help'),
+                    'caption' => __('DST label'),
+                    'info'    => __('DST help'),
                 ],
                 'o_default_lang' => [
                     'type'    => 'select',
                     'options' => $langs,
                     'value'   => $config->o_default_lang,
-                    'caption' => \ForkBB\__('Language label'),
-                    'info'    => \ForkBB\__('Language help'),
+                    'caption' => __('Language label'),
+                    'info'    => __('Language help'),
                 ],
                 'o_default_style' => [
                     'type'    => 'select',
                     'options' => $styles,
                     'value'   => $config->o_default_style,
-                    'caption' => \ForkBB\__('Default style label'),
-                    'info'    => \ForkBB\__('Default style help'),
+                    'caption' => __('Default style label'),
+                    'info'    => __('Default style help'),
                 ],
             ],
         ];
@@ -299,22 +300,22 @@ class Options extends Admin
         $date = \ForkBB\dt($timestamp, true, $config->o_date_format, $config->o_time_format, false, true);
 
         $form['sets']['timeouts'] = [
-            'legend' => \ForkBB\__('Timeouts subhead'),
+            'legend' => __('Timeouts subhead'),
             'fields' => [
                 'o_time_format' => [
                     'type'      => 'text',
                     'maxlength' => 25,
                     'value'     => $config->o_time_format,
-                    'caption'   => \ForkBB\__('Time format label'),
-                    'info'      => \ForkBB\__('Time format help', $time),
+                    'caption'   => __('Time format label'),
+                    'info'      => __('Time format help', $time),
                     'required'  => true,
                 ],
                 'o_date_format' => [
                     'type'      => 'text',
                     'maxlength' => 25,
                     'value'     => $config->o_date_format,
-                    'caption'   => \ForkBB\__('Date format label'),
-                    'info'      => \ForkBB\__('Date format help', $date),
+                    'caption'   => __('Date format label'),
+                    'info'      => __('Date format help', $date),
                     'required'  => true,
                 ],
                 'o_timeout_visit' => [
@@ -322,241 +323,241 @@ class Options extends Admin
                     'min'     => 0,
                     'max'     => 99999,
                     'value'   => $config->o_timeout_visit,
-                    'caption' => \ForkBB\__('Visit timeout label'),
-                    'info'    => \ForkBB\__('Visit timeout help'),
+                    'caption' => __('Visit timeout label'),
+                    'info'    => __('Visit timeout help'),
                 ],
                 'o_timeout_online' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 99999,
                     'value'   => $config->o_timeout_online,
-                    'caption' => \ForkBB\__('Online timeout label'),
-                    'info'    => \ForkBB\__('Online timeout help'),
+                    'caption' => __('Online timeout label'),
+                    'info'    => __('Online timeout help'),
                 ],
                 'o_redirect_delay' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 99999,
                     'value'   => $config->o_redirect_delay,
-                    'caption' => \ForkBB\__('Redirect time label'),
-                    'info'    => \ForkBB\__('Redirect time help'),
+                    'caption' => __('Redirect time label'),
+                    'info'    => __('Redirect time help'),
                 ],
             ],
         ];
 
         $form['sets']['display'] = [
-            'legend' => \ForkBB\__('Display subhead'),
+            'legend' => __('Display subhead'),
             'fields' => [
                 'o_show_user_info' => [
                     'type'    => 'radio',
                     'value'   => $config->o_show_user_info,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Info in posts label'),
-                    'info'    => \ForkBB\__('Info in posts help'),
+                    'caption' => __('Info in posts label'),
+                    'info'    => __('Info in posts help'),
                 ],
                 'o_show_post_count' => [
                     'type'    => 'radio',
                     'value'   => $config->o_show_post_count,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Post count label'),
-                    'info'    => \ForkBB\__('Post count help'),
+                    'caption' => __('Post count label'),
+                    'info'    => __('Post count help'),
                 ],
                 'o_smilies' => [
                     'type'    => 'radio',
                     'value'   => $config->o_smilies,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Smilies label'),
-                    'info'    => \ForkBB\__('Smilies help'),
+                    'caption' => __('Smilies label'),
+                    'info'    => __('Smilies help'),
                 ],
                 'o_smilies_sig' => [
                     'type'    => 'radio',
                     'value'   => $config->o_smilies_sig,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Smilies sigs label'),
-                    'info'    => \ForkBB\__('Smilies sigs help'),
+                    'caption' => __('Smilies sigs label'),
+                    'info'    => __('Smilies sigs help'),
                 ],
                 'o_make_links' => [
                     'type'    => 'radio',
                     'value'   => $config->o_make_links,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Clickable links label'),
-                    'info'    => \ForkBB\__('Clickable links help'),
+                    'caption' => __('Clickable links label'),
+                    'info'    => __('Clickable links help'),
                 ],
                 'o_disp_topics_default' => [
                     'type'    => 'number',
                     'min'     => 10,
                     'max'     => 50,
                     'value'   => $config->o_disp_topics_default,
-                    'caption' => \ForkBB\__('Topics per page label'),
-                    'info'    => \ForkBB\__('Topics per page help'),
+                    'caption' => __('Topics per page label'),
+                    'info'    => __('Topics per page help'),
                 ],
                 'o_disp_posts_default' => [
                     'type'    => 'number',
                     'min'     => 10,
                     'max'     => 50,
                     'value'   => $config->o_disp_posts_default,
-                    'caption' => \ForkBB\__('Posts per page label'),
-                    'info'    => \ForkBB\__('Posts per page help'),
+                    'caption' => __('Posts per page label'),
+                    'info'    => __('Posts per page help'),
                 ],
                 'o_disp_users' => [
                     'type'    => 'number',
                     'min'     => 10,
                     'max'     => 50,
                     'value'   => $config->o_disp_users,
-                    'caption' => \ForkBB\__('Users per page label'),
-                    'info'    => \ForkBB\__('Users per page help'),
+                    'caption' => __('Users per page label'),
+                    'info'    => __('Users per page help'),
                 ],
                 'o_topic_review' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 50,
                     'value'   => $config->o_topic_review,
-                    'caption' => \ForkBB\__('Topic review label'),
-                    'info'    => \ForkBB\__('Topic review help'),
+                    'caption' => __('Topic review label'),
+                    'info'    => __('Topic review help'),
                 ],
                 'o_quote_depth' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 9,
                     'value'   => $config->o_quote_depth,
-                    'caption' => \ForkBB\__('Quote depth label'),
-                    'info'    => \ForkBB\__('Quote depth help'),
+                    'caption' => __('Quote depth label'),
+                    'info'    => __('Quote depth help'),
                 ],
             ],
         ];
 
         $form['sets']['features'] = [
-            'legend' => \ForkBB\__('Features subhead'),
+            'legend' => __('Features subhead'),
             'fields' => [
                 'o_quickpost' => [
                     'type'    => 'radio',
                     'value'   => $config->o_quickpost,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Quick post label'),
-                    'info'    => \ForkBB\__('Quick post help'),
+                    'caption' => __('Quick post label'),
+                    'info'    => __('Quick post help'),
                 ],
                 'o_users_online' => [
                     'type'    => 'radio',
                     'value'   => $config->o_users_online,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Users online label'),
-                    'info'    => \ForkBB\__('Users online help'),
+                    'caption' => __('Users online label'),
+                    'info'    => __('Users online help'),
                 ],
                 'o_signatures' => [
                     'type'    => 'radio',
                     'value'   => $config->o_signatures,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Signatures label'),
-                    'info'    => \ForkBB\__('Signatures help'),
+                    'caption' => __('Signatures label'),
+                    'info'    => __('Signatures help'),
                 ],
                 'o_show_dot' => [
                     'type'    => 'radio',
                     'value'   => $config->o_show_dot,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('User has posted label'),
-                    'info'    => \ForkBB\__('User has posted help'),
+                    'caption' => __('User has posted label'),
+                    'info'    => __('User has posted help'),
                 ],
                 'o_topic_views' => [
                     'type'    => 'radio',
                     'value'   => $config->o_topic_views,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Topic views label'),
-                    'info'    => \ForkBB\__('Topic views help'),
+                    'caption' => __('Topic views label'),
+                    'info'    => __('Topic views help'),
                 ],
                 'o_quickjump' => [
                     'type'    => 'radio',
                     'value'   => $config->o_quickjump,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Quick jump label'),
-                    'info'    => \ForkBB\__('Quick jump help'),
+                    'caption' => __('Quick jump label'),
+                    'info'    => __('Quick jump help'),
                 ],
                 'o_search_all_forums' => [ //????
                     'type'    => 'radio',
                     'value'   => $config->o_search_all_forums,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Search all label'),
-                    'info'    => \ForkBB\__('Search all help'),
+                    'caption' => __('Search all label'),
+                    'info'    => __('Search all help'),
                 ],
                 'o_additional_navlinks' => [
                     'type'    => 'textarea',
                     'value'   => $config->o_additional_navlinks,
-                    'caption' => \ForkBB\__('Menu items label'),
-                    'info'    => \ForkBB\__('Menu items help'),
+                    'caption' => __('Menu items label'),
+                    'info'    => __('Menu items help'),
                 ],
 
             ],
         ];
 
         $form['sets']['feed'] = [
-            'legend' => \ForkBB\__('Feed subhead'),
+            'legend' => __('Feed subhead'),
             'fields' => [
                 'o_feed_type' => [
                     'type'    => 'radio',
                     'value'   => $config->o_feed_typet,
                     'values'  => [
-                        0 => \ForkBB\__('No feeds'),
-                        1 => \ForkBB\__('RSS'),
-                        2 => \ForkBB\__('Atom'),
+                        0 => __('No feeds'),
+                        1 => __('RSS'),
+                        2 => __('Atom'),
                     ],
-                    'caption' => \ForkBB\__('Default feed label'),
-                    'info'    => \ForkBB\__('Default feed help'),
+                    'caption' => __('Default feed label'),
+                    'info'    => __('Default feed help'),
                 ],
                 'o_feed_ttl' => [
                     'type'    => 'select',
                     'options' => [
-                        0  => \ForkBB\__('No cache'),
-                        5  => \ForkBB\__('%d Minutes', 5),
-                        15 => \ForkBB\__('%d Minutes', 15),
-                        30 => \ForkBB\__('%d Minutes', 30),
-                        60 => \ForkBB\__('%d Minutes', 60),
+                        0  => __('No cache'),
+                        5  => __('%d Minutes', 5),
+                        15 => __('%d Minutes', 15),
+                        30 => __('%d Minutes', 30),
+                        60 => __('%d Minutes', 60),
                     ],
                     'value'   => $config->o_feed_ttl,
-                    'caption' => \ForkBB\__('Feed TTL label'),
-                    'info'    => \ForkBB\__('Feed TTL help'),
+                    'caption' => __('Feed TTL label'),
+                    'info'    => __('Feed TTL help'),
                 ],
 
             ],
         ];
 
         $form['sets']['reports'] = [
-            'legend' => \ForkBB\__('Reports subhead'),
+            'legend' => __('Reports subhead'),
             'fields' => [
                 'o_report_method' => [
                     'type'    => 'radio',
                     'value'   => $config->o_report_method,
                     'values'  => [
-                        0 => \ForkBB\__('Internal'),
-                        1 => \ForkBB\__('By e-mail'),
-                        2 => \ForkBB\__('Both'),
+                        0 => __('Internal'),
+                        1 => __('By e-mail'),
+                        2 => __('Both'),
                     ],
-                    'caption' => \ForkBB\__('Reporting method label'),
-                    'info'    => \ForkBB\__('Reporting method help'),
+                    'caption' => __('Reporting method label'),
+                    'info'    => __('Reporting method help'),
                 ],
                 'o_mailing_list' => [
                     'type'    => 'textarea',
                     'value'   => $config->o_mailing_list,
-                    'caption' => \ForkBB\__('Mailing list label'),
-                    'info'    => \ForkBB\__('Mailing list help'),
+                    'caption' => __('Mailing list label'),
+                    'info'    => __('Mailing list help'),
                 ],
             ],
         ];
 
         $form['sets']['avatars'] = [
-            'legend' => \ForkBB\__('Avatars subhead'),
+            'legend' => __('Avatars subhead'),
             'fields' => [
                 'o_avatars' => [
                     'type'    => 'radio',
                     'value'   => $config->o_avatars,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Use avatars label'),
-                    'info'    => \ForkBB\__('Use avatars help'),
+                    'caption' => __('Use avatars label'),
+                    'info'    => __('Use avatars help'),
                 ],
                 'o_avatars_dir' => [ //????
                     'type'      => 'text',
                     'maxlength' => 255,
                     'value'     => $config->o_avatars_dir,
-                    'caption'   => \ForkBB\__('Upload directory label'),
-                    'info'      => \ForkBB\__('Upload directory help'),
+                    'caption'   => __('Upload directory label'),
+                    'info'      => __('Upload directory help'),
                     'required'  => true,
                 ],
                 'o_avatars_width' => [
@@ -564,37 +565,37 @@ class Options extends Admin
                     'min'     => 50,
                     'max'     => 999,
                     'value'   => $config->o_avatars_width,
-                    'caption' => \ForkBB\__('Max width label'),
-                    'info'    => \ForkBB\__('Max width help'),
+                    'caption' => __('Max width label'),
+                    'info'    => __('Max width help'),
                 ],
                 'o_avatars_height' => [
                     'type'    => 'number',
                     'min'     => 50,
                     'max'     => 999,
                     'value'   => $config->o_avatars_height,
-                    'caption' => \ForkBB\__('Max height label'),
-                    'info'    => \ForkBB\__('Max height help'),
+                    'caption' => __('Max height label'),
+                    'info'    => __('Max height help'),
                 ],
                 'o_avatars_size' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 9999999,
                     'value'   => $config->o_avatars_size,
-                    'caption' => \ForkBB\__('Max size label'),
-                    'info'    => \ForkBB\__('Max size help'),
+                    'caption' => __('Max size label'),
+                    'info'    => __('Max size help'),
                 ],
             ],
         ];
 
         $form['sets']['email'] = [
-            'legend' => \ForkBB\__('E-mail subhead'),
+            'legend' => __('E-mail subhead'),
             'fields' => [
                 'o_admin_email' => [
                     'type'      => 'text',
                     'maxlength' => 80,
                     'value'     => $config->o_admin_email,
-                    'caption'   => \ForkBB\__('Admin e-mail label'),
-                    'info'      => \ForkBB\__('Admin e-mail help'),
+                    'caption'   => __('Admin e-mail label'),
+                    'info'      => __('Admin e-mail help'),
                     'required'  => true,
                     'pattern'   => '.+@.+',
                 ],
@@ -602,8 +603,8 @@ class Options extends Admin
                     'type'      => 'text',
                     'maxlength' => 80,
                     'value'     => $config->o_webmaster_email,
-                    'caption'   => \ForkBB\__('Webmaster e-mail label'),
-                    'info'      => \ForkBB\__('Webmaster e-mail help'),
+                    'caption'   => __('Webmaster e-mail label'),
+                    'info'      => __('Webmaster e-mail help'),
                     'required'  => true,
                     'pattern'   => '.+@.+',
                 ],
@@ -611,120 +612,120 @@ class Options extends Admin
                     'type'    => 'radio',
                     'value'   => $config->o_forum_subscriptions,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Forum subscriptions label'),
-                    'info'    => \ForkBB\__('Forum subscriptions help'),
+                    'caption' => __('Forum subscriptions label'),
+                    'info'    => __('Forum subscriptions help'),
                 ],
                 'o_topic_subscriptions' => [
                     'type'    => 'radio',
                     'value'   => $config->o_topic_subscriptions,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Topic subscriptions label'),
-                    'info'    => \ForkBB\__('Topic subscriptions help'),
+                    'caption' => __('Topic subscriptions label'),
+                    'info'    => __('Topic subscriptions help'),
                 ],
                 'o_smtp_host' => [
                     'type'      => 'text',
                     'maxlength' => 255,
                     'value'     => $config->o_smtp_host,
-                    'caption'   => \ForkBB\__('SMTP address label'),
-                    'info'      => \ForkBB\__('SMTP address help'),
+                    'caption'   => __('SMTP address label'),
+                    'info'      => __('SMTP address help'),
                 ],
                 'o_smtp_user' => [
                     'type'      => 'text',
                     'maxlength' => 255,
                     'value'     => $config->o_smtp_user,
-                    'caption'   => \ForkBB\__('SMTP username label'),
-                    'info'      => \ForkBB\__('SMTP username help'),
+                    'caption'   => __('SMTP username label'),
+                    'info'      => __('SMTP username help'),
                 ],
                 'o_smtp_pass' => [
                     'type'      => 'password',
                     'maxlength' => 255,
                     'value'     => $config->o_smtp_pass ? '          ' : null,
-                    'caption'   => \ForkBB\__('SMTP password label'),
-                    'info'      => \ForkBB\__('SMTP password help'),
+                    'caption'   => __('SMTP password label'),
+                    'info'      => __('SMTP password help'),
                 ],
                 'changeSmtpPassword' => [
                     'type'    => 'checkbox',
                     'value'   => '1',
                     'caption' => '',
-                    'label'   => \ForkBB\__('SMTP change password help'),
+                    'label'   => __('SMTP change password help'),
                 ],
                 'o_smtp_ssl' => [
                     'type'    => 'radio',
                     'value'   => $config->o_smtp_ssl,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('SMTP SSL label'),
-                    'info'    => \ForkBB\__('SMTP SSL help'),
+                    'caption' => __('SMTP SSL label'),
+                    'info'    => __('SMTP SSL help'),
                 ],
             ],
         ];
 
         $form['sets']['registration'] = [
-            'legend' => \ForkBB\__('Registration subhead'),
+            'legend' => __('Registration subhead'),
             'fields' => [
                 'o_regs_allow' => [
                     'type'    => 'radio',
                     'value'   => $config->o_regs_allow,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Allow new label'),
-                    'info'    => \ForkBB\__('Allow new help'),
+                    'caption' => __('Allow new label'),
+                    'info'    => __('Allow new help'),
                 ],
                 'o_regs_verify' => [
                     'type'    => 'radio',
                     'value'   => $config->o_regs_verify,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Verify label'),
-                    'info'    => \ForkBB\__('Verify help'),
+                    'caption' => __('Verify label'),
+                    'info'    => __('Verify help'),
                 ],
                 'o_regs_report' => [
                     'type'    => 'radio',
                     'value'   => $config->o_regs_report,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Report new label'),
-                    'info'    => \ForkBB\__('Report new help'),
+                    'caption' => __('Report new label'),
+                    'info'    => __('Report new help'),
                 ],
                 'o_rules' => [
                     'type'    => 'radio',
                     'value'   => $config->o_rules,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Use rules label'),
-                    'info'    => \ForkBB\__('Use rules help'),
+                    'caption' => __('Use rules label'),
+                    'info'    => __('Use rules help'),
                 ],
                 'o_rules_message' => [
                     'type'    => 'textarea',
                     'value'   => $config->o_rules_message,
-                    'caption' => \ForkBB\__('Rules label'),
-                    'info'    => \ForkBB\__('Rules help'),
+                    'caption' => __('Rules label'),
+                    'info'    => __('Rules help'),
                 ],
                 'o_default_email_setting' => [
                     'class'   => 'block',
                     'type'    => 'radio',
                     'value'   => $config->o_default_email_setting,
                     'values'  => [
-                        0 => \ForkBB\__('Display e-mail label'),
-                        1 => \ForkBB\__('Hide allow form label'),
-                        2 => \ForkBB\__('Hide both label'),
+                        0 => __('Display e-mail label'),
+                        1 => __('Hide allow form label'),
+                        2 => __('Hide both label'),
                     ],
-                    'caption' => \ForkBB\__('E-mail default label'),
-                    'info'    => \ForkBB\__('E-mail default help'),
+                    'caption' => __('E-mail default label'),
+                    'info'    => __('E-mail default help'),
                 ],
             ],
         ];
 
         $form['sets']['announcement'] = [
-            'legend' => \ForkBB\__('Announcement subhead'),
+            'legend' => __('Announcement subhead'),
             'fields' => [
                 'o_announcement' => [
                     'type'    => 'radio',
                     'value'   => $config->o_announcement,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Display announcement label'),
-                    'info'    => \ForkBB\__('Display announcement help'),
+                    'caption' => __('Display announcement label'),
+                    'info'    => __('Display announcement help'),
                 ],
                 'o_announcement_message' => [
                     'type'    => 'textarea',
                     'value'   => $config->o_announcement_message,
-                    'caption' => \ForkBB\__('Announcement message label'),
-                    'info'    => \ForkBB\__('Announcement message help'),
+                    'caption' => __('Announcement message label'),
+                    'info'    => __('Announcement message help'),
                 ],
 
             ],

+ 26 - 25
app/Models/Pages/Admin/Permissions.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
 use ForkBB\Models\Config\Model as Config;
+use function \ForkBB\__;
 
 class Permissions extends Admin
 {
@@ -64,7 +65,7 @@ class Permissions extends Admin
         $this->aIndex    = 'permissions';
         $this->nameTpl   = 'admin/form';
         $this->form      = $this->formEdit($config);
-        $this->titleForm = \ForkBB\__('Permissions head');
+        $this->titleForm = __('Permissions head');
         $this->classForm = 'editpermissions';
 
         return $this;
@@ -88,94 +89,94 @@ class Permissions extends Admin
             'btns'   => [
                 'save' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save changes'),
+                    'value'     => __('Save changes'),
                     'accesskey' => 's',
                 ],
             ],
         ];
 
-        $yn = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
+        $yn = [1 => __('Yes'), 0 => __('No')];
 
         $form['sets']['posting'] = [
-            'legend' => \ForkBB\__('Posting subhead'),
+            'legend' => __('Posting subhead'),
             'fields' => [
                 'p_message_bbcode' => [
                     'type'    => 'radio',
                     'value'   => $config->p_message_bbcode,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('BBCode label'),
-                    'info'    => \ForkBB\__('BBCode help'),
+                    'caption' => __('BBCode label'),
+                    'info'    => __('BBCode help'),
                 ],
                 'p_message_img_tag' => [
                     'type'    => 'radio',
                     'value'   => $config->p_message_img_tag,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Image tag label'),
-                    'info'    => \ForkBB\__('Image tag help'),
+                    'caption' => __('Image tag label'),
+                    'info'    => __('Image tag help'),
                 ],
                 'p_message_all_caps' => [
                     'type'    => 'radio',
                     'value'   => $config->p_message_all_caps,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('All caps message label'),
-                    'info'    => \ForkBB\__('All caps message help'),
+                    'caption' => __('All caps message label'),
+                    'info'    => __('All caps message help'),
                 ],
                 'p_subject_all_caps' => [
                     'type'    => 'radio',
                     'value'   => $config->p_subject_all_caps,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('All caps subject label'),
-                    'info'    => \ForkBB\__('All caps subject help'),
+                    'caption' => __('All caps subject label'),
+                    'info'    => __('All caps subject help'),
                 ],
                 'p_force_guest_email' => [
                     'type'    => 'radio',
                     'value'   => $config->p_force_guest_email,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Require e-mail label'),
-                    'info'    => \ForkBB\__('Require e-mail help'),
+                    'caption' => __('Require e-mail label'),
+                    'info'    => __('Require e-mail help'),
                 ],
             ],
         ];
 
         $form['sets']['signatures'] = [
-            'legend' => \ForkBB\__('Signatures subhead'),
+            'legend' => __('Signatures subhead'),
             'fields' => [
                 'p_sig_bbcode' => [
                     'type'    => 'radio',
                     'value'   => $config->p_sig_bbcode,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('BBCode sigs label'),
-                    'info'    => \ForkBB\__('BBCode sigs help'),
+                    'caption' => __('BBCode sigs label'),
+                    'info'    => __('BBCode sigs help'),
                 ],
                 'p_sig_img_tag' => [
                     'type'    => 'radio',
                     'value'   => $config->p_sig_img_tag,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Image tag sigs label'),
-                    'info'    => \ForkBB\__('Image tag sigs help'),
+                    'caption' => __('Image tag sigs label'),
+                    'info'    => __('Image tag sigs help'),
                 ],
                 'p_sig_all_caps' => [
                     'type'    => 'radio',
                     'value'   => $config->p_sig_all_caps,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('All caps sigs label'),
-                    'info'    => \ForkBB\__('All caps sigs help'),
+                    'caption' => __('All caps sigs label'),
+                    'info'    => __('All caps sigs help'),
                 ],
                 'p_sig_length' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 16000,
                     'value'   => $config->p_sig_length,
-                    'caption' => \ForkBB\__('Max sig length label'),
-                    'info'    => \ForkBB\__('Max sig length help'),
+                    'caption' => __('Max sig length label'),
+                    'info'    => __('Max sig length help'),
                 ],
                 'p_sig_lines' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 100,
                     'value'   => $config->p_sig_lines,
-                    'caption' => \ForkBB\__('Max sig lines label'),
-                    'info'    => \ForkBB\__('Max sig lines help'),
+                    'caption' => __('Max sig lines label'),
+                    'info'    => __('Max sig lines help'),
                 ],
 
             ],

+ 10 - 9
app/Models/Pages/Admin/Reports.php

@@ -6,6 +6,7 @@ use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
 use ForkBB\Models\Post\Model as Post;
 use ForkBB\Models\Report\Model as Report;
+use function \ForkBB\__;
 
 class Reports extends Admin
 {
@@ -77,11 +78,11 @@ class Reports extends Admin
         foreach ($reports as $report) {
             if ($noZapped) {
                 $cur = [
-                    'legend' => \ForkBB\__('Reported %s', \ForkBB\dt($report->created)),
+                    'legend' => __('Reported %s', \ForkBB\dt($report->created)),
                 ];
             } else {
                 $cur = [
-                    'legend' => \ForkBB\__('Marked as read %1$s by %2$s', \ForkBB\dt($report->zapped), $report->marker->username),
+                    'legend' => __('Marked as read %1$s by %2$s', \ForkBB\dt($report->zapped), $report->marker->username),
                 ];
             }
             $cur['fields'] = [];
@@ -90,7 +91,7 @@ class Reports extends Admin
                 'type'    => $author->isGuest ? 'str' : 'link',
                 'value'   => $author->username,
                 'title'   => $author->username,
-                'caption' => \ForkBB\__('Reported by'),
+                'caption' => __('Reported by'),
                 'href'    => $author->link,
             ];
             $post = $report->post;
@@ -99,25 +100,25 @@ class Reports extends Admin
                 $forum = $topic->parent;
                 $cur['fields']['post' . $report->id] = [
                     'type'    => 'str',
-                    'value'   => \ForkBB\__('Post #%s ', $post->id, $post->link, $topic->subject, $topic->link, $forum->forum_name, $forum->link),
+                    'value'   => __('Post #%s ', $post->id, $post->link, $topic->subject, $topic->link, $forum->forum_name, $forum->link),
                     'html'    => true,
                 ];
             } else {
                 $cur['fields']['post' . $report->id] = [
                     'type'    => 'str',
-                    'value'   => \ForkBB\__('Post #%s', $report->post_id),
+                    'value'   => __('Post #%s', $report->post_id),
                 ];
             }
             $cur['fields']['reason' . $report->id] = [
                 'type'    => 'str',
                 'value'   => $report->message,
-                'caption' => \ForkBB\__('Reason'),
+                'caption' => __('Reason'),
             ];
             if ($noZapped) {
                 $cur['fields']['zap' . $report->id] = [
                     'type'    => 'btn',
-                    'value'   => \ForkBB\__('Zap'),
-                    'title'   => \ForkBB\__('Zap'),
+                    'value'   => __('Zap'),
+                    'title'   => __('Zap'),
                     'link'    => $report->linkZap,
                 ];
             }
@@ -129,7 +130,7 @@ class Reports extends Admin
                 'info' => [
                     'info1' => [
                         'type'  => '', //????
-                        'value' => $noZapped ? \ForkBB\__('No new reports') : \ForkBB\__('No zapped reports'),
+                        'value' => $noZapped ? __('No new reports') : __('No zapped reports'),
                     ],
                 ],
             ];

+ 6 - 5
app/Models/Pages/Admin/Statistics.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages\Admin;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin;
+use function \ForkBB\__;
 
 class Statistics extends Admin
 {
@@ -49,7 +50,7 @@ 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'), \ForkBB\__('Server statistics')];
+        $this->aCrumbs[]  = [$this->c->Router->link('AdminStatistics'), __('Server statistics')];
         $this->phpinfo    = $phpinfo;
 
         return $this;
@@ -65,7 +66,7 @@ class Statistics extends Admin
         $this->c->Lang->load('admin_index');
 
         $this->nameTpl   = 'admin/statistics';
-        $this->aCrumbs[] = [$this->c->Router->link('AdminStatistics'), \ForkBB\__('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)
@@ -86,14 +87,14 @@ class Statistics extends Admin
             }
 
             $ave = @\explode(' ', $ave);
-            $this->serverLoad = isset($ave[2]) ? $ave[0].' '.$ave[1].' '.$ave[2] : \ForkBB\__('Not available');
+            $this->serverLoad = isset($ave[2]) ? $ave[0].' '.$ave[1].' '.$ave[2] : __('Not available');
         } elseif (
             ! \in_array(\PHP_OS, ['WINNT', 'WIN32'])
             && \preg_match('%averages?: ([\d\.]+),?\s+([\d\.]+),?\s+([\d\.]+)%i', @\exec('uptime'), $ave)
         ) {
             $this->serverLoad = $ave[1].' '.$ave[2].' '.$ave[3];
         } else {
-            $this->serverLoad = \ForkBB\__('Not available');
+            $this->serverLoad = __('Not available');
         }
 
         // Get number of current visitors
@@ -126,7 +127,7 @@ class Statistics extends Admin
             $this->accelerator = 'XCache';
             $this->linkAcc     = 'https://xcache.lighttpd.net/';
         } else {
-            $this->accelerator = \ForkBB\__('NA');
+            $this->accelerator = __('NA');
             $this->linkAcc     = null;
         }
 

+ 12 - 11
app/Models/Pages/Admin/Users.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Pages\Admin;
 use ForkBB\Core\Container;
 use ForkBB\Models\Pages\Admin;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 abstract class Users extends Admin
 {
@@ -94,7 +95,7 @@ abstract class Users extends Admin
         });
 
         if (! empty($bad)) {
-            $this->fIswev = ['v', \ForkBB\__('Action not available')];
+            $this->fIswev = ['v', __('Action not available')];
             return false;
         }
 
@@ -108,48 +109,48 @@ abstract class Users extends Admin
             switch ($action) {
                 case self::ACTION_BAN:
                     if ($this->c->bans->isBanned($user)) {
-                        $this->fIswev = ['i', \ForkBB\__('User is ban', $user->username)];
+                        $this->fIswev = ['i', __('User is ban', $user->username)];
                         return false;
                     }
                     if (! $this->c->userRules->canBanUser($user)) {
-                        $this->fIswev = ['v', \ForkBB\__('You are not allowed to ban the %s', $user->username)];
+                        $this->fIswev = ['v', __('You are not allowed to ban the %s', $user->username)];
                         if ($user->isAdmMod) {
-                            $this->fIswev = ['i', \ForkBB\__('No ban admins message')];
+                            $this->fIswev = ['i', __('No ban admins message')];
                         }
                         return false;
                     }
                     break;
                 case self::ACTION_DEL:
                     if (! $this->c->userRules->canDeleteUser($user)) {
-                        $this->fIswev = ['v', \ForkBB\__('You are not allowed to delete the %s', $user->username)];
+                        $this->fIswev = ['v', __('You are not allowed to delete the %s', $user->username)];
                         if ($user->isAdmMod) {
-                            $this->fIswev = ['i', \ForkBB\__('No delete admins message')];
+                            $this->fIswev = ['i', __('No delete admins message')];
                         }
                         return false;
                     }
                     break;
                 case self::ACTION_CHG:
                     if (! $this->c->userRules->canChangeGroup($user, $profile)) {
-                        $this->fIswev = ['v', \ForkBB\__('You are not allowed to change group for %s', $user->username)];
+                        $this->fIswev = ['v', __('You are not allowed to change group for %s', $user->username)];
                         if ($user->isAdmin) {
-                            $this->fIswev = ['i', \ForkBB\__('No move admins message')];
+                            $this->fIswev = ['i', __('No move admins message')];
                         }
                         return false;
                     }
                     break;
                 default:
-                    $this->fIswev = ['v', \ForkBB\__('Action not available')];
+                    $this->fIswev = ['v', __('Action not available')];
                     return false;
             }
 
             $result[] = $user->id;
             if ($user->id === $this->user->id) {
-                $this->fIswev = ['i', \ForkBB\__('You are trying to change your own group')];
+                $this->fIswev = ['i', __('You are trying to change your own group')];
             }
         }
 
         if (empty($result)) {
-            $this->fIswev = ['v', \ForkBB\__('No users selected')];
+            $this->fIswev = ['v', __('No users selected')];
             return false;
         }
 

+ 19 - 18
app/Models/Pages/Admin/Users/Action.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin\Users;
 use RuntimeException;
+use function \ForkBB\__;
 
 class Action extends Users
 {
@@ -148,8 +149,8 @@ class Action extends Users
 
         $this->nameTpl    = 'admin/form';
         $this->classForm  = 'delete-users';
-        $this->titleForm  = \ForkBB\__('Deleting users');
-        $this->aCrumbs[]  = [$this->c->Router->link('AdminUsersAction', $args), \ForkBB\__('Deleting users')];
+        $this->titleForm  = __('Deleting users');
+        $this->aCrumbs[]  = [$this->c->Router->link('AdminUsersAction', $args), __('Deleting users')];
         $this->form       = $this->formDelete($args);
 
         return $this;
@@ -164,7 +165,7 @@ class Action extends Users
      */
     protected function formDelete(array $args): array
     {
-        $yn    = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
+        $yn    = [1 => __('Yes'), 0 => __('No')];
         $names = \implode(', ', $this->nameList($this->userList));
         $form  = [
             'action' => $this->c->Router->link('AdminUsersAction', $args),
@@ -178,14 +179,14 @@ class Action extends Users
                             'type'    => 'radio',
                             'value'   => 0,
                             'values'  => $yn,
-                            'caption' => \ForkBB\__('Delete users'),
-                            'info'    => \ForkBB\__('Confirm delete info', $names),
+                            'caption' => __('Delete users'),
+                            'info'    => __('Confirm delete info', $names),
                         ],
                         'delete_posts' => [
                             'type'    => 'radio',
                             'value'   => 0,
                             'values'  => $yn,
-                            'caption' => \ForkBB\__('Delete posts'),
+                            'caption' => __('Delete posts'),
                         ],
                     ],
                 ],
@@ -193,7 +194,7 @@ class Action extends Users
                     'info' => [
                         'info2' => [
                             'type'    => '', //????
-                            'value'   => \ForkBB\__('Delete warning'),
+                            'value'   => __('Delete warning'),
                             'html'    => true,
                         ],
                     ],
@@ -202,12 +203,12 @@ class Action extends Users
             'btns'   => [
                 'delete'  => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Delete users'),
+                    'value'     => __('Delete users'),
                     'accesskey' => 'd',
                 ],
                 'cancel'  => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('Cancel'),
+                    'value'     => __('Cancel'),
                     'link'      => $this->c->Router->link('AdminUsers'),
                 ],
             ],
@@ -309,8 +310,8 @@ class Action extends Users
 
         $this->nameTpl    = 'admin/form';
         $this->classForm  = 'change-group';
-        $this->titleForm  = \ForkBB\__('Change user group');
-        $this->aCrumbs[]  = [$this->c->Router->link('AdminUsersAction', $args), \ForkBB\__('Change user 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;
@@ -345,7 +346,7 @@ class Action extends Users
      */
     protected function formChange(array $args, bool $profile, string $linkCancel, bool $checkPass): array
     {
-        $yn    = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
+        $yn    = [1 => __('Yes'), 0 => __('No')];
         $names = \implode(', ', $this->nameList($this->userList));
         $form  = [
             'action' => $this->c->Router->link('AdminUsersAction', $args),
@@ -359,14 +360,14 @@ class Action extends Users
                             'type'      => 'select',
                             'options'   => $this->groupListForChange($profile),
                             'value'     => $this->c->config->o_default_user_group,
-                            'caption'   => \ForkBB\__('New group label'),
-                            'info'      => \ForkBB\__('New group help', $names),
+                            'caption'   => __('New group label'),
+                            'info'      => __('New group help', $names),
                         ],
                         'confirm' => [
                             'type'    => 'radio',
                             'value'   => 0,
                             'values'  => $yn,
-                            'caption' => \ForkBB\__('Move users'),
+                            'caption' => __('Move users'),
                         ],
                     ],
                 ],
@@ -374,12 +375,12 @@ class Action extends Users
             'btns'   => [
                 'move'  => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Move users'),
+                    'value'     => __('Move users'),
                     'accesskey' => 'm',
                 ],
                 'cancel'  => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('Cancel'),
+                    'value'     => __('Cancel'),
                     'link'      => $linkCancel,
                 ],
             ],
@@ -388,7 +389,7 @@ class Action extends Users
         if ($checkPass) {
             $form['sets']['options']['fields']['password'] = [
                 'type'      => 'password',
-                'caption'   => \ForkBB\__('Your passphrase'),
+                'caption'   => __('Your passphrase'),
                 'required'  => true,
             ];
         }

+ 10 - 9
app/Models/Pages/Admin/Users/NewUser.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin\Users;
 use RuntimeException;
+use function \ForkBB\__;
 
 class NewUser extends Users
 {
@@ -72,7 +73,7 @@ class NewUser extends Users
 
         $this->nameTpl    = 'admin/users';
         $this->formNew    = $this->formNew($data);
-        $this->aCrumbs[]  = [$this->c->Router->link('AdminUsersNew'), \ForkBB\__('Add user')];
+        $this->aCrumbs[]  = [$this->c->Router->link('AdminUsersNew'), __('Add user')];
 
 
         return $this;
@@ -94,15 +95,15 @@ class NewUser extends Users
             ],
             'sets'   => [
                 'reg' => [
-                    'legend' => \ForkBB\__('Add user legend'),
+                    'legend' => __('Add user legend'),
                     'fields' => [
                         'username' => [
                             'autofocus' => true,
                             'type'      => 'text',
                             'maxlength' => 25,
                             'value'     => $data['username'] ?? null,
-                            'caption'   => \ForkBB\__('Username'),
-                            'info'      => \ForkBB\__('Login format'),
+                            'caption'   => __('Username'),
+                            'info'      => __('Login format'),
                             'required'  => true,
                             'pattern'   => '^.{2,25}$',
                         ],
@@ -110,15 +111,15 @@ class NewUser extends Users
                             'type'      => 'text',
                             'maxlength' => 80,
                             'value'     => $data['email'] ?? null,
-                            'caption'   => \ForkBB\__('Email'),
-                            'info'      => \ForkBB\__('Email info'),
+                            'caption'   => __('Email'),
+                            'info'      => __('Email info'),
                             'required'  => true,
                             'pattern'   => '.+@.+',
                         ],
                         'password' => [
                             'type'      => 'text',
-                            'caption'   => \ForkBB\__('Passphrase'),
-                            'info'      => \ForkBB\__('Pass format') . ' ' . \ForkBB\__('Pass info'),
+                            'caption'   => __('Passphrase'),
+                            'info'      => __('Pass format') . ' ' . __('Pass info'),
                             'required'  => true,
                             'pattern'   => '^.{16,}$',
                         ],
@@ -128,7 +129,7 @@ class NewUser extends Users
             'btns'   => [
                 'add' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Add'),
+                    'value'     => __('Add'),
                     'accesskey' => 's',
                 ],
             ],

+ 16 - 15
app/Models/Pages/Admin/Users/Result.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin\Users;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Result extends Users
 {
@@ -33,13 +34,13 @@ class Result extends Users
             $crName = $data['ip'];
         } else {
             $idsN   = $this->forFilter($data);
-            $crName = \ForkBB\__('Results head');
+            $crName = __('Results head');
         }
 
         $number = \count($idsN);
         if (0 == $number) {
             $view = $this->c->AdminUsers;
-            $view->fIswev = ['i', \ForkBB\__('No users found')];
+            $view->fIswev = ['i', __('No users found')];
 
             return $view->view([], 'GET', $data);
         }
@@ -90,7 +91,7 @@ class Result extends Users
                 ) {
                     $action = self::ACTION_CHG;
                 } else {
-                    $this->fIswev = ['v', \ForkBB\__('Action not available')];
+                    $this->fIswev = ['v', __('Action not available')];
                 }
 
                 if (empty($this->fIswev)) {
@@ -236,21 +237,21 @@ class Result extends Users
         if ($this->c->userRules->banUsers) {
             $form['btns']['ban'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Ban'),
+                'value'     => __('Ban'),
                 'accesskey' => null,
             ];
         }
         if ($this->c->userRules->deleteUsers) {
             $form['btns']['delete'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Delete'),
+                'value'     => __('Delete'),
                 'accesskey' => null,
             ];
         }
         if ($this->c->userRules->changeGroup) {
             $form['btns']['change_group'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Change group'),
+                'value'     => __('Change group'),
                 'accesskey' => null,
             ];
         }
@@ -274,14 +275,14 @@ class Result extends Users
             $fields["l{$number}-username"] = [
                 'class'   => ['result', 'username'],
                 'type'    => $user->isGuest ? 'str' : 'link',
-                'caption' => \ForkBB\__('Results username head'),
+                'caption' => __('Results username head'),
                 'value'   => $user->username,
                 'href'    => $user->link,
             ];
             $fields["l{$number}-email"] = [
                 'class'   => $user->isGuest ? ['result', 'email', 'no-data'] : ['result', 'email'],
                 'type'    => $user->isGuest ? 'str' : 'link',
-                'caption' => \ForkBB\__('Results e-mail head'),
+                'caption' => __('Results e-mail head'),
                 'value'   => $user->isGuest ? '' : $user->email,
                 'href'    => $user->isGuest ? '' : 'mailto:' . $user->email,
             ];
@@ -291,21 +292,21 @@ class Result extends Users
             $fields["l{$number}-title"] = [
                 'class'   => ['result', 'title'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results title head'),
+                'caption' => __('Results title head'),
                 'value'   => -1 === $user->id ? null : $user->title(),
             ];
             $fields["l{$number}-posts"] = [
                 'class'   => $user->isGuest ? ['result', 'posts', 'no-data'] : ['result', 'posts'],
                 'type'    => $user->num_posts ? 'link' : 'str',
-                'caption' => \ForkBB\__('Results posts head'),
+                'caption' => __('Results posts head'),
                 'value'   => $user->num_posts ? \ForkBB\num($user->num_posts) : null,
                 'href'    => $this->c->Router->link('SearchAction', ['action' => 'posts', 'uid' => $user->id]),
-                'title'   => \ForkBB\__('Results show posts link'),
+                'title'   => __('Results show posts link'),
             ];
             $fields["l{$number}-note"] = [
                 'class'   => '' === \trim($user->admin_note) ? ['result', 'note', 'no-data'] : ['result', 'note'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Примечание админа'),
+                'caption' => __('Примечание админа'),
                 'value'   => $user->admin_note,
             ];
 
@@ -313,8 +314,8 @@ class Result extends Users
                 $fields["l{$number}-view-ip"] = [
                     'class'   => $user->isGuest ? ['result', 'view-ip', 'no-data'] : ['result', 'view-ip'],
                     'type'    => $user->isGuest || ! $user->num_posts ? 'str' : 'link',
-                    'caption' => \ForkBB\__('Results action head'),
-                    'value'   => $user->isGuest ? null : \ForkBB\__('Results view IP link'),
+                    'caption' => __('Results action head'),
+                    'value'   => $user->isGuest ? null : __('Results view IP link'),
                     'href'    => $this->c->Router->link('AdminUserStat', ['id' => $user->id]),
                 ];
             }
@@ -325,7 +326,7 @@ class Result extends Users
             $key = $user->isGuest ? "guest{$number}" : "users[{$user->id}]";
             $fields[$key] = [
                 'class'   => ['check'],
-                'caption' => \ForkBB\__('Select'),
+                'caption' => __('Select'),
                 'type'    => $user->isGuest ? 'str' : 'checkbox',
                 'value'   => $user->isGuest ? null : $user->id,
                 'checked' => false,

+ 7 - 6
app/Models/Pages/Admin/Users/Stat.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Pages\Admin\Users;
 use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin\Users;
+use function \ForkBB\__;
 
 class Stat extends Users
 {
@@ -34,7 +35,7 @@ class Stat extends Users
         $user = $this->c->users->load((int) $args['id']);
 
         if (0 == $number) {
-            $this->fIswev = ['i', \ForkBB\__('Results no posts found')];
+            $this->fIswev = ['i', __('Results no posts found')];
         }
 
         $this->nameTpl    = 'admin/users_result';
@@ -72,27 +73,27 @@ class Stat extends Users
             $fields["l{$number}-ip"] = [
                 'class'   => ['result', 'ip'],
                 'type'    => $flag ? 'link' : 'str',
-                'caption' => \ForkBB\__('Results IP address head'),
+                'caption' => __('Results IP address head'),
                 'value'   => $flag ? $ip : null,
                 'href'    => $flag ? $this->c->Router->link('AdminHost', ['ip' => $ip]) : null,
             ];
             $fields["l{$number}-last-used"] = [
                 'class'   => ['result', 'last-used'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results last used head'),
+                'caption' => __('Results last used head'),
                 'value'   => $flag ? \ForkBB\dt($data['last_used']) : null,
             ];
             $fields["l{$number}-used-times"] = [
                 'class'   => ['result', 'used-times'],
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Results times found head'),
+                'caption' => __('Results times found head'),
                 'value'   => $flag ? \ForkBB\num($data['used_times']) : null,
             ];
             $fields["l{$number}-action"] = [
                 'class'   => ['result', 'action'],
                 'type'    => $flag ? 'link' : 'str',
-                'caption' => \ForkBB\__('Results action head'),
-                'value'   => $flag ? \ForkBB\__('Results find more link') : null,
+                'caption' => __('Results action head'),
+                'value'   => $flag ? __('Results find more link') : null,
                 'href'    => $flag ? $this->c->Router->link('AdminUsersResult', ['data' => $this->encodeData($ip)]) : null,
             ];
 

+ 38 - 37
app/Models/Pages/Admin/Users/View.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Pages\Admin\Users;
 use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin\Users;
+use function \ForkBB\__;
 
 class View extends Users
 {
@@ -18,8 +19,8 @@ class View extends Users
     protected function groups(bool $onlyKeys = false): array
     {
         $groups = [
-            -1 => \ForkBB\__('All groups'),
-            0  => \ForkBB\__('Unverified users'),
+            -1 => __('All groups'),
+            0  => __('Unverified users'),
         ];
 
         foreach ($this->c->groups->getList() as $group) {
@@ -53,7 +54,7 @@ class View extends Users
                 $ip = \filter_var($v->ip, \FILTER_VALIDATE_IP);
 
                 if (false === $ip) {
-                    $this->fIswev = ['v', \ForkBB\__('Bad IP message')];
+                    $this->fIswev = ['v', __('Bad IP message')];
                     $data         = $v->getData();
                 } else {
                     return $this->c->Redirect->page('AdminUsersResult', ['data' => $this->encodeData($ip)]);
@@ -145,7 +146,7 @@ class View extends Users
             'btns'   => [
                 'new' => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('New user'),
+                    'value'     => __('New user'),
                     'link'      => $this->c->Router->link('AdminUsersNew'),
                     'accesskey' => 'n',
                 ],
@@ -173,7 +174,7 @@ class View extends Users
             'btns'   => [
                 'search' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Submit search'),
+                    'value'     => __('Submit search'),
                     'accesskey' => 's',
                 ],
             ],
@@ -182,7 +183,7 @@ class View extends Users
             'info' => [
                 'info1' => [
                     'type'  => '', //????
-                    'value' => \ForkBB\__('User search info'),
+                    'value' => __('User search info'),
                 ],
             ],
         ];
@@ -190,62 +191,62 @@ class View extends Users
         $fields['username'] = [
             'type'      => 'text',
             'maxlength' => 25,
-            'caption'   => \ForkBB\__('Username label'),
+            'caption'   => __('Username label'),
             'value'     => $data['username'] ?? null,
         ];
         $fields['email'] = [
             'type'      => 'text',
             'maxlength' => 80,
-            'caption'   => \ForkBB\__('E-mail address label'),
+            'caption'   => __('E-mail address label'),
             'value'     => $data['email'] ?? null,
         ];
         $fields['title'] = [
             'type'      => 'text',
             'maxlength' => 50,
-            'caption'   => \ForkBB\__('Title label'),
+            'caption'   => __('Title label'),
             'value'     => $data['title'] ?? null,
         ];
         $fields['realname'] = [
             'type'      => 'text',
             'maxlength' => 40,
-            'caption'   => \ForkBB\__('Real name label'),
+            'caption'   => __('Real name label'),
             'value'     => $data['realname'] ?? null,
         ];
         $genders = [
-            0 => \ForkBB\__('Do not display'),
-            1 => \ForkBB\__('Male'),
-            2 => \ForkBB\__('Female'),
+            0 => __('Do not display'),
+            1 => __('Male'),
+            2 => __('Female'),
         ];
         $fields['gender'] = [
 #            'class'   => 'block',
             'type'    => 'radio',
             'value'   => $data['gender'] ?? -1,
             'values'  => $genders,
-            'caption' => \ForkBB\__('Gender label'),
+            'caption' => __('Gender label'),
         ];
         $fields['url'] = [
             'id'        => 'website',
             'type'      => 'text',
             'maxlength' => 100,
-            'caption'   => \ForkBB\__('Website label'),
+            'caption'   => __('Website label'),
             'value'     => $data['url'] ?? null,
         ];
         $fields['location'] = [
             'type'      => 'text',
             'maxlength' => 30,
-            'caption'   => \ForkBB\__('Location label'),
+            'caption'   => __('Location label'),
             'value'     => $data['location'] ?? null,
         ];
         $fields['signature'] = [
             'type'      => 'text',
             'maxlength' => 512,
-            'caption'   => \ForkBB\__('Signature label'),
+            'caption'   => __('Signature label'),
             'value'     => $data['signature'] ?? null,
         ];
         $fields['admin_note'] = [
             'type'      => 'text',
             'maxlength' => 30,
-            'caption'   => \ForkBB\__('Admin note label'),
+            'caption'   => __('Admin note label'),
             'value'     => $data['admin_note'] ?? null,
         ];
         $fields['between1'] = [
@@ -258,7 +259,7 @@ class View extends Users
             'min'     => 0,
             'max'     => 9999999999,
             'value'   => $data['num_posts_1'] ?? null,
-            'caption' => \ForkBB\__('Posts label'),
+            'caption' => __('Posts label'),
         ];
         $fields['num_posts_2'] = [
             'type'    => 'number',
@@ -279,7 +280,7 @@ class View extends Users
             'type'      => 'text',
             'maxlength' => 100,
             'value'     => $data['last_post_1'] ?? null,
-            'caption'   => \ForkBB\__('Last post label'),
+            'caption'   => __('Last post label'),
         ];
         $fields['last_post_2'] = [
             'class'     => 'bend',
@@ -299,7 +300,7 @@ class View extends Users
             'type'      => 'text',
             'maxlength' => 100,
             'value'     => $data['last_visit_1'] ?? null,
-            'caption'   => \ForkBB\__('Last visit label'),
+            'caption'   => __('Last visit label'),
         ];
         $fields['last_visit_2'] = [
             'class'     => 'bend',
@@ -319,7 +320,7 @@ class View extends Users
             'type'      => 'text',
             'maxlength' => 100,
             'value'     => $data['registered_1'] ?? null,
-            'caption'   => \ForkBB\__('Registered label'),
+            'caption'   => __('Registered label'),
         ];
         $fields['registered_2'] = [
             'class'     => 'bend',
@@ -331,7 +332,7 @@ class View extends Users
             'type' => 'endwrap',
         ];
         $form['sets']['filters'] = [
-            'legend' => \ForkBB\__('User search subhead'),
+            'legend' => __('User search subhead'),
             'fields' => $fields,
         ];
 
@@ -344,22 +345,22 @@ class View extends Users
             'class'   => 'bstart',
             'type'    => 'select',
             'options' => [
-                'username'   => \ForkBB\__('Order by username'),
-                'email'      => \ForkBB\__('Order by e-mail'),
-                'num_posts'  => \ForkBB\__('Order by posts'),
-                'last_post'  => \ForkBB\__('Order by last post'),
-                'last_visit' => \ForkBB\__('Order by last visit'),
-                'registered' => \ForkBB\__('Order by registered'),
+                'username'   => __('Order by username'),
+                'email'      => __('Order by e-mail'),
+                'num_posts'  => __('Order by posts'),
+                'last_post'  => __('Order by last post'),
+                'last_visit' => __('Order by last visit'),
+                'registered' => __('Order by registered'),
             ],
             'value'   => $data['order_by'] ?? 'registered',
-            'caption' => \ForkBB\__('Order by label'),
+            'caption' => __('Order by label'),
         ];
         $fields['direction'] = [
             'class'   => 'bend',
             'type'    => 'select',
             'options' => [
-                'ASC'  => \ForkBB\__('Ascending'),
-                'DESC' => \ForkBB\__('Descending'),
+                'ASC'  => __('Ascending'),
+                'DESC' => __('Descending'),
             ],
             'value'   => $data['direction'] ?? 'DESC',
         ];
@@ -370,11 +371,11 @@ class View extends Users
             'type'    => 'select',
             'options' => $this->groups(),
             'value'   => $data['user_group'] ?? -1,
-            'caption' => \ForkBB\__('User group label'),
+            'caption' => __('User group label'),
         ];
 
         $form['sets']['sorting'] = [
-            'legend' => \ForkBB\__('Search results legend'),
+            'legend' => __('Search results legend'),
             'fields' => $fields,
         ];
 
@@ -399,7 +400,7 @@ class View extends Users
             'btns'   => [
                 'find' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Find IP address'),
+                    'value'     => __('Find IP address'),
                     'accesskey' => 'f',
                 ],
             ],
@@ -408,12 +409,12 @@ class View extends Users
         $fields['ip'] = [
             'type'      => 'text',
             'maxlength' => 49,
-            'caption'   => \ForkBB\__('IP address label'),
+            'caption'   => __('IP address label'),
             'value'     => $data['ip'] ?? null,
             'required'  => true,
         ];
         $form['sets']['ip'] = [
-            'legend' => \ForkBB\__('IP search subhead'),
+            'legend' => __('IP search subhead'),
             'fields' => $fields,
         ];
 

+ 22 - 21
app/Models/Pages/Auth.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Core\Exceptions\MailException;
 use ForkBB\Models\Page;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Auth extends Page
 {
@@ -71,7 +72,7 @@ class Auth extends Page
         $this->nameTpl    = 'login';
         $this->onlinePos  = 'login';
         $this->robots     = 'noindex';
-        $this->titles     = \ForkBB\__('Login');
+        $this->titles     = __('Login');
         $this->regLink    = '1' == $this->c->config->o_regs_allow ? $this->c->Router->link('Register') : null;
 
         $username         = $v ? $v->username : ($args['_username'] ?? '');
@@ -106,20 +107,20 @@ class Auth extends Page
                             'autofocus' => true,
                             'type'      => 'text',
                             'value'     => $username,
-                            'caption'   => \ForkBB\__('Username'),
+                            'caption'   => __('Username'),
                             'required'  => true,
                         ],
                         'password' => [
                             'id'        => 'passinlogin',
                             'autofocus' => true,
                             'type'      => 'password',
-                            'caption'   => \ForkBB\__('Passphrase'),
-                            'info'      => \ForkBB\__('<a href="%s">Forgotten?</a>', $this->c->Router->link('Forget')),
+                            'caption'   => __('Passphrase'),
+                            'info'      => __('<a href="%s">Forgotten?</a>', $this->c->Router->link('Forget')),
                             'required'  => true,
                         ],
                         'save' => [
                             'type'    => 'checkbox',
-                            'label'   => \ForkBB\__('Remember me'),
+                            'label'   => __('Remember me'),
                             'value'   => '1',
                             'checked' => $save,
                         ],
@@ -129,7 +130,7 @@ class Auth extends Page
             'btns'   => [
                 'login' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Sign in'),
+                    'value'     => __('Sign in'),
                     'accesskey' => 's',
                 ],
             ],
@@ -217,7 +218,7 @@ class Auth extends Page
                 $link = $this->c->Router->link('ChangePassword', ['id' => $tmpUser->id, 'key' => $key, 'hash' => $hash]);
                 $tplData = [
                     'fRootLink' => $this->c->Router->link('Index'),
-                    'fMailer'   => \ForkBB\__('Mailer', $this->c->config->o_board_title),
+                    'fMailer'   => __('Mailer', $this->c->config->o_board_title),
                     'username'  => $tmpUser->username,
                     'link'      => $link,
                 ];
@@ -228,7 +229,7 @@ class Auth extends Page
                         ->setFolder($this->c->DIR_LANG)
                         ->setLanguage($tmpUser->language)
                         ->setTo($tmpUser->email, $tmpUser->username)
-                        ->setFrom($this->c->config->o_webmaster_email, \ForkBB\__('Mailer', $this->c->config->o_board_title))
+                        ->setFrom($this->c->config->o_webmaster_email, __('Mailer', $this->c->config->o_board_title))
                         ->setTpl('passphrase_reset.tpl', $tplData)
                         ->send();
                 } catch (MailException $e) {
@@ -241,9 +242,9 @@ class Auth extends Page
 
                     $this->c->users->update($tmpUser);
 
-                    return $this->c->Message->message(\ForkBB\__('Forget mail', $this->c->config->o_admin_email), false, 200);
+                    return $this->c->Message->message(__('Forget mail', $this->c->config->o_admin_email), false, 200);
                 } else {
-                    return $this->c->Message->message(\ForkBB\__('Error mail', $this->c->config->o_admin_email), true, 424);
+                    return $this->c->Message->message(__('Error mail', $this->c->config->o_admin_email), true, 424);
                 }
             }
 
@@ -254,7 +255,7 @@ class Auth extends Page
         $this->nameTpl    = 'passphrase_reset';
         $this->onlinePos  = 'passphrase_reset';
         $this->robots     = 'noindex';
-        $this->titles     = \ForkBB\__('Passphrase reset');
+        $this->titles     = __('Passphrase reset');
 
         $email            = $v ? $v->email : ($args['_email'] ?? '');
         $this->form       = $this->formForget($email);
@@ -284,8 +285,8 @@ class Auth extends Page
                             'type'      => 'text',
                             'maxlength' => 80,
                             'value'     => $email,
-                            'caption'   => \ForkBB\__('Email'),
-                            'info'      => \ForkBB\__('Passphrase reset info'),
+                            'caption'   => __('Email'),
+                            'info'      => __('Passphrase reset info'),
                             'required'  => true,
                             'pattern'   => '.+@.+',
                         ],
@@ -295,7 +296,7 @@ class Auth extends Page
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Send email'),
+                    'value'     => __('Send email'),
                     'accesskey' => 's',
                 ],
             ],
@@ -348,7 +349,7 @@ class Auth extends Page
 
                 $this->c->users->update($user);
 
-                $this->fIswev = ['s', \ForkBB\__('Pass updated')];
+                $this->fIswev = ['s', __('Pass updated')];
                 return $this->login([], 'GET');
             }
 
@@ -361,14 +362,14 @@ class Auth extends Page
 
             $this->c->users->update($user);
 
-            $this->fIswev = ['i', \ForkBB\__('Account activated')];
+            $this->fIswev = ['i', __('Account activated')];
         }
 
         $this->fIndex     = 'login';
         $this->nameTpl    = 'change_passphrase';
         $this->onlinePos  = 'change_passphrase';
         $this->robots     = 'noindex';
-        $this->titles     = \ForkBB\__('Passphrase reset');
+        $this->titles     = __('Passphrase reset');
         $this->form       = $this->formChange($args);
 
         return $this;
@@ -394,15 +395,15 @@ class Auth extends Page
                         'password' => [
                             'autofocus' => true,
                             'type'      => 'password',
-                            'caption'   => \ForkBB\__('New pass'),
+                            'caption'   => __('New pass'),
                             'required'  => true,
                             'pattern'   => '^.{16,}$',
                         ],
                         'password2' => [
                             'autofocus' => true,
                             'type'      => 'password',
-                            'caption'   => \ForkBB\__('Confirm new pass'),
-                            'info'      => \ForkBB\__('Pass format') . ' ' . \ForkBB\__('Pass info'),
+                            'caption'   => __('Confirm new pass'),
+                            'info'      => __('Pass format') . ' ' . __('Pass info'),
                             'required'  => true,
                             'pattern'   => '^.{16,}$',
                         ],
@@ -412,7 +413,7 @@ class Auth extends Page
             'btns'   => [
                 'login' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Change passphrase'),
+                    'value'     => __('Change passphrase'),
                     'accesskey' => 's',
                 ],
             ],

+ 2 - 1
app/Models/Pages/Ban.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Ban extends Page
 {
@@ -20,7 +21,7 @@ class Ban extends Page
         $this->nameTpl    = 'ban';
 #       $this->onlinePos  = 'ban';
 #       $this->robots     = 'noindex';
-        $this->titles     = \ForkBB\__('Info');
+        $this->titles     = __('Info');
         $this->ban        = $user->banInfo;
         $this->adminEmail = $this->c->config->o_admin_email;
         $this->bannedIp   = $user->isGuest;

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

@@ -17,7 +17,7 @@ class Debug extends Page
             $this->numQueries = $this->c->DB->getCount();
 
             if ($this->c->DEBUG > 1 ) {
-                $total = 0;
+                $total   = 0;
                 $queries = $this->c->DB->getQueries();
                 foreach ($queries as $cur) {
                     $total += $cur[1];

+ 8 - 7
app/Models/Pages/Delete.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\Post\Model as Post;
+use function \ForkBB\__;
 
 class Delete extends Page
 {
@@ -64,10 +65,10 @@ class Delete extends Page
         $this->onlinePos  = 'topic-' . $topic->id;
         $this->canonical  = $post->linkDelete;
         $this->robots     = 'noindex';
-        $this->formTitle  = \ForkBB\__($deleteTopic ? 'Delete topic' : 'Delete post');
+        $this->formTitle  = __($deleteTopic ? 'Delete topic' : 'Delete post');
         $this->crumbs     = $this->crumbs($this->formTitle, $topic);
         $this->posts      = [$post];
-        $this->postsTitle = \ForkBB\__('Delete info');
+        $this->postsTitle = __('Delete info');
         $this->form       = $this->formDelete($args, $post, $deleteTopic);
 
         return $this;
@@ -94,11 +95,11 @@ class Delete extends Page
                     'info' => [
                         'info1' => [
                             'type'    => '', //????
-                            'value'   => \ForkBB\__('Topic') . ' «' . \ForkBB\cens($post->parent->subject) . '»',
+                            'value'   => __('Topic') . ' «' . \ForkBB\cens($post->parent->subject) . '»',
                         ],
                         'info2' => [
                             'type'    => '', //????
-                            'value'   => \ForkBB\__($deleteTopic ? 'Topic by' : 'Reply by', $post->poster, \ForkBB\dt($post->posted)),
+                            'value'   => __($deleteTopic ? 'Topic by' : 'Reply by', $post->poster, \ForkBB\dt($post->posted)),
                             'html'    => true,
                         ],
                     ],
@@ -107,7 +108,7 @@ class Delete extends Page
                     'fields' => [
                         'confirm' => [
                             'type'    => 'checkbox',
-                            'label'   => \ForkBB\__($deleteTopic ? 'Confirm delete topic' : 'Confirm delete post'),
+                            'label'   => __($deleteTopic ? 'Confirm delete topic' : 'Confirm delete post'),
                             'value'   => '1',
                             'checked' => false,
                         ],
@@ -117,12 +118,12 @@ class Delete extends Page
             'btns'   => [
                 'delete'  => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__($deleteTopic ? 'Delete  topic' : 'Delete  post'),
+                    'value'     => __($deleteTopic ? 'Delete  topic' : 'Delete  post'),
                     'accesskey' => 'd',
                 ],
                 'cancel'  => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('Cancel'),
+                    'value'     => __('Cancel'),
                     'link'      => $this->c->Router->link('ViewPost', $args),
                 ],
             ],

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

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Pages;
 use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Post\Model as Post;
+use function \ForkBB\__;
 
 class Edit extends Page
 {
@@ -69,7 +70,7 @@ class Edit extends Page
         $this->onlinePos = 'topic-' . $topic->id;
         $this->canonical = $post->linkEdit;
         $this->robots    = 'noindex';
-        $this->formTitle = $editSubject ? \ForkBB\__('Edit topic') : \ForkBB\__('Edit post');
+        $this->formTitle = $editSubject ? __('Edit topic') : __('Edit post');
         $this->crumbs    = $this->crumbs($this->formTitle, $topic);
         $this->form      = $this->messageForm($args, $post, 'EditPost', true, $editSubject);
 

+ 7 - 6
app/Models/Pages/Forum.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\Forum\Model as ForumModel;
+use function \ForkBB\__;
 
 class Forum extends Page
 {
@@ -43,7 +44,7 @@ class Forum extends Page
         $this->crumbs     = $this->crumbs($forum);
 
         if (empty($this->topics)) {
-            $this->fIswev = ['i', \ForkBB\__('Empty forum')];
+            $this->fIswev = ['i', __('Empty forum')];
         } elseif (
             $this->user->isAdmin
             || $this->user->isModerator($forum)
@@ -79,23 +80,23 @@ class Forum extends Page
             'btns'   => [
                 'open' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Open'),
+                    'value'     => __('Open'),
                 ],
                 'close' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Close'),
+                    'value'     => __('Close'),
                 ],
                 'delete' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Delete'),
+                    'value'     => __('Delete'),
                 ],
                 'move' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Move'),
+                    'value'     => __('Move'),
                 ],
                 'merge' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Merge'),
+                    'value'     => __('Merge'),
                 ],
             ],
         ];

+ 4 - 2
app/Models/Pages/Index.php

@@ -3,6 +3,7 @@
 namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
+use function \ForkBB\__;
 
 class Index extends Page
 {
@@ -23,14 +24,15 @@ class Index extends Page
                     'name' => $this->c->stats->userLast['username'],
                 ]),
                 $this->c->stats->userLast['username'],
-            ] : $this->c->stats->userLast['username'];
+            ]
+            : $this->c->stats->userLast['username'];
 
         // для таблицы разделов
         $root   = $this->c->forums->loadTree(0);
         $forums = empty($root) ? [] : $root->subforums;
         $ctgs   = [];
         if (empty($forums)) {
-            $this->fIswev = ['i', \ForkBB\__('Empty board')];
+            $this->fIswev = ['i', __('Empty board')];
         } else {
             foreach($forums as $forum) {
                 $ctgs[$forum->cat_id][] = $forum;

+ 56 - 55
app/Models/Pages/Install.php

@@ -7,6 +7,7 @@ use ForkBB\Models\Page;
 use PDO;
 use PDOException;
 use RuntimeException;
+use function \ForkBB\__;
 
 class Install extends Page
 {
@@ -85,13 +86,13 @@ class Install extends Page
 
         // версия PHP
         if (\version_compare(\PHP_VERSION, self::PHP_MIN, '<')) {
-            $this->fIswev = ['e', \ForkBB\__('You are running error', 'PHP', \PHP_VERSION, $this->c->FORK_REVISION, self::PHP_MIN)];
+            $this->fIswev = ['e', __('You are running error', 'PHP', \PHP_VERSION, $this->c->FORK_REVISION, self::PHP_MIN)];
         }
 
         // типы БД
         $this->dbTypes = $this->DBTypes();
         if (empty($this->dbTypes)) {
-            $this->fIswev = ['e', \ForkBB\__('No DB extensions')];
+            $this->fIswev = ['e', __('No DB extensions')];
         }
 
         // доступность папок на запись
@@ -103,27 +104,27 @@ class Install extends Page
         foreach ($folders as $folder) {
             if (! \is_writable($folder)) {
                 $folder = \str_replace(\dirname($this->c->DIR_APP), '', $folder);
-                $this->fIswev = ['e', \ForkBB\__('Alert folder', $folder)];
+                $this->fIswev = ['e', __('Alert folder', $folder)];
             }
         }
 
         // доступность шаблона конфигурации
         $config = @\file_get_contents($this->c->DIR_CONFIG . '/main.dist.php');
         if (false === $config) {
-            $this->fIswev = ['e', \ForkBB\__('No access to main.dist.php')];
+            $this->fIswev = ['e', __('No access to main.dist.php')];
         }
         unset($config);
 
         // языки
         $langs = $this->c->Func->getNameLangs();
         if (empty($langs)) {
-            $this->fIswev = ['e', \ForkBB\__('No language packs')];
+            $this->fIswev = ['e', __('No language packs')];
         }
 
         // стили
         $styles = $this->c->Func->getStyles();
         if (empty($styles)) {
-            $this->fIswev = ['e', \ForkBB\__('No styles')];
+            $this->fIswev = ['e', __('No styles')];
         }
 
         $fIswev = $this->getAttr('fIswev'); // ????
@@ -190,8 +191,8 @@ class Install extends Page
                                 'type'    => 'select',
                                 'options' => $langs,
                                 'value'   => $this->user->language,
-                                'caption' => \ForkBB\__('Install language'),
-                                'info'    => \ForkBB\__('Choose install language info'),
+                                'caption' => __('Install language'),
+                                'info'    => __('Choose install language info'),
                             ],
                         ],
                     ],
@@ -199,7 +200,7 @@ class Install extends Page
                 'btns'   => [
                     'changelang'  => [
                         'type'  => 'submit',
-                        'value' => \ForkBB\__('Change language'),
+                        'value' => __('Change language'),
                     ],
                 ],
             ];
@@ -216,12 +217,12 @@ class Install extends Page
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Database setup'),
+                            'value' => __('Database setup'),
                             'html'  => true,
                         ],
                         'info2' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Info 1'),
+                            'value' => __('Info 1'),
                         ],
                     ],
                 ],
@@ -231,41 +232,41 @@ class Install extends Page
                             'type'     => 'select',
                             'options'  => $this->dbTypes,
                             'value'    => $v ? $v->dbtype : 'mysql_innodb',
-                            'caption'  => \ForkBB\__('Database type'),
-                            'info'     => \ForkBB\__('Info 2'),
+                            'caption'  => __('Database type'),
+                            'info'     => __('Info 2'),
                             'required' => true,
                         ],
                         'dbhost' => [
                             'type'     => 'text',
                             'value'    => $v ? $v->dbhost : 'localhost',
-                            'caption'  => \ForkBB\__('Database server hostname'),
-                            'info'     => \ForkBB\__('Info 3'),
+                            'caption'  => __('Database server hostname'),
+                            'info'     => __('Info 3'),
                             'required' => true,
                         ],
                         'dbname' => [
                             'type'     => 'text',
                             'value'    => $v ? $v->dbname : '',
-                            'caption'  => \ForkBB\__('Database name'),
-                            'info'     => \ForkBB\__('Info 4'),
+                            'caption'  => __('Database name'),
+                            'info'     => __('Info 4'),
                             'required' => true,
                         ],
                         'dbuser' => [
                             'type'    => 'text',
                             'value'   => $v ? $v->dbuser : '',
-                            'caption' => \ForkBB\__('Database username'),
+                            'caption' => __('Database username'),
                         ],
                         'dbpass' => [
                             'type'    => 'password',
                             'value'   => '',
-                            'caption' => \ForkBB\__('Database password'),
-                            'info'    => \ForkBB\__('Info 5'),
+                            'caption' => __('Database password'),
+                            'info'    => __('Info 5'),
                         ],
                         'dbprefix' => [
                             'type'      => 'text',
                             'maxlength' => 40,
                             'value'     => $v ? $v->dbprefix : '',
-                            'caption'   => \ForkBB\__('Table prefix'),
-                            'info'      => \ForkBB\__('Info 6'),
+                            'caption'   => __('Table prefix'),
+                            'info'      => __('Info 6'),
                             'required' => true,
                         ],
                     ],
@@ -274,12 +275,12 @@ class Install extends Page
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Administration setup'),
+                            'value' => __('Administration setup'),
                             'html'  => true,
                         ],
                         'info2' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Info 7'),
+                            'value' => __('Info 7'),
                         ],
                     ],
                 ],
@@ -290,16 +291,16 @@ class Install extends Page
                             'maxlength' => 25,
                             'pattern'   => '^.{2,25}$',
                             'value'     => $v ? $v->username : '',
-                            'caption'   => \ForkBB\__('Administrator username'),
-                            'info'      => \ForkBB\__('Info 8'),
+                            'caption'   => __('Administrator username'),
+                            'info'      => __('Info 8'),
                             'required'  => true,
                         ],
                         'password' => [
                             'type'     => 'password',
                             'pattern'  => '^.{16,}$',
                             'value'    => '',
-                            'caption'  => \ForkBB\__('Administrator passphrase'),
-                            'info'     => \ForkBB\__('Info 9'),
+                            'caption'  => __('Administrator passphrase'),
+                            'info'     => __('Info 9'),
                             'required' => true,
                         ],
                         'email' => [
@@ -307,8 +308,8 @@ class Install extends Page
                             'maxlength' => 80,
                             'pattern'   => '.+@.+',
                             'value'     => $v ? $v->email : '',
-                            'caption'   => \ForkBB\__('Administrator email'),
-                            'info'      => \ForkBB\__('Info 10'),
+                            'caption'   => __('Administrator email'),
+                            'info'      => __('Info 10'),
                             'required'  => true,
                         ],
 
@@ -318,12 +319,12 @@ class Install extends Page
                     'info' => [
                         'info1' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Board setup'),
+                            'value' => __('Board setup'),
                             'html'  => true,
                         ],
                         'info2' => [
                             'type'  => '', //????
-                            'value' => \ForkBB\__('Info 11'),
+                            'value' => __('Info 11'),
                         ],
                     ],
                 ],
@@ -332,35 +333,35 @@ class Install extends Page
                         'title' => [
                             'type'      => 'text',
                             'maxlength' => 255,
-                            'value'     => $v ? $v->title : \ForkBB\__('My ForkBB Forum'),
-                            'caption'   => \ForkBB\__('Board title'),
+                            'value'     => $v ? $v->title : __('My ForkBB Forum'),
+                            'caption'   => __('Board title'),
                             'required'  => true,
                         ],
                         'descr' => [
                             'type'      => 'text',
                             'maxlength' => 16000,
-                            'value'     => $v ? $v->descr : \ForkBB\__('Description'),
-                            'caption'   => \ForkBB\__('Board description'),
+                            'value'     => $v ? $v->descr : __('Description'),
+                            'caption'   => __('Board description'),
                         ],
                         'baseurl' => [
                             'type'      => 'text',
                             'maxlength' => 1024,
                             'value'     => $v ? $v->baseurl : $this->c->BASE_URL,
-                            'caption'   => \ForkBB\__('Base URL'),
+                            'caption'   => __('Base URL'),
                             'required'  => true,
                         ],
                         'defaultlang' => [
                             'type'      => 'select',
                             'options'   => $langs,
                             'value'     => $v ? $v->defaultlang : $this->user->language,
-                            'caption'   => \ForkBB\__('Default language'),
+                            'caption'   => __('Default language'),
                             'required'  => true,
                         ],
                         'defaultstyle' => [
                             'type'      => 'select',
                             'options'   => $styles,
                             'value'     => $v ? $v->defaultstyle : $this->user->style,
-                            'caption'   => \ForkBB\__('Default style'),
+                            'caption'   => __('Default style'),
                             'required'  => true,
                         ],
 
@@ -370,7 +371,7 @@ class Install extends Page
             'btns'   => [
                 'submit'  => [
                     'type'  => 'submit',
-                    'value' => \ForkBB\__('Start install'),
+                    'value' => __('Start install'),
                 ],
             ],
         ];
@@ -474,7 +475,7 @@ class Install extends Page
         try {
             $stmt = $this->c->DB->query('SELECT 1 FROM ::users LIMIT 1');
             if (! empty($stmt->fetch())) {
-                $v->addError(\ForkBB\__('Existing table error', $v->dbprefix, $v->dbname));
+                $v->addError(__('Existing table error', $v->dbprefix, $v->dbname));
                 return $dbhost;
             }
         } catch (PDOException $e) {
@@ -1038,12 +1039,12 @@ class Install extends Page
         $now = \time();
 
         $groups = [
-            // g_id,                     g_title,                      g_user_title,        g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_post_links, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood, g_promote_min_posts, g_promote_next_group
-            [$this->c->GROUP_ADMIN,      \ForkBB\__('Administrators'), \ForkBB\__('Administrator '), 0,           0,                0,                  0,                      0,               1,                1,            1,            1,              1,             1,            1,              1,              1,             1,         1,        1,              1,            0,            0,              0,             0,                 0,                 0],
-            [$this->c->GROUP_MOD,        \ForkBB\__('Moderators'),     \ForkBB\__('Moderator '),     1,           1,                1,                  1,                      1,               1,                1,            1,            1,              1,             1,            1,              1,              1,             1,         1,        1,              1,            0,            0,              0,             0,                 0,                 0],
-            [$this->c->GROUP_GUEST,      \ForkBB\__('Guests'),         '',                           0,           0,                0,                  0,                      0,               0,                1,            1,            0,              0,             0,            0,              0,              0,             0,         1,        1,              0,            120,          60,             0,             0,                 0,                 0],
-            [$this->c->GROUP_MEMBER,     \ForkBB\__('Members'),        '',                           0,           0,                0,                  0,                      0,               0,                1,            1,            1,              1,             1,            1,              1,              1,             0,         1,        1,              1,            30,           30,             60,            60,                0,                 0],
-            [$this->c->GROUP_NEW_MEMBER, \ForkBB\__('New members'),    \ForkBB\__('New member'),     0,           0,                0,                  0,                      0,               0,                1,            1,            1,              1,             1,            1,              1,              0,             0,         1,        1,              1,            60,           30,             120,           60,                5,                 $this->c->GROUP_MEMBER],
+            // g_id,                     g_title,              g_user_title,        g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_post_links, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood, g_promote_min_posts, g_promote_next_group
+            [$this->c->GROUP_ADMIN,      __('Administrators'), __('Administrator '), 0,           0,                0,                  0,                      0,               1,                1,            1,            1,              1,             1,            1,              1,              1,             1,         1,        1,              1,            0,            0,              0,             0,                 0,                 0],
+            [$this->c->GROUP_MOD,        __('Moderators'),     __('Moderator '),     1,           1,                1,                  1,                      1,               1,                1,            1,            1,              1,             1,            1,              1,              1,             1,         1,        1,              1,            0,            0,              0,             0,                 0,                 0],
+            [$this->c->GROUP_GUEST,      __('Guests'),         '',                   0,           0,                0,                  0,                      0,               0,                1,            1,            0,              0,             0,            0,              0,              0,             0,         1,        1,              0,            120,          60,             0,             0,                 0,                 0],
+            [$this->c->GROUP_MEMBER,     __('Members'),        '',                   0,           0,                0,                  0,                      0,               0,                1,            1,            1,              1,             1,            1,              1,              1,             0,         1,        1,              1,            30,           30,             60,            60,                0,                 0],
+            [$this->c->GROUP_NEW_MEMBER, __('New members'),    __('New member'),     0,           0,                0,                  0,                      0,               0,                1,            1,            1,              1,             1,            1,              1,              0,             0,         1,        1,              1,            60,           30,             120,           60,                5,                 $this->c->GROUP_MEMBER],
         ];
         foreach ($groups as $group) { //???? $db_type != 'pgsql'
             $this->c->DB->exec('INSERT INTO ::groups (g_id, g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_post_links, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood, g_promote_min_posts, g_promote_next_group) VALUES (?i, ?s, ?s, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i, ?i)', $group) ;
@@ -1051,7 +1052,7 @@ class Install extends Page
         $this->c->DB->exec('UPDATE ::groups SET g_pm_limit=0 WHERE g_id=?i', [$this->c->GROUP_ADMIN]);
 
         $ip = \filter_var($_SERVER['REMOTE_ADDR'], \FILTER_VALIDATE_IP) ?: 'unknow';
-        $this->c->DB->exec('INSERT INTO ::users (group_id, username, password, signature) VALUES (?i, ?s, ?s, \'\')', [$this->c->GROUP_GUEST, \ForkBB\__('Guest '), \ForkBB\__('Guest ')]);
+        $this->c->DB->exec('INSERT INTO ::users (group_id, username, password, signature) VALUES (?i, ?s, ?s, \'\')', [$this->c->GROUP_GUEST, __('Guest '), __('Guest ')]);
         $this->c->DB->exec('INSERT INTO ::users (group_id, username, password, email, email_normal, language, style, num_posts, last_post, registered, registration_ip, last_visit, signature, num_topics) VALUES (?i, ?s, ?s, ?s, ?s, ?s, ?s, 1, ?i, ?i, ?s, ?i, \'\', 1)', [$this->c->GROUP_ADMIN, $v->username, password_hash($v->password, \PASSWORD_DEFAULT), $v->email, $this->c->NormEmail->normalize($v->email), $v->defaultlang, $v->defaultstyle, $now, $now, $ip, $now]);
 
         $pun_config = [
@@ -1107,11 +1108,11 @@ class Install extends Page
             'o_regs_allow'            => 1,
             'o_regs_verify'           => 1,
             'o_announcement'          => 0,
-            'o_announcement_message'  => \ForkBB\__('Announcement '),
+            'o_announcement_message'  => __('Announcement '),
             'o_rules'                 => 0,
-            'o_rules_message'         => \ForkBB\__('Rules '),
+            'o_rules_message'         => __('Rules '),
             'o_maintenance'           => 0,
-            'o_maintenance_message'   => \ForkBB\__('Maintenance message '),
+            'o_maintenance_message'   => __('Maintenance message '),
             'o_default_dst'           => 0,
             'o_feed_type'             => 2,
             'o_feed_ttl'              => 0,
@@ -1151,10 +1152,10 @@ class Install extends Page
             $this->c->DB->exec('INSERT INTO ::config (conf_name, conf_value) VALUES (?s, ?s)', [$conf_name, $conf_value]);
         }
 
-        $this->c->DB->exec('INSERT INTO ::categories (cat_name, disp_position) VALUES (?s, ?i)', [\ForkBB\__('Test category'), 1]);
-        $this->c->DB->exec('INSERT INTO ::forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, last_topic, disp_position, cat_id, moderators) VALUES (?s, ?s, ?i, ?i, ?i, ?i, ?s, ?s, ?i, ?i, \'\')', [\ForkBB\__('Test forum'), \ForkBB\__('This is just a test forum'), 1, 1, $now, 1, $v->username, \ForkBB\__('Test post'), 1, 1]);
-        $this->c->DB->exec('INSERT INTO ::topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, forum_id) VALUES(?s, ?s, ?i, ?i, ?i, ?i, ?s, ?i)', [$v->username, \ForkBB\__('Test post'), $now, 1, $now, 1, $v->username, 1]);
-        $this->c->DB->exec('INSERT INTO ::posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES(?s, ?i, ?s, ?s, ?i, ?i)', [$v->username, 2, $ip, \ForkBB\__('Test message'), $now, 1]);
+        $this->c->DB->exec('INSERT INTO ::categories (cat_name, disp_position) VALUES (?s, ?i)', [__('Test category'), 1]);
+        $this->c->DB->exec('INSERT INTO ::forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, last_topic, disp_position, cat_id, moderators) VALUES (?s, ?s, ?i, ?i, ?i, ?i, ?s, ?s, ?i, ?i, \'\')', [__('Test forum'), __('This is just a test forum'), 1, 1, $now, 1, $v->username, __('Test post'), 1, 1]);
+        $this->c->DB->exec('INSERT INTO ::topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, forum_id) VALUES(?s, ?s, ?i, ?i, ?i, ?i, ?s, ?i)', [$v->username, __('Test post'), $now, 1, $now, 1, $v->username, 1]);
+        $this->c->DB->exec('INSERT INTO ::posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES(?s, ?i, ?s, ?s, ?i, ?i)', [$v->username, 2, $ip, __('Test message'), $now, 1]);
 
         $smilies = [
             ':)'         => 'smile.png',

+ 3 - 2
app/Models/Pages/Maintenance.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages;
 
 use ForkBB\Core\Container;
 use ForkBB\Models\Page;
+use function \ForkBB\__;
 
 class Maintenance extends Page
 {
@@ -22,13 +23,13 @@ class Maintenance extends Page
         $this->nameTpl            = 'maintenance';
 #       $this->onlinePos          = null; //????
 #       $this->robots             = 'noindex';
-        $this->titles             = \ForkBB\__('Maintenance');
+        $this->titles             = __('Maintenance');
 #       $this->fNavigation        = null; //????
 #       $this->maintenanceMessage = $this->c->config->o_maintenance_message;
 
         $this->header('Retry-After', '3600');
 
-        $this->fIswev = ['i', \ForkBB\__($this->c->config->o_maintenance_message)];
+        $this->fIswev = ['i', __($this->c->config->o_maintenance_message)];
     }
 
     /**

+ 3 - 2
app/Models/Pages/Message.php

@@ -3,6 +3,7 @@
 namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
+use function \ForkBB\__;
 
 class Message extends Page
 {
@@ -21,7 +22,7 @@ class Message extends Page
         $this->nameTpl     = 'message';
         $this->httpStatus  = \max(200, $status);
         $this->httpHeaders = $headers;
-        $this->titles      = \ForkBB\__('Info');
+        $this->titles      = __('Info');
         $this->back        = $back;
 
 
@@ -34,7 +35,7 @@ class Message extends Page
         } else {
             $type = 'e';
         }
-        $this->fIswev = [$type, \ForkBB\__($message)];
+        $this->fIswev = [$type, __($message)];
 
         return $this;
     }

+ 38 - 37
app/Models/Pages/Moderate.php

@@ -8,6 +8,7 @@ use ForkBB\Models\Page;
 use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\Topic\Model as Topic;
 use ForkBB\Models\Post\Model as Post;
+use function \ForkBB\__;
 
 class Moderate extends Page
 {
@@ -62,10 +63,10 @@ class Moderate extends Page
             foreach ($this->c->forums->depthList($root, -1) as $f) {
                 if ($cid !== $f->cat_id) {
                     $cid       = $f->cat_id;
-                    $options[] = [\ForkBB\__('Category prefix') . $f->cat_name];
+                    $options[] = [__('Category prefix') . $f->cat_name];
                 }
 
-                $indent = \str_repeat(\ForkBB\__('Forum indent'), $f->depth);
+                $indent = \str_repeat(__('Forum indent'), $f->depth);
 
                 if (
                     $f->redirect_url
@@ -74,9 +75,9 @@ class Moderate extends Page
                         && $f->id === $curForum
                     )
                 ) {
-                    $options[] = [$f->id, $indent . \ForkBB\__('Forum prefix') . $f->forum_name, true];
+                    $options[] = [$f->id, $indent . __('Forum prefix') . $f->forum_name, true];
                 } else {
-                    $options[] = [$f->id, $indent . \ForkBB\__('Forum prefix') . $f->forum_name];
+                    $options[] = [$f->id, $indent . __('Forum prefix') . $f->forum_name];
                     $idxs[]    = $f->id;
                 }
             }
@@ -193,7 +194,7 @@ class Moderate extends Page
             ]);
 
         if (! $v->validation($_POST)) {
-            $message = $this->c->Message->message('Bad request');
+            $message         = $this->c->Message->message('Bad request');
             $message->fIswev = $v->getErrors();
             return $message;
         }
@@ -281,9 +282,9 @@ class Moderate extends Page
     {
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__('Open topics');
-                $this->buttonValue = \ForkBB\__('Open');
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
+                $this->formTitle   = __('Open topics');
+                $this->buttonValue = __('Open');
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 return $this;
             case 2:
@@ -304,9 +305,9 @@ class Moderate extends Page
     {
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__('Close topics');
-                $this->buttonValue = \ForkBB\__('Close');
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
+                $this->formTitle   = __('Close topics');
+                $this->buttonValue = __('Close');
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 return $this;
             case 2:
@@ -344,9 +345,9 @@ class Moderate extends Page
 
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__(true === $this->processAsPosts ? 'Delete posts' : 'Delete topics');
-                $this->buttonValue = \ForkBB\__('Delete');
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
+                $this->formTitle   = __(true === $this->processAsPosts ? 'Delete posts' : 'Delete topics');
+                $this->buttonValue = __('Delete');
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($objects, $v);
                 return $this;
             case 2:
@@ -372,9 +373,9 @@ class Moderate extends Page
     {
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__('Move topics');
-                $this->buttonValue = \ForkBB\__('Move');
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
+                $this->formTitle   = __('Move topics');
+                $this->buttonValue = __('Move');
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->chkRedirect = true;
                 $this->form        = $this->formConfirm($topics, $v);
                 return $this;
@@ -409,9 +410,9 @@ class Moderate extends Page
 
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__('Merge topics');
-                $this->buttonValue = \ForkBB\__('Merge');
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $this->curForum);
+                $this->formTitle   = __('Merge topics');
+                $this->buttonValue = __('Merge');
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $this->curForum);
                 $this->chkRedirect = true;
                 $this->form        = $this->formConfirm($topics, $v);
                 return $this;
@@ -432,9 +433,9 @@ class Moderate extends Page
     {
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__('Unstick topics');
-                $this->buttonValue = \ForkBB\__('Unstick');
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
+                $this->formTitle   = __('Unstick topics');
+                $this->buttonValue = __('Unstick');
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 return $this;
             case 2:
@@ -458,9 +459,9 @@ class Moderate extends Page
     {
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__('Stick topics');
-                $this->buttonValue = \ForkBB\__('Stick');
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
+                $this->formTitle   = __('Stick topics');
+                $this->buttonValue = __('Stick');
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 return $this;
             case 2:
@@ -484,10 +485,10 @@ class Moderate extends Page
     {
         switch ($v->step) {
             case 1:
-                $this->formTitle   = \ForkBB\__('Split posts');
-                $this->buttonValue = \ForkBB\__('Split');
+                $this->formTitle   = __('Split posts');
+                $this->buttonValue = __('Split');
                 $this->needSubject = true;
-                $this->crumbs      = $this->crumbs($this->formTitle, \ForkBB\__('Moderate'), $this->curTopic);
+                $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $this->curTopic);
                 $this->form        = $this->formConfirm($posts, $v);
                 return $this;
             case 2:
@@ -538,9 +539,9 @@ class Moderate extends Page
         $headers = [];
         foreach ($objects as $object) {
             if ($object instanceof Topic) {
-                $headers[] = \ForkBB\__('Topic «%s»', \ForkBB\cens(($object->subject)));
+                $headers[] = __('Topic «%s»', \ForkBB\cens(($object->subject)));
             } else {
-                $headers[] = \ForkBB\__('Post «%1$s by %2$s»', \ForkBB\dt($object->posted), $object->poster);
+                $headers[] = __('Post «%1$s by %2$s»', \ForkBB\dt($object->posted), $object->poster);
             }
         }
 
@@ -557,7 +558,7 @@ class Moderate extends Page
         if ($this->firstTopic instanceof Topic) {
             $form['sets']['info']['info']['info2'] = [
                 'type'    => '', //????
-                'value'   => \ForkBB\__('All posts will be posted in the «%s» topic', $this->firstTopic->subject),
+                'value'   => __('All posts will be posted in the «%s» topic', $this->firstTopic->subject),
 //                'html'    => true,
             ];
         }
@@ -568,7 +569,7 @@ class Moderate extends Page
             $fields['subject'] = [
                 'type'      => 'text',
                 'maxlength' => 70,
-                'caption'   => \ForkBB\__('New subject'),
+                'caption'   => __('New subject'),
                 'required'  => true,
                 'value'     => '' == $v->subject ? $this->curTopic->subject : $v->subject,
                 'autofocus' => $autofocus,
@@ -581,7 +582,7 @@ class Moderate extends Page
                 'type'      => 'select',
                 'options'   => $this->listForOptions,
                 'value'     => null,
-                'caption'   => \ForkBB\__('Move to'),
+                'caption'   => __('Move to'),
                 'required'  => true,
                 'autofocus' => $autofocus,
             ];
@@ -591,7 +592,7 @@ class Moderate extends Page
         if (true === $this->chkRedirect) {
             $fields['redirect'] = [
                 'type'    => 'checkbox',
-                'label'   => \ForkBB\__('Leave redirect'),
+                'label'   => __('Leave redirect'),
                 'value'   => '1',
                 'checked' => true,
             ];
@@ -599,7 +600,7 @@ class Moderate extends Page
 
         $fields['confirm'] = [
             'type'    => 'checkbox',
-            'label'   => \ForkBB\__('Confirm action'),
+            'label'   => __('Confirm action'),
             'value'   => '1',
             'checked' => false,
         ];
@@ -611,7 +612,7 @@ class Moderate extends Page
         ];
         $form['btns']['cancel'] = [
             'type'      => 'submit',
-            'value'     => \ForkBB\__('Cancel'),
+            'value'     => __('Cancel'),
         ];
 
         return $form;

+ 6 - 5
app/Models/Pages/Post.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Model;
 use ForkBB\Models\Page;
 use ForkBB\Models\Topic\Model as Topic;
+use function \ForkBB\__;
 
 class Post extends Page
 {
@@ -59,8 +60,8 @@ class Post extends Page
         $this->onlinePos = 'forum-' . $forum->id;
         $this->canonical = $this->c->Router->link('NewTopic', ['id' => $forum->id]);
         $this->robots    = 'noindex';
-        $this->crumbs    = $this->crumbs(\ForkBB\__('Post new topic'), $forum);
-        $this->formTitle = \ForkBB\__('Post new topic');
+        $this->crumbs    = $this->crumbs(__('Post new topic'), $forum);
+        $this->formTitle = __('Post new topic');
         $this->form      = $this->messageForm($args, $forum, 'NewTopic', false, true);
 
         return $this;
@@ -124,10 +125,10 @@ class Post extends Page
         $this->onlinePos  = 'topic-' . $topic->id;
         $this->canonical  = $this->c->Router->link('NewReply', ['id' => $topic->id]);
         $this->robots     = 'noindex';
-        $this->crumbs     = $this->crumbs(\ForkBB\__('Post a reply'), $topic);
-        $this->formTitle  = \ForkBB\__('Post a reply');
+        $this->crumbs     = $this->crumbs(__('Post a reply'), $topic);
+        $this->formTitle  = __('Post a reply');
         $this->form       = $this->messageForm($args, $topic, 'NewReply');
-        $this->postsTitle = \ForkBB\__('Topic review');
+        $this->postsTitle = __('Topic review');
         $this->posts      = $topic->review();
 
         return $this;

+ 17 - 16
app/Models/Pages/PostFormTrait.php

@@ -3,6 +3,7 @@
 namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Model;
+use function \ForkBB\__;
 
 trait PostFormTrait
 {
@@ -33,12 +34,12 @@ trait PostFormTrait
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Submit'),
+                    'value'     => __('Submit'),
                     'accesskey' => 's',
                 ],
                 'preview' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Preview'),
+                    'value'     => __('Preview'),
                     'accesskey' => 'p',
                     'class'     => 'f-minor',
                 ],
@@ -51,7 +52,7 @@ trait PostFormTrait
                 'class'     => 'w1',
                 'type'      => 'text',
                 'maxlength' => 25,
-                'caption'   => \ForkBB\__('Username'),
+                'caption'   => __('Username'),
                 'required'  => true,
                 'pattern'   => '^.{2,25}$',
                 'value'     => $vars['username'] ?? null,
@@ -61,7 +62,7 @@ trait PostFormTrait
                 'class'     => 'w2',
                 'type'      => 'text',
                 'maxlength' => 80,
-                'caption'   => \ForkBB\__('Email'),
+                'caption'   => __('Email'),
                 'required'  => '1' == $this->c->config->p_force_guest_email,
                 'pattern'   => '.+@.+',
                 'value'     => $vars['email'] ?? null,
@@ -74,7 +75,7 @@ trait PostFormTrait
                 'class'     => 'w0',
                 'type'      => 'text',
                 'maxlength' => 70,
-                'caption'   => \ForkBB\__('Subject'),
+                'caption'   => __('Subject'),
                 'required'  => true,
                 'value'     => $vars['subject'] ?? null,
                 'autofocus' => $autofocus,
@@ -85,14 +86,14 @@ trait PostFormTrait
         $fieldset['message'] = [
             'class'    => 'w0',
             'type'     => 'textarea',
-            'caption'  => \ForkBB\__('Message'),
+            'caption'  => __('Message'),
             'required' => true,
             'value'    => $vars['message'] ?? null,
             'bb'       => [
-                ['link', \ForkBB\__('BBCode'), \ForkBB\__('1' == $this->c->config->p_message_bbcode ? 'on' : 'off')],
-                ['link', \ForkBB\__('url tag'), \ForkBB\__('1' == $this->c->config->p_message_bbcode && '1' == $this->user->g_post_links ? 'on' : 'off')],
-                ['link', \ForkBB\__('img tag'), \ForkBB\__('1' == $this->c->config->p_message_bbcode && '1' == $this->c->config->p_message_img_tag ? 'on' : 'off')],
-                ['link', \ForkBB\__('Smilies'), \ForkBB\__('1' == $this->c->config->o_smilies ? 'on' : 'off')],
+                ['link', __('BBCode'), __('1' == $this->c->config->p_message_bbcode ? 'on' : 'off')],
+                ['link', __('url tag'), __('1' == $this->c->config->p_message_bbcode && '1' == $this->user->g_post_links ? 'on' : 'off')],
+                ['link', __('img tag'), __('1' == $this->c->config->p_message_bbcode && '1' == $this->c->config->p_message_img_tag ? 'on' : 'off')],
+                ['link', __('Smilies'), __('1' == $this->c->config->o_smilies ? 'on' : 'off')],
             ],
             'autofocus' => $autofocus,
         ];
@@ -109,20 +110,20 @@ trait PostFormTrait
             if ($editSubject) {
                 $fieldset['stick_topic'] = [
                     'type'    => 'checkbox',
-                    'label'   => \ForkBB\__('Stick topic'),
+                    'label'   => __('Stick topic'),
                     'value'   => '1',
                     'checked' => isset($vars['stick_topic']) ? (bool) $vars['stick_topic'] : false,
                 ];
                 $fieldset['stick_fp'] = [
                     'type'    => 'checkbox',
-                    'label'   => \ForkBB\__('Stick first post'),
+                    'label'   => __('Stick first post'),
                     'value'   => '1',
                     'checked' => isset($vars['stick_fp']) ? (bool) $vars['stick_fp'] : false,
                 ];
             } elseif (! $editPost) {
                 $fieldset['merge_post'] = [
                     'type'    => 'checkbox',
-                    'label'   => \ForkBB\__('Merge posts'),
+                    'label'   => __('Merge posts'),
                     'value'   => '1',
                     'checked' => isset($vars['merge_post']) ? (bool) $vars['merge_post'] : true,
                 ];
@@ -134,7 +135,7 @@ trait PostFormTrait
             ) {
                 $fieldset['edit_post'] = [
                     'type'    => 'checkbox',
-                    'label'   => \ForkBB\__('EditPost edit'),
+                    'label'   => __('EditPost edit'),
                     'value'   => '1',
                     'checked' => isset($vars['edit_post']) ? (bool) $vars['edit_post'] : false,
                 ];
@@ -146,14 +147,14 @@ trait PostFormTrait
         ) {
             $fieldset['hide_smilies'] = [
                 'type'    => 'checkbox',
-                'label'   => \ForkBB\__('Hide smilies'),
+                'label'   => __('Hide smilies'),
                 'value'   => '1',
                 'checked' => isset($vars['hide_smilies']) ? (bool) $vars['hide_smilies'] : false,
             ];
         }
         if ($fieldset) {
             $form['sets']['sett'] = [
-                'legend' => \ForkBB\__('Options'),
+                'legend' => __('Options'),
                 'fields' => $fieldset,
             ];
         }

+ 2 - 1
app/Models/Pages/PostValidatorTrait.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages;
 
 use ForkBB\Core\Validator;
 use ForkBB\Models\Model;
+use function \ForkBB\__;
 
 trait PostValidatorTrait
 {
@@ -82,7 +83,7 @@ trait PostValidatorTrait
         $time = \time() - (int) $this->user->last_post;
 
         if ($time < $this->user->g_post_flood) {
-            $v->addError(\ForkBB\__('Flood start', $this->user->g_post_flood, $this->user->g_post_flood - $time), 'e');
+            $v->addError(__('Flood start', $this->user->g_post_flood, $this->user->g_post_flood - $time), 'e');
         }
 
         return $submit;

+ 11 - 10
app/Models/Pages/Profile.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Pages;
 use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 abstract class Profile extends Page
 {
@@ -37,7 +38,7 @@ abstract class Profile extends Page
         $this->fIndex    = $this->rules->my ? 'profile' : 'userlist';
         $this->nameTpl   = 'profile';
         $this->onlinePos = 'profile-' . $this->curUser->id; // ????
-        $this->title     = \ForkBB\__('%s\'s profile', $this->curUser->username);
+        $this->title     = __('%s\'s profile', $this->curUser->username);
 
         return true;
     }
@@ -69,8 +70,8 @@ abstract class Profile extends Page
      */
     protected function crumbs(...$crumbs): array
     {
-        $crumbs[] = [$this->curUser->link, \ForkBB\__('User %s', $this->curUser->username)];
-        $crumbs[] = [$this->c->Router->link('Userlist'), \ForkBB\__('User list')];
+        $crumbs[] = [$this->curUser->link, __('User %s', $this->curUser->username)];
+        $crumbs[] = [$this->c->Router->link('Userlist'), __('User list')];
 
         return parent::crumbs(...$crumbs);
     }
@@ -91,7 +92,7 @@ abstract class Profile extends Page
         ) {
             $btns['change-user-group'] = [
                 $this->linkChangeGroup(),
-                \ForkBB\__('Change user group'),
+                __('Change user group'),
             ];
         }
         if ($this->rules->banUser) {
@@ -106,7 +107,7 @@ abstract class Profile extends Page
                             'uid' => $this->curUser->id,
                         ]),
                     ]),
-                    \ForkBB\__('Unban user'),
+                    __('Unban user'),
                 ];
             } else {
                 $btns['ban-user'] = [
@@ -114,14 +115,14 @@ abstract class Profile extends Page
                         'ids' => $this->curUser->id,
                         'uid' => $this->curUser->id,
                     ]),
-                    \ForkBB\__('Ban user'),
+                    __('Ban user'),
                 ];
             }
         }
         if ($this->rules->deleteUser) {
             $btns['delete-user'] = [
                 $this->c->Router->link('AdminUsersAction',  ['action' => 'delete', 'ids' => $this->curUser->id]), // ????
-                \ForkBB\__('Delete user'),
+                __('Delete user'),
             ];
         }
         if (
@@ -130,13 +131,13 @@ abstract class Profile extends Page
         ) {
             $btns['edit-profile'] = [
                 $this->c->Router->link('EditUserProfile',  ['id' => $this->curUser->id]),
-                \ForkBB\__('Edit '),
+                __('Edit '),
             ];
         }
         if ('view' != $type) {
             $btns['view-profile'] = [
                 $this->curUser->link,
-                \ForkBB\__('View '),
+                __('View '),
             ];
         }
         if (
@@ -145,7 +146,7 @@ abstract class Profile extends Page
         ) {
             $btns['edit-settings'] = [
                 $this->c->Router->link('EditUserBoardConfig', ['id' => $this->curUser->id]),
-                \ForkBB\__('Configure '),
+                __('Configure '),
             ];
         }
         return $btns;

+ 70 - 69
app/Models/Pages/Profile/Config.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Pages\Profile;
 use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
+use function \ForkBB\__;
 
 class Config extends Profile
 {
@@ -79,7 +80,7 @@ class Config extends Profile
             $this->fIswev = $v->getErrors();
         }
 
-        $this->crumbs     = $this->crumbs([$this->c->Router->link('EditUserBoardConfig', ['id' => $this->curUser->id]), \ForkBB\__('Board configuration')]);
+        $this->crumbs     = $this->crumbs([$this->c->Router->link('EditUserBoardConfig', ['id' => $this->curUser->id]), __('Board configuration')]);
         $this->form       = $this->form();
         $this->actionBtns = $this->btns('config');
 
@@ -115,152 +116,152 @@ class Config extends Profile
             'btns'   => [
                 'save' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save changes'),
+                    'value'     => __('Save changes'),
                     'accesskey' => 's',
                 ],
             ],
         ];
 
-        $yn     = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
+        $yn     = [1 => __('Yes'), 0 => __('No')];
         $langs  = $this->c->Func->getNameLangs();
         $styles = $this->c->Func->getStyles();
         $timeFormat = [];
         foreach ($this->c->TIME_FORMATS as $key => $value) {
-            $timeFormat[$key] = \ForkBB\dt(\time(), false, null, $value, true, true) . ($key ? '' : ' (' . \ForkBB\__('Default') . ')');
+            $timeFormat[$key] = \ForkBB\dt(\time(), false, null, $value, true, true) . ($key ? '' : ' (' . __('Default') . ')');
         }
         $dateFormat = [];
         foreach ($this->c->DATE_FORMATS as $key => $value) {
-            $dateFormat[$key] = \ForkBB\dt(\time(), true, $value, null, false, true) . ($key ? '' : ' (' . \ForkBB\__('Default') . ')');
+            $dateFormat[$key] = \ForkBB\dt(\time(), true, $value, null, false, true) . ($key ? '' : ' (' . __('Default') . ')');
         }
 
         $form['sets']['essentials'] = [
-            'legend' => \ForkBB\__('Essentials'),
+            'legend' => __('Essentials'),
             'class'  => 'data-edit',
             'fields' => [
                 'language' => [
                     'type'    => 'select',
                     'options' => $langs,
                     'value'   => $this->curUser->language,
-                    'caption' => \ForkBB\__('Language'),
+                    'caption' => __('Language'),
                 ],
                 'style' => [
                     'type'    => 'select',
                     'options' => $styles,
                     'value'   => $this->curUser->style,
-                    'caption' => \ForkBB\__('Style'),
+                    'caption' => __('Style'),
                 ],
                 'timezone' => [
                     'type'    => 'select',
                     'options' => [
-                        '-12'   => \ForkBB\__('UTC-12:00'),
-                        '-11'   => \ForkBB\__('UTC-11:00'),
-                        '-10'   => \ForkBB\__('UTC-10:00'),
-                        '-9.5'  => \ForkBB\__('UTC-09:30'),
-                        '-9'    => \ForkBB\__('UTC-09:00'),
-                        '-8.5'  => \ForkBB\__('UTC-08:30'),
-                        '-8'    => \ForkBB\__('UTC-08:00'),
-                        '-7'    => \ForkBB\__('UTC-07:00'),
-                        '-6'    => \ForkBB\__('UTC-06:00'),
-                        '-5'    => \ForkBB\__('UTC-05:00'),
-                        '-4'    => \ForkBB\__('UTC-04:00'),
-                        '-3.5'  => \ForkBB\__('UTC-03:30'),
-                        '-3'    => \ForkBB\__('UTC-03:00'),
-                        '-2'    => \ForkBB\__('UTC-02:00'),
-                        '-1'    => \ForkBB\__('UTC-01:00'),
-                        '0'     => \ForkBB\__('UTC'),
-                        '1'     => \ForkBB\__('UTC+01:00'),
-                        '2'     => \ForkBB\__('UTC+02:00'),
-                        '3'     => \ForkBB\__('UTC+03:00'),
-                        '3.5'   => \ForkBB\__('UTC+03:30'),
-                        '4'     => \ForkBB\__('UTC+04:00'),
-                        '4.5'   => \ForkBB\__('UTC+04:30'),
-                        '5'     => \ForkBB\__('UTC+05:00'),
-                        '5.5'   => \ForkBB\__('UTC+05:30'),
-                        '5.75'  => \ForkBB\__('UTC+05:45'),
-                        '6'     => \ForkBB\__('UTC+06:00'),
-                        '6.5'   => \ForkBB\__('UTC+06:30'),
-                        '7'     => \ForkBB\__('UTC+07:00'),
-                        '8'     => \ForkBB\__('UTC+08:00'),
-                        '8.75'  => \ForkBB\__('UTC+08:45'),
-                        '9'     => \ForkBB\__('UTC+09:00'),
-                        '9.5'   => \ForkBB\__('UTC+09:30'),
-                        '10'    => \ForkBB\__('UTC+10:00'),
-                        '10.5'  => \ForkBB\__('UTC+10:30'),
-                        '11'    => \ForkBB\__('UTC+11:00'),
-                        '11.5'  => \ForkBB\__('UTC+11:30'),
-                        '12'    => \ForkBB\__('UTC+12:00'),
-                        '12.75' => \ForkBB\__('UTC+12:45'),
-                        '13'    => \ForkBB\__('UTC+13:00'),
-                        '14'    => \ForkBB\__('UTC+14:00'),
+                        '-12'   => __('UTC-12:00'),
+                        '-11'   => __('UTC-11:00'),
+                        '-10'   => __('UTC-10:00'),
+                        '-9.5'  => __('UTC-09:30'),
+                        '-9'    => __('UTC-09:00'),
+                        '-8.5'  => __('UTC-08:30'),
+                        '-8'    => __('UTC-08:00'),
+                        '-7'    => __('UTC-07:00'),
+                        '-6'    => __('UTC-06:00'),
+                        '-5'    => __('UTC-05:00'),
+                        '-4'    => __('UTC-04:00'),
+                        '-3.5'  => __('UTC-03:30'),
+                        '-3'    => __('UTC-03:00'),
+                        '-2'    => __('UTC-02:00'),
+                        '-1'    => __('UTC-01:00'),
+                        '0'     => __('UTC'),
+                        '1'     => __('UTC+01:00'),
+                        '2'     => __('UTC+02:00'),
+                        '3'     => __('UTC+03:00'),
+                        '3.5'   => __('UTC+03:30'),
+                        '4'     => __('UTC+04:00'),
+                        '4.5'   => __('UTC+04:30'),
+                        '5'     => __('UTC+05:00'),
+                        '5.5'   => __('UTC+05:30'),
+                        '5.75'  => __('UTC+05:45'),
+                        '6'     => __('UTC+06:00'),
+                        '6.5'   => __('UTC+06:30'),
+                        '7'     => __('UTC+07:00'),
+                        '8'     => __('UTC+08:00'),
+                        '8.75'  => __('UTC+08:45'),
+                        '9'     => __('UTC+09:00'),
+                        '9.5'   => __('UTC+09:30'),
+                        '10'    => __('UTC+10:00'),
+                        '10.5'  => __('UTC+10:30'),
+                        '11'    => __('UTC+11:00'),
+                        '11.5'  => __('UTC+11:30'),
+                        '12'    => __('UTC+12:00'),
+                        '12.75' => __('UTC+12:45'),
+                        '13'    => __('UTC+13:00'),
+                        '14'    => __('UTC+14:00'),
                     ],
                     'value'   => $this->curUser->timezone,
-                    'caption' => \ForkBB\__('Time zone'),
+                    'caption' => __('Time zone'),
                 ],
                 'dst' => [
                     'type'    => 'radio',
                     'value'   => $this->curUser->dst,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('DST label'),
-                    'info'    => \ForkBB\__('DST help'),
+                    'caption' => __('DST label'),
+                    'info'    => __('DST help'),
                 ],
                 'time_format' => [
                     'type'    => 'select',
                     'options' => $timeFormat,
                     'value'   => $this->curUser->time_format,
-                    'caption' => \ForkBB\__('Time format'),
+                    'caption' => __('Time format'),
                 ],
                 'date_format' => [
                     'type'    => 'select',
                     'options' => $dateFormat,
                     'value'   => $this->curUser->date_format,
-                    'caption' => \ForkBB\__('Date format'),
+                    'caption' => __('Date format'),
                 ],
 
             ],
         ];
         $form['sets']['viewing-posts'] = [
-            'legend' => \ForkBB\__('Viewing posts'),
+            'legend' => __('Viewing posts'),
             'class'  => 'data-edit',
             'fields' => [
                 'show_smilies' => [
                     'type'    => 'radio',
                     'value'   => $this->curUser->show_smilies,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Smilies label'),
-                    'info'    => \ForkBB\__('Smilies info'),
+                    'caption' => __('Smilies label'),
+                    'info'    => __('Smilies info'),
                 ],
                 'show_sig' => [
                     'type'    => 'radio',
                     'value'   => $this->curUser->show_sig,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Sigs label'),
-                    'info'    => \ForkBB\__('Sigs info'),
+                    'caption' => __('Sigs label'),
+                    'info'    => __('Sigs info'),
                 ],
                 'show_avatars' => [
                     'type'    => 'radio',
                     'value'   => $this->curUser->show_avatars,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Avatars label'),
-                    'info'    => \ForkBB\__('Avatars info'),
+                    'caption' => __('Avatars label'),
+                    'info'    => __('Avatars info'),
                 ],
                 'show_img' => [
                     'type'    => 'radio',
                     'value'   => $this->curUser->show_img,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Images label'),
-                    'info'    => \ForkBB\__('Images info'),
+                    'caption' => __('Images label'),
+                    'info'    => __('Images info'),
                 ],
                 'show_img_sig' => [
                     'type'    => 'radio',
                     'value'   => $this->curUser->show_img_sig,
                     'values'  => $yn,
-                    'caption' => \ForkBB\__('Images sigs label'),
-                    'info'    => \ForkBB\__('Images sigs info'),
+                    'caption' => __('Images sigs label'),
+                    'info'    => __('Images sigs info'),
                 ],
             ],
         ];
         $form['sets']['pagination'] = [
-            'legend' => \ForkBB\__('Pagination'),
+            'legend' => __('Pagination'),
             'class'  => 'data-edit',
             'fields' => [
                 'disp_topics' => [
@@ -268,16 +269,16 @@ class Config extends Profile
                     'min'     => 0,
                     'max'     => 50,
                     'value'   => $this->curUser->__disp_topics,
-                    'caption' => \ForkBB\__('Topics per page label'),
-                    'info'    => \ForkBB\__('For default'),
+                    'caption' => __('Topics per page label'),
+                    'info'    => __('For default'),
                 ],
                 'disp_posts' => [
                     'type'    => 'number',
                     'min'     => 0,
                     'max'     => 50,
                     'value'   => $this->curUser->__disp_posts,
-                    'caption' => \ForkBB\__('Posts per page label'),
-                    'info'    => \ForkBB\__('For default'),
+                    'caption' => __('Posts per page label'),
+                    'info'    => __('For default'),
                 ],
             ],
         ];

+ 43 - 42
app/Models/Pages/Profile/Edit.php

@@ -8,6 +8,7 @@ use ForkBB\Core\Exceptions\MailException;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Edit extends Profile
 {
@@ -135,7 +136,7 @@ class Edit extends Profile
             }
         }
 
-        $this->crumbs     = $this->crumbs([$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), \ForkBB\__('Editing profile')]);
+        $this->crumbs     = $this->crumbs([$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), __('Editing profile')]);
         $this->form       = $this->form();
         $this->actionBtns = $this->btns('edit');
 
@@ -196,7 +197,7 @@ class Edit extends Profile
             'btns'   => [
                 'save' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save changes'),
+                    'value'     => __('Save changes'),
                     'accesskey' => 's',
                 ],
             ],
@@ -208,7 +209,7 @@ class Edit extends Profile
             $fields['username'] = [
                 'type'      => 'text',
                 'maxlength' => 25,
-                'caption'   => \ForkBB\__('Username'),
+                'caption'   => __('Username'),
                 'required'  => true,
                 'pattern'   => '^.{2,25}$',
                 'value'     => $this->curUser->username,
@@ -217,31 +218,31 @@ class Edit extends Profile
             $fields['username'] = [
                 'class'   => 'pline',
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Username'),
+                'caption' => __('Username'),
                 'value'   => $this->curUser->username,
             ];
         }
         if ($this->rules->changeGroup) {
             $fields['group'] = [
                 'type'    => 'link',
-                'caption' => \ForkBB\__('Group'),
-                'value'   => $this->curUser->group_id ? $this->curUser->g_title : \ForkBB\__('Change user group'),
-                'title'   => \ForkBB\__('Change user group'),
+                'caption' => __('Group'),
+                'value'   => $this->curUser->group_id ? $this->curUser->g_title : __('Change user group'),
+                'title'   => __('Change user group'),
                 'href'    => $this->linkChangeGroup(),
             ];
         } else {
             $fields['group'] = [
                 'class'   => 'pline',
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Group'),
+                'caption' => __('Group'),
                 'value'   => $this->curUser->group_id ? $this->curUser->g_title : '-',
             ];
         }
         if ($this->rules->confModer) {
             $fields['configure-moderator'] = [
                 'type'    => 'link',
-                'value'   => \ForkBB\__('Configure moderator rights'),
-                'title'   => \ForkBB\__('Configure moderator rights'),
+                'value'   => __('Configure moderator rights'),
+                'title'   => __('Configure moderator rights'),
                 'href'    => $this->c->Router->link('EditUserModeration', ['id' => $this->curUser->id]),
             ];
         }
@@ -249,22 +250,22 @@ class Edit extends Profile
             $fields['title'] = [
                 'type'      => 'text',
                 'maxlength' => 50,
-                'caption'   => \ForkBB\__('Title'),
+                'caption'   => __('Title'),
                 'value'     => $this->curUser->title,
-                'info'      => \ForkBB\__('Leave blank'),
+                'info'      => __('Leave blank'),
             ];
         } else {
             $fields['title'] = [
                 'class'   => 'pline',
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Title'),
+                'caption' => __('Title'),
                 'value'   => $this->curUser->title(),
             ];
         }
         if ($this->rules->editPass) {
             $fields['change_pass'] = [
                 'type'  => 'link',
-                'value' => \ForkBB\__('Change passphrase'),
+                'value' => __('Change passphrase'),
                 'href'  => $this->c->Router->link('EditUserPass', ['id' => $this->curUser->id]),
             ];
         }
@@ -273,13 +274,13 @@ class Edit extends Profile
                 $fields['avatar'] = [
                     'class'   => 'pline',
                     'type'    => 'str',
-                    'caption' => \ForkBB\__('Avatar'),
-                    'value'   => \ForkBB\__('Not uploaded'),
+                    'caption' => __('Avatar'),
+                    'value'   => __('Not uploaded'),
                 ];
             } elseif ($this->curUser->avatar) {
                 $fields['avatar'] = [
                     'type'    => 'yield',
-                    'caption' => \ForkBB\__('Avatar'),
+                    'caption' => __('Avatar'),
                     'value'   => 'avatar',
                 ];
             }
@@ -290,7 +291,7 @@ class Edit extends Profile
             if ($this->curUser->avatar) {
                 $fields['delete_avatar'] = [
                     'type'    => 'checkbox',
-                    'label'   => \ForkBB\__('Delete avatar'),
+                    'label'   => __('Delete avatar'),
                     'value'   => '1',
                     'checked' => false,
                 ];
@@ -298,8 +299,8 @@ class Edit extends Profile
 
             $fields['upload_avatar'] = [
                 'type'      => 'file',
-                'caption'   => \ForkBB\__('New avatar'),
-                'info'      => \ForkBB\__('New avatar info',
+                'caption'   => __('New avatar'),
+                'info'      => __('New avatar info',
                     \ForkBB\num($this->c->config->o_avatars_width),
                     \ForkBB\num($this->c->config->o_avatars_height),
                     \ForkBB\num($this->c->config->o_avatars_size),
@@ -309,7 +310,7 @@ class Edit extends Profile
         }
         $form['sets']['header'] = [
             'class'  => 'header-edit',
-#            'legend' => \ForkBB\__('Options'),
+#            'legend' => __('Options'),
             'fields' => $fields,
         ];
 
@@ -317,12 +318,12 @@ class Edit extends Profile
         if ($this->user->isAdmMod) {
             $form['sets']['note'] = [
                 'class'  => 'data-edit',
-                'legend' => \ForkBB\__('Admin note'),
+                'legend' => __('Admin note'),
                 'fields' => [
                     'admin_note' => [
                         'type'      => 'text',
                         'maxlength' => 30,
-                        'caption'   => \ForkBB\__('Admin note'),
+                        'caption'   => __('Admin note'),
                         'value'     => $this->curUser->admin_note,
                     ],
                 ],
@@ -334,30 +335,30 @@ class Edit extends Profile
         $fields['realname'] = [
             'type'      => 'text',
             'maxlength' => 40,
-            'caption'   => \ForkBB\__('Realname'),
+            'caption'   => __('Realname'),
             'value'     => $this->curUser->realname,
         ];
         $genders = [
-            0 => \ForkBB\__('Do not display'),
-            1 => \ForkBB\__('Male'),
-            2 => \ForkBB\__('Female'),
+            0 => __('Do not display'),
+            1 => __('Male'),
+            2 => __('Female'),
         ];
         $fields['gender'] = [
             'class'   => 'block',
             'type'    => 'radio',
             'value'   => $this->curUser->gender,
             'values'  => $genders,
-            'caption' => \ForkBB\__('Gender'),
+            'caption' => __('Gender'),
         ];
         $fields['location'] = [
             'type'      => 'text',
             'maxlength' => 30,
-            'caption'   => \ForkBB\__('Location'),
+            'caption'   => __('Location'),
             'value'     => $this->curUser->location,
         ];
         $form['sets']['personal'] = [
             'class'  => 'data-edit',
-            'legend' => \ForkBB\__('Personal information'),
+            'legend' => __('Personal information'),
             'fields' => $fields,
         ];
 
@@ -367,14 +368,14 @@ class Edit extends Profile
             $fields['open-email'] = [
                 'class'   => 'pline',
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Email info'),
+                'caption' => __('Email info'),
                 'value'   => \ForkBB\cens($this->curUser->email),
             ];
         }
         if ($this->rules->editEmail) {
             $fields['change_email'] = [
                 'type'  => 'link',
-                'value' => \ForkBB\__('To change email'),
+                'value' => __('To change email'),
                 'href'  => $this->c->Router->link('EditUserEmail', ['id' => $this->curUser->id]),
             ];
         }
@@ -383,11 +384,11 @@ class Edit extends Profile
             'type'    => 'radio',
             'value'   => $this->curUser->email_setting,
             'values'  => [
-                0 => \ForkBB\__('Display e-mail label'),
-                1 => \ForkBB\__('Hide allow form label'),
-                2 => \ForkBB\__('Hide both label'),
+                0 => __('Display e-mail label'),
+                1 => __('Hide allow form label'),
+                2 => __('Hide both label'),
             ],
-            'caption' => \ForkBB\__('Email settings label'),
+            'caption' => __('Email settings label'),
         ];
 
         if ($this->rules->editWebsite) {
@@ -395,7 +396,7 @@ class Edit extends Profile
                 'id'        => 'website',
                 'type'      => 'text',
                 'maxlength' => 100,
-                'caption'   => \ForkBB\__('Website'),
+                'caption'   => __('Website'),
                 'value'     => $this->curUser->url,
             ];
         } elseif (
@@ -406,14 +407,14 @@ class Edit extends Profile
                 'id'      => 'website',
                 'class'   => 'pline',
                 'type'    => 'link',
-                'caption' => \ForkBB\__('Website'),
+                'caption' => __('Website'),
                 'value'   => \ForkBB\cens($this->curUser->url),
                 'href'    => \ForkBB\cens($this->curUser->url),
             ];
         }
         $form['sets']['contacts'] = [
             'class'  => 'data-edit',
-            'legend' => \ForkBB\__('Contact details'),
+            'legend' => __('Contact details'),
             'fields' => $fields,
         ];
 
@@ -423,12 +424,12 @@ class Edit extends Profile
             $fields['signature'] = [
                 'type'    => 'textarea',
                 'value'   => $this->curUser->signature,
-                'caption' => \ForkBB\__('Signature'),
-                'info'    => \ForkBB\__('Sig max size', \ForkBB\num($this->c->config->p_sig_length), \ForkBB\num($this->c->config->p_sig_lines)),
+                'caption' => __('Signature'),
+                'info'    => __('Sig max size', \ForkBB\num($this->c->config->p_sig_length), \ForkBB\num($this->c->config->p_sig_lines)),
             ];
             $form['sets']['signature'] = [
                 'class'  => 'data-edit',
-                'legend' => \ForkBB\__('Signature'),
+                'legend' => __('Signature'),
                 'fields' => $fields,
             ];
         }

+ 11 - 10
app/Models/Pages/Profile/Email.php

@@ -7,6 +7,7 @@ use ForkBB\Core\Exceptions\MailException;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Email extends Profile
 {
@@ -95,7 +96,7 @@ class Email extends Profile
                     $link = $this->c->Router->link('SetNewEmail', ['id' => $this->curUser->id, 'email' => $v->new_email, 'key' => $key, 'hash' => $hash]);
                     $tplData = [
                         'fRootLink' => $this->c->Router->link('Index'),
-                        'fMailer'   => \ForkBB\__('Mailer', $this->c->config->o_board_title),
+                        'fMailer'   => __('Mailer', $this->c->config->o_board_title),
                         'username'  => $this->curUser->username,
                         'link'      => $link,
                     ];
@@ -106,7 +107,7 @@ class Email extends Profile
                             ->setFolder($this->c->DIR_LANG)
                             ->setLanguage($this->curUser->language)
                             ->setTo($v->new_email, $this->curUser->username)
-                            ->setFrom($this->c->config->o_webmaster_email, \ForkBB\__('Mailer', $this->c->config->o_board_title))
+                            ->setFrom($this->c->config->o_webmaster_email, __('Mailer', $this->c->config->o_board_title))
                             ->setTpl('activate_email.tpl', $tplData)
                             ->send();
                     } catch (MailException $e) {
@@ -119,9 +120,9 @@ class Email extends Profile
 
                         $this->c->users->update($this->curUser);
 
-                        return $this->c->Message->message(\ForkBB\__('Activate email sent', $this->c->config->o_admin_email), false, 200);
+                        return $this->c->Message->message(__('Activate email sent', $this->c->config->o_admin_email), false, 200);
                     } else {
-                        return $this->c->Message->message(\ForkBB\__('Error mail', $this->c->config->o_admin_email), true, 200);
+                        return $this->c->Message->message(__('Error mail', $this->c->config->o_admin_email), true, 200);
                     }
                 }
             } else {
@@ -133,8 +134,8 @@ class Email extends Profile
 
 
         $this->crumbs     = $this->crumbs(
-            [$this->c->Router->link('EditUserEmail', ['id' => $this->curUser->id]), \ForkBB\__('Change email')],
-            [$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), \ForkBB\__('Editing profile')]
+            [$this->c->Router->link('EditUserEmail', ['id' => $this->curUser->id]), __('Change email')],
+            [$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), __('Editing profile')]
         );
         $this->form       = $this->form();
         $this->actionBtns = $this->btns('edit');
@@ -161,15 +162,15 @@ class Email extends Profile
                         'new_email' => [
                             'type'      => 'text',
                             'maxlength' => 80,
-                            'caption'   => \ForkBB\__('New email'),
+                            'caption'   => __('New email'),
                             'required'  => true,
                             'pattern'   => '.+@.+',
                             'value'     => $this->curUser->email,
-                            'info'      => ! $this->user->isAdmin && '1' == $this->c->config->o_regs_verify ? \ForkBB\__('Email instructions') : null,
+                            'info'      => ! $this->user->isAdmin && '1' == $this->c->config->o_regs_verify ? __('Email instructions') : null,
                         ],
                         'password' => [
                             'type'      => 'password',
-                            'caption'   => \ForkBB\__('Your passphrase'),
+                            'caption'   => __('Your passphrase'),
                             'required'  => true,
                         ],
                     ],
@@ -178,7 +179,7 @@ class Email extends Profile
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Submit'),
+                    'value'     => __('Submit'),
                     'accesskey' => 's',
                 ],
             ],

+ 6 - 5
app/Models/Pages/Profile/Mod.php

@@ -9,6 +9,7 @@ use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\User\Model as User;
 use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\Forum\Manager as ForumManager;
+use function \ForkBB\__;
 
 class Mod extends Profile
 {
@@ -63,8 +64,8 @@ class Mod extends Profile
         }
 
         $this->crumbs     = $this->crumbs(
-            [$this->c->Router->link('EditUserModeration', ['id' => $this->curUser->id]), \ForkBB\__('Moderator rights')],
-            [$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), \ForkBB\__('Editing profile')]
+            [$this->c->Router->link('EditUserModeration', ['id' => $this->curUser->id]), __('Moderator rights')],
+            [$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), __('Editing profile')]
         );
         $this->form       = $this->form();
         $this->actionBtns = $this->btns('edit');
@@ -102,7 +103,7 @@ class Mod extends Profile
             'btns'   => [
                 'save' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Save'),
+                    'value'     => __('Save'),
                     'accesskey' => 's',
                 ],
             ],
@@ -132,7 +133,7 @@ class Mod extends Profile
                     'class'   => ['modforum', 'name', 'depth' . $forum->depth],
                     'type'    => 'str',
                     'value'   => $forum->forum_name,
-                    'caption' => \ForkBB\__('Forum label'),
+                    'caption' => __('Forum label'),
                 ];
                 $fields["moderator[{$forum->id}]"] = [
                     'class'    => ['modforum', 'moderator'],
@@ -140,7 +141,7 @@ class Mod extends Profile
                     'value'    => $forum->id,
                     'checked'  => isset($this->curForums[$forum->id]) && $this->curUser->isModerator($forum),
                     'disabled' => ! isset($this->curForums[$forum->id]) || '' != $this->curForums[$forum->id]->redirect_url,
-                    'caption'  => \ForkBB\__('Moderator label'),
+                    'caption'  => __('Moderator label'),
                 ];
                 $form['sets']["forum{$forum->id}"] = [
                     'class'  => 'modforum',

+ 8 - 7
app/Models/Pages/Profile/Pass.php

@@ -8,6 +8,7 @@ use ForkBB\Core\Exceptions\MailException;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Pass extends Profile
 {
@@ -54,7 +55,7 @@ class Pass extends Profile
 
                 if ($this->rules->my) {
 #                    $auth = $this->c->Auth;
-#                    $auth->fIswev = ['s' => [\ForkBB\__('Pass updated')]];
+#                    $auth->fIswev = ['s' => [__('Pass updated')]];
 #                    return $auth->login(['_username' => $this->curUser->username], 'GET');
                     return $this->c->Redirect->page('Login')->message('Pass updated'); // ???? нужна передача данных между скриптами не привязанная к пользователю
                 } else {
@@ -66,8 +67,8 @@ class Pass extends Profile
         }
 
         $this->crumbs     = $this->crumbs(
-            [$this->c->Router->link('EditUserPass', ['id' => $this->curUser->id]), \ForkBB\__('Change pass')],
-            [$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), \ForkBB\__('Editing profile')]
+            [$this->c->Router->link('EditUserPass', ['id' => $this->curUser->id]), __('Change pass')],
+            [$this->c->Router->link('EditUserProfile', ['id' => $this->curUser->id]), __('Editing profile')]
         );
         $this->form       = $this->form();
         $this->actionBtns = $this->btns('edit');
@@ -94,14 +95,14 @@ class Pass extends Profile
                         'new_pass' => [
                             'type'      => 'password',
                             'maxlength' => 25,
-                            'caption'   => \ForkBB\__('New pass'),
+                            'caption'   => __('New pass'),
                             'required'  => true,
                             'pattern'   => '^.{16,}$',
-                            'info'      => \ForkBB\__('Pass format') . ' ' . \ForkBB\__('Pass info'),
+                            'info'      => __('Pass format') . ' ' . __('Pass info'),
                         ],
                         'password' => [
                             'type'      => 'password',
-                            'caption'   => \ForkBB\__('Your passphrase'),
+                            'caption'   => __('Your passphrase'),
                             'required'  => true,
                         ],
                     ],
@@ -110,7 +111,7 @@ class Pass extends Profile
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Submit'),
+                    'value'     => __('Submit'),
                     'accesskey' => 's',
                 ],
             ],

+ 36 - 35
app/Models/Pages/Profile/View.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages\Profile;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
+use function \ForkBB\__;
 
 class View extends Profile
 {
@@ -53,13 +54,13 @@ class View extends Profile
         $fields['username'] = [
             'class'   => 'pline',
             'type'    => 'str',
-            'caption' => \ForkBB\__('Username'),
+            'caption' => __('Username'),
             'value'   => $this->curUser->username,
         ];
         $fields['title'] = [
             'class'   => 'pline',
             'type'    => 'str',
-            'caption' => \ForkBB\__('Title'),
+            'caption' => __('Title'),
             'value'   => $this->curUser->title(),
         ];
         $fields[] = [
@@ -71,13 +72,13 @@ class View extends Profile
         ) {
             $fields['avatar'] = [
                 'type'    => 'yield',
-                'caption' => \ForkBB\__('Avatar'),
+                'caption' => __('Avatar'),
                 'value'   => 'avatar',
             ];
         }
         $form['sets']['header'] = [
             'class'  => 'header',
-#            'legend' => \ForkBB\__('Options'),
+#            'legend' => __('Options'),
             'fields' => $fields,
         ];
 
@@ -88,12 +89,12 @@ class View extends Profile
         ) {
             $form['sets']['note'] = [
                 'class'  => 'data',
-                'legend' => \ForkBB\__('Admin note'),
+                'legend' => __('Admin note'),
                 'fields' => [
                     'admin_note' => [
                         'class'     => 'pline',
                         'type'      => 'str',
-                        'caption'   => \ForkBB\__('Admin note'),
+                        'caption'   => __('Admin note'),
                         'value'     => $this->curUser->admin_note,
                     ],
                 ],
@@ -106,14 +107,14 @@ class View extends Profile
             $fields['realname'] = [
                 'class'   => 'pline',
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Realname'),
+                'caption' => __('Realname'),
                 'value'   => \ForkBB\cens($this->curUser->realname),
             ];
         }
         $genders = [
-            0 => \ForkBB\__('Do not display'),
-            1 => \ForkBB\__('Male'),
-            2 => \ForkBB\__('Female'),
+            0 => __('Do not display'),
+            1 => __('Male'),
+            2 => __('Female'),
         ];
         if (
             $this->curUser->gender
@@ -123,21 +124,21 @@ class View extends Profile
                 'class'   => 'pline',
                 'type'    => 'str',
                 'value'   => $genders[$this->curUser->gender],
-                'caption' => \ForkBB\__('Gender'),
+                'caption' => __('Gender'),
             ];
         }
         if ('' != $this->curUser->location) {
             $fields['location'] = [
                 'class'   => 'pline',
                 'type'    => 'str',
-                'caption' => \ForkBB\__('Location'),
+                'caption' => __('Location'),
                 'value'   => \ForkBB\cens($this->curUser->location),
             ];
         }
         if (! empty($fields)) {
             $form['sets']['personal'] = [
                 'class'  => 'data',
-                'legend' => \ForkBB\__('Personal information'),
+                'legend' => __('Personal information'),
                 'fields' => $fields,
             ];
         }
@@ -148,7 +149,7 @@ class View extends Profile
             $fields['open-email'] = [
                 'class'   => 'pline',
                 'type'    => 2 === $this->curUser->email_setting ? 'str' : 'link',
-                'caption' => \ForkBB\__('Email info'),
+                'caption' => __('Email info'),
                 'value'   => \ForkBB\cens($this->curUser->email),
                 'href'    => 'mailto:' . $this->curUser->email,
             ];
@@ -158,7 +159,7 @@ class View extends Profile
                 $fields['email'] = [
                     'class'   => 'pline',
                     'type'    => 'link',
-                    'caption' => \ForkBB\__('Email info'),
+                    'caption' => __('Email info'),
                     'value'   => \ForkBB\cens($this->curUser->email),
                     'href'    => 'mailto:' . $this->curUser->email,
                 ];
@@ -166,8 +167,8 @@ class View extends Profile
                 $fields['email'] = [
                     'class'   => 'pline',
                     'type'    => 'link',
-                    'caption' => \ForkBB\__('Email info'),
-                    'value'   => \ForkBB\__('Send email'),
+                    'caption' => __('Email info'),
+                    'value'   => __('Send email'),
                     'href'    => $this->c->Router->link('', ['id' => $this->curUser->id]), // ????
                 ];
             }
@@ -180,7 +181,7 @@ class View extends Profile
                 'id'      => 'website',
                 'class'   => 'pline',
                 'type'    => 'link',
-                'caption' => \ForkBB\__('Website'),
+                'caption' => __('Website'),
                 'value'   => \ForkBB\cens($this->curUser->url),
                 'href'    => \ForkBB\cens($this->curUser->url),
             ];
@@ -188,7 +189,7 @@ class View extends Profile
         if (! empty($fields)) {
             $form['sets']['contacts'] = [
                 'class'  => 'data',
-                'legend' => \ForkBB\__('Contact details'),
+                'legend' => __('Contact details'),
                 'fields' => $fields,
             ];
         }
@@ -199,14 +200,14 @@ class View extends Profile
             if ('' != $this->curUser->signature) {
                 $fields['signature'] = [
                     'type'    => 'yield',
-                    'caption' => \ForkBB\__('Signature'),
+                    'caption' => __('Signature'),
                     'value'   => 'signature',
                 ];
             }
             if (! empty($fields)) {
                 $form['sets']['signature'] = [
                     'class'  => 'data',
-                    'legend' => \ForkBB\__('Signature'),
+                    'legend' => __('Signature'),
                     'fields' => $fields,
                 ];
             }
@@ -218,21 +219,21 @@ class View extends Profile
             'class'   => 'pline',
             'type'    => 'str',
             'value'   => \ForkBB\dt($this->curUser->registered, true),
-            'caption' => \ForkBB\__('Registered info'),
+            'caption' => __('Registered info'),
         ];
         if ($this->rules->viewLastVisit) {
             $fields['lastvisit'] = [
                 'class'   => 'pline',
                 'type'    => 'str',
                 'value'   => \ForkBB\dt($this->curUser->currentVisit, true),
-                'caption' => \ForkBB\__('Last visit info'),
+                'caption' => __('Last visit info'),
             ];
         }
         $fields['lastpost'] = [
             'class'   => 'pline',
             'type'    => 'str',
             'value'   => \ForkBB\dt($this->curUser->last_post, true),
-            'caption' => \ForkBB\__('Last post info'),
+            'caption' => __('Last post info'),
         ];
         if (
             $this->curUser->num_posts
@@ -242,30 +243,30 @@ class View extends Profile
                 $fields['posts'] = [
                     'class'   => 'pline',
                     'type'    => 'link',
-                    'caption' => \ForkBB\__('Posts info'),
-                    'value'   => $this->user->showPostCount ? \ForkBB\num($this->curUser->num_posts) : \ForkBB\__('Show posts'),
+                    'caption' => __('Posts info'),
+                    'value'   => $this->user->showPostCount ? \ForkBB\num($this->curUser->num_posts) : __('Show posts'),
                     'href'    => $this->c->Router->link('SearchAction', ['action' => 'posts', 'uid' => $this->curUser->id]),
-                    'title'   => \ForkBB\__('Show posts'),
+                    'title'   => __('Show posts'),
                 ];
                 $fields['topics'] = [
                     'class'   => 'pline',
                     'type'    => 'link',
-                    'caption' => \ForkBB\__('Topics info'),
-                    'value'   => $this->user->showPostCount ? \ForkBB\num($this->curUser->num_topics) : \ForkBB\__('Show topics'),
+                    'caption' => __('Topics info'),
+                    'value'   => $this->user->showPostCount ? \ForkBB\num($this->curUser->num_topics) : __('Show topics'),
                     'href'    => $this->c->Router->link('SearchAction', ['action' => 'topics', 'uid' => $this->curUser->id]),
-                    'title'   => \ForkBB\__('Show topics'),
+                    'title'   => __('Show topics'),
                 ];
             } elseif ($this->user->showPostCount) {
                 $fields['posts'] = [
                     'class'   => 'pline',
                     'type'    => 'str',
-                    'caption' => \ForkBB\__('Posts info'),
+                    'caption' => __('Posts info'),
                     'value'   => \ForkBB\num($this->curUser->num_posts),
                 ];
                 $fields['topics'] = [
                     'class'   => 'pline',
                     'type'    => 'str',
-                    'caption' => \ForkBB\__('Topics info'),
+                    'caption' => __('Topics info'),
                     'value'   => \ForkBB\num($this->curUser->num_topics),
                 ];
             }
@@ -277,15 +278,15 @@ class View extends Profile
             $fields['ip'] = [
                 'class'   => 'pline',
                 'type'    => 'link',
-                'caption' => \ForkBB\__('IP'),
+                'caption' => __('IP'),
                 'value'   => $this->curUser->registration_ip,
                 'href'    => $this->c->Router->link('AdminHost', ['ip' => $this->curUser->registration_ip]),
-                'title'   => \ForkBB\__('IP title'),
+                'title'   => __('IP title'),
             ];
         }
         $form['sets']['activity'] = [
             'class'  => 'data',
-            'legend' => \ForkBB\__('User activity'),
+            'legend' => __('User activity'),
             'fields' => $fields,
         ];
 

+ 3 - 2
app/Models/Pages/Redirect.php

@@ -3,6 +3,7 @@
 namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
+use function \ForkBB\__;
 
 class Redirect extends Page
 {
@@ -58,9 +59,9 @@ class Redirect extends Page
         }
 
         $this->nameTpl = 'layouts/redirect';
-        $this->titles  = \ForkBB\__('Redirecting');
+        $this->titles  = __('Redirecting');
         $this->robots  = 'noindex';
-        $this->message = \ForkBB\__($message);
+        $this->message = __($message);
         $this->timeout = (int) $this->c->config->o_redirect_delay;  //???? перенести в заголовки?
 
         return $this;

+ 27 - 26
app/Models/Pages/Register.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Core\Exceptions\MailException;
 use ForkBB\Models\Page;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Register extends Page
 {
@@ -33,7 +34,7 @@ class Register extends Page
                 'password' => 'Passphrase',
             ])->addMessages([
                 'agree.required'    => ['cancel', 'cancel'],
-                'agree.token'       => ['w', \ForkBB\__('Bad agree', $this->c->Router->link('Register'))],
+                'agree.token'       => ['w', __('Bad agree', $this->c->Router->link('Register'))],
                 'password.password' => 'Pass format',
                 'username.login'    => 'Login format',
             ]);
@@ -56,7 +57,7 @@ class Register extends Page
         $this->fIndex     = 'register';
         $this->nameTpl    = 'register';
         $this->onlinePos  = 'register';
-        $this->titles     = \ForkBB\__('Register');
+        $this->titles     = __('Register');
         $this->robots     = 'noindex';
         $this->form       = $this->formReg($v);
 
@@ -88,8 +89,8 @@ class Register extends Page
                             'type'      => 'text',
                             'maxlength' => 80,
                             'value'     => $v->email,
-                            'caption'   => \ForkBB\__('Email'),
-                            'info'      => \ForkBB\__('Email info'),
+                            'caption'   => __('Email'),
+                            'info'      => __('Email info'),
                             'required'  => true,
                             'pattern'   => '.+@.+',
                         ],
@@ -98,16 +99,16 @@ class Register extends Page
                             'type'      => 'text',
                             'maxlength' => 25,
                             'value'     => $v->username,
-                            'caption'   => \ForkBB\__('Username'),
-                            'info'      => \ForkBB\__('Login format'),
+                            'caption'   => __('Username'),
+                            'info'      => __('Login format'),
                             'required'  => true,
                             'pattern'   => '^.{2,25}$',
                         ],
                         'password' => [
                             'class'     => 'hint',
                             'type'      => 'password',
-                            'caption'   => \ForkBB\__('Passphrase'),
-                            'info'      => \ForkBB\__('Pass format') . ' ' . \ForkBB\__('Pass info'),
+                            'caption'   => __('Passphrase'),
+                            'info'      => __('Pass format') . ' ' . __('Pass info'),
                             'required'  => true,
                             'pattern'   => '^.{16,}$',
                         ],
@@ -117,7 +118,7 @@ class Register extends Page
             'btns'   => [
                 'register' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Sign up'),
+                    'value'     => __('Sign up'),
                     'accesskey' => 's',
                 ],
             ],
@@ -167,11 +168,11 @@ class Register extends Page
             && '' != $this->c->config->o_mailing_list
         ) {
             $tplData = [
-                'fTitle' => $this->c->config->o_board_title,
+                'fTitle'    => $this->c->config->o_board_title,
                 'fRootLink' => $this->c->Router->link('Index'),
-                'fMailer' => \ForkBB\__('Mailer', $this->c->config->o_board_title),
-                'username' => $v->username,
-                'userLink' => $this->c->Router->link('User', ['id' => $newUserId, 'name' => $v->username]),
+                'fMailer'   => __('Mailer', $this->c->config->o_board_title),
+                'username'  => $v->username,
+                'userLink'  => $this->c->Router->link('User', ['id' => $newUserId, 'name' => $v->username]),
             ];
 
             try {
@@ -180,7 +181,7 @@ class Register extends Page
                     ->setFolder($this->c->DIR_LANG)
                     ->setLanguage($this->c->config->o_default_lang) // ????
                     ->setTo($this->c->config->o_mailing_list)
-                    ->setFrom($this->c->config->o_webmaster_email, \ForkBB\__('Mailer', $this->c->config->o_board_title))
+                    ->setFrom($this->c->config->o_webmaster_email, __('Mailer', $this->c->config->o_board_title))
                     ->setTpl('new_user.tpl', $tplData)
                     ->send();
             } catch (MailException $e) {
@@ -195,11 +196,11 @@ class Register extends Page
             $hash = $this->c->Secury->hash($newUserId . $key);
             $link = $this->c->Router->link('RegActivate', ['id' => $newUserId, 'key' => $key, 'hash' => $hash]);
             $tplData = [
-                'fTitle' => $this->c->config->o_board_title,
+                'fTitle'    => $this->c->config->o_board_title,
                 'fRootLink' => $this->c->Router->link('Index'),
-                'fMailer' => \ForkBB\__('Mailer', $this->c->config->o_board_title),
-                'username' => $v->username,
-                'link' => $link,
+                'fMailer'   => __('Mailer', $this->c->config->o_board_title),
+                'username'  => $v->username,
+                'link'      => $link,
             ];
 
             try {
@@ -208,7 +209,7 @@ class Register extends Page
                     ->setFolder($this->c->DIR_LANG)
                     ->setLanguage($this->user->language)
                     ->setTo($v->email)
-                    ->setFrom($this->c->config->o_webmaster_email, \ForkBB\__('Mailer', $this->c->config->o_board_title))
+                    ->setFrom($this->c->config->o_webmaster_email, __('Mailer', $this->c->config->o_board_title))
                     ->setTpl('welcome.tpl', $tplData)
                     ->send();
             } catch (MailException $e) {
@@ -217,17 +218,17 @@ class Register extends Page
 
             // письмо активации аккаунта отправлено
             if ($isSent) {
-                return $this->c->Message->message(\ForkBB\__('Reg email', $this->c->config->o_admin_email), false, 200);
+                return $this->c->Message->message(__('Reg email', $this->c->config->o_admin_email), false, 200);
             // форма сброса пароля
             } else {
-                $auth = $this->c->Auth;
-                $auth->fIswev = ['w', \ForkBB\__('Error welcom mail', $this->c->config->o_admin_email)];
+                $auth         = $this->c->Auth;
+                $auth->fIswev = ['w', __('Error welcom mail', $this->c->config->o_admin_email)];
                 return $auth->forget(['_email' => $v->email], 'GET');
             }
         // форма логина
         } else {
-            $auth = $this->c->Auth;
-            $auth->fIswev = ['s', \ForkBB\__('Reg complete')];
+            $auth         = $this->c->Auth;
+            $auth->fIswev = ['s', __('Reg complete')];
             return $auth->login(['_username' => $v->username], 'GET');
         }
     }
@@ -259,8 +260,8 @@ class Register extends Page
 
         $this->c->Lang->load('register');
 
-        $auth = $this->c->Auth;
-        $auth->fIswev = ['s', \ForkBB\__('Reg complete')];
+        $auth         = $this->c->Auth;
+        $auth->fIswev = ['s', __('Reg complete')];
         return $auth->login(['_username' => $user->username], 'GET');
     }
 }

+ 12 - 11
app/Models/Pages/Report.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Exceptions\MailException;
 use ForkBB\Models\Page;
 use ForkBB\Models\Post\Model as Post;
 use ForkBB\Models\Report\Model as ReportModel;
+use function \ForkBB\__;
 
 class Report extends Page
 {
@@ -32,7 +33,7 @@ class Report extends Page
         $floodSize = \time() - (int) $this->user->last_report_sent;
         $floodSize = $floodSize < $this->user->g_report_flood ? $this->user->g_report_flood - $floodSize : 0;
         if ($floodSize > 0) {
-            $this->fIswev = ['e', \ForkBB\__('Report flood', $this->user->g_report_flood, $floodSize)];
+            $this->fIswev = ['e', __('Report flood', $this->user->g_report_flood, $floodSize)];
         }
 
         $data = [];
@@ -56,8 +57,8 @@ class Report extends Page
             ) {
                 $report = $this->c->reports->create();
 
-                $report->author = $this->user;
-                $report->post = $post;
+                $report->author  = $this->user;
+                $report->post    = $post;
                 $report->message = $v->reason;
 
                 $result = true;
@@ -93,8 +94,8 @@ 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(\ForkBB\__('Report post'), $topic);
-        $this->formTitle = \ForkBB\__('Report post');
+        $this->crumbs    = $this->crumbs(__('Report post'), $topic);
+        $this->formTitle = __('Report post');
         $this->form      = $this->formReport($args, $data);
 
         return $this;
@@ -117,11 +118,11 @@ class Report extends Page
             ],
             'sets'   => [
                 'report' => [
-                    'legend' => \ForkBB\__('Reason desc'),
+                    'legend' => __('Reason desc'),
                     'fields' => [
                         'reason' => [
                             'type'      => 'textarea',
-                            'caption'   => \ForkBB\__('Reason'),
+                            'caption'   => __('Reason'),
                             'required'  => true,
                             'value'     => $data['reason'] ?? null,
                             'autofocus' => true,
@@ -132,12 +133,12 @@ class Report extends Page
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Submit'),
+                    'value'     => __('Submit'),
                     'accesskey' => 's',
                 ],
                 'back' => [
                     'type'      => 'btn',
-                    'value'     => \ForkBB\__('Go back'),
+                    'value'     => __('Go back'),
                     'link'      => 'javascript:history.go(-1)',
                     'class'     => 'f-minor',
                 ],
@@ -155,7 +156,7 @@ class Report extends Page
     protected function sendReport(ReportModel $report): bool
     {
         $tplData = [
-            'fMailer' => \ForkBB\__('Mailer', $this->c->config->o_board_title),
+            'fMailer' => __('Mailer', $this->c->config->o_board_title),
             'username' => $report->author->username,
             'postLink' => $this->c->Router->link('ViewPost', ['id' => $report->post->id]),
             'reason' => $report->message,
@@ -168,7 +169,7 @@ class Report extends Page
             ->setFolder($this->c->DIR_LANG)
             ->setLanguage($this->c->config->o_default_lang) // ????
             ->setTo($this->c->config->o_mailing_list)
-            ->setFrom($this->c->config->o_webmaster_email, \ForkBB\__('Mailer', $this->c->config->o_board_title))
+            ->setFrom($this->c->config->o_webmaster_email, __('Mailer', $this->c->config->o_board_title))
             ->setTpl('new_report.tpl', $tplData)
             ->send();
     }

+ 8 - 7
app/Models/Pages/Rules.php

@@ -3,6 +3,7 @@
 namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
+use function \ForkBB\__;
 
 class Rules extends Page
 {
@@ -17,8 +18,8 @@ class Rules extends Page
         $this->nameTpl    = 'rules';
         $this->onlinePos  = 'rules';
         $this->canonical  = $this->c->Router->link('Rules');
-        $this->title      = \ForkBB\__('Forum rules');
-        $this->crumbs     = $this->crumbs([$this->c->Router->link('Rules'), \ForkBB\__('Forum rules')]);
+        $this->title      = __('Forum rules');
+        $this->crumbs     = $this->crumbs([$this->c->Router->link('Rules'), __('Forum rules')]);
         $this->rules      = $this->c->config->o_rules_message;
 
         return $this;
@@ -37,9 +38,9 @@ class Rules extends Page
         $this->nameTpl    = 'rules';
         $this->onlinePos  = 'rules';
         $this->robots     = 'noindex';
-        $this->title      = \ForkBB\__('Forum rules');
-        $this->crumbs     = $this->crumbs(\ForkBB\__('Forum rules'), [$this->c->Router->link('Register'), \ForkBB\__('Register')]);
-        $this->rules      = '1' == $this->c->config->o_rules ? $this->c->config->o_rules_message : \ForkBB\__('If no rules');
+        $this->title      = __('Forum rules');
+        $this->crumbs     = $this->crumbs(__('Forum rules'), [$this->c->Router->link('Register'), __('Register')]);
+        $this->rules      = '1' == $this->c->config->o_rules ? $this->c->config->o_rules_message : __('If no rules');
         $this->form       = $this->formAgree();
 
         return $this;
@@ -62,7 +63,7 @@ class Rules extends Page
                     'fields' => [
                         'agree' => [
                             'type'    => 'checkbox',
-                            'label'   => \ForkBB\__('Agree'),
+                            'label'   => __('Agree'),
                             'value'   => $this->c->Csrf->create('Register'),
                         ],
                     ],
@@ -71,7 +72,7 @@ class Rules extends Page
             'btns'   => [
                 'register' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Register'),
+                    'value'     => __('Register'),
                     'accesskey' => 's',
                 ],
             ],

+ 42 - 41
app/Models/Pages/Search.php

@@ -7,6 +7,7 @@ use ForkBB\Models\Page;
 use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\User\Model as User;
 use InvalidArgumentException;
+use function \ForkBB\__;
 
 class Search extends Page
 {
@@ -23,15 +24,15 @@ class Search extends Page
             foreach ($this->c->forums->depthList($root, -1) as $f) {
                 if ($cid !== $f->cat_id) {
                     $cid       = $f->cat_id;
-                    $options[] = [\ForkBB\__('Category prefix') . $f->cat_name];
+                    $options[] = [__('Category prefix') . $f->cat_name];
                 }
 
-                $indent = \str_repeat(\ForkBB\__('Forum indent'), $f->depth);
+                $indent = \str_repeat(__('Forum indent'), $f->depth);
 
                 if ($f->redirect_url) {
-                    $options[] = [$f->id, $indent . \ForkBB\__('Forum prefix') . $f->forum_name, true];
+                    $options[] = [$f->id, $indent . __('Forum prefix') . $f->forum_name, true];
                 } else {
-                    $options[] = [$f->id, $indent . \ForkBB\__('Forum prefix') . $f->forum_name];
+                    $options[] = [$f->id, $indent . __('Forum prefix') . $f->forum_name];
                     $idxs[]    = $f->id;
                 }
             }
@@ -164,14 +165,14 @@ class Search extends Page
                     'fields' => [
                         [
                             'type'  => 'info',
-                            'value' => \ForkBB\__('<a href="%s">Advanced search</a>', $this->c->Router->link('SearchAdvanced')),
+                            'value' => __('<a href="%s">Advanced search</a>', $this->c->Router->link('SearchAdvanced')),
                             'html'  => true,
                         ],
                         'keywords' => [
                             'class'     => 'w0',
                             'type'      => 'text',
                             'maxlength' => 100,
-                            'caption'   => \ForkBB\__('Keyword search'),
+                            'caption'   => __('Keyword search'),
                             'value'     => $v ? $v->keywords : '',
                             'required'  => true,
                             'autofocus' => true,
@@ -182,7 +183,7 @@ class Search extends Page
             'btns'   => [
                 'search' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Search btn'),
+                    'value'     => __('Search btn'),
                     'accesskey' => 's',
                 ],
             ],
@@ -208,14 +209,14 @@ class Search extends Page
                     'fields' => [
                         [
                             'type'  => 'info',
-                            'value' => \ForkBB\__('<a href="%s">Simple search</a>', $this->c->Router->link('Search')),
+                            'value' => __('<a href="%s">Simple search</a>', $this->c->Router->link('Search')),
                             'html'  => true,
                         ],
                         'keywords' => [
                             'class'     => 'w2',
                             'type'      => 'text',
                             'maxlength' => 100,
-                            'caption'   => \ForkBB\__('Keyword search'),
+                            'caption'   => __('Keyword search'),
                             'value'     => $v ? $v->keywords : '',
                             'required'  => true,
                             'autofocus' => true,
@@ -224,87 +225,87 @@ class Search extends Page
                             'class'     => 'w1',
                             'type'      => 'text',
                             'maxlength' => 25,
-                            'caption'   => \ForkBB\__('Author search'),
+                            'caption'   => __('Author search'),
                             'value'     => $v ? $v->author : '*',
                             'required'  => true,
                         ],
                         [
                             'type'  => 'info',
-                            'value' => \ForkBB\__('Search info'),
+                            'value' => __('Search info'),
                         ],
                     ],
                 ],
                 'where' => [
-                    'legend' => \ForkBB\__('Search in legend'),
+                    'legend' => __('Search in legend'),
                     'fields' => [
                         'forums' => [
                             'class'   => 'w3',
                             'type'    => 'multiselect',
                             'options' => $this->listForOptions,
                             'value'   => $v ? \explode('.', $v->forums) : null,
-                            'caption' => \ForkBB\__('Forum search'),
+                            'caption' => __('Forum search'),
                             'size'    => \min(\count($this->listForOptions), 10),
                         ],
                         'serch_in' => [
                             'class'   => 'w3',
                             'type'    => 'select',
                             'options' => [
-                                0 => \ForkBB\__('Message and subject'),
-                                1 => \ForkBB\__('Message only'),
-                                2 => \ForkBB\__('Topic only'),
+                                0 => __('Message and subject'),
+                                1 => __('Message only'),
+                                2 => __('Topic only'),
                             ],
                             'value'   => $v ? $v->serch_in : 0,
-                            'caption' => \ForkBB\__('Search in'),
+                            'caption' => __('Search in'),
                         ],
                         [
                             'type'  => 'info',
-                            'value' => \ForkBB\__('Search in info'),
+                            'value' => __('Search in info'),
                         ],
                         [
                             'type'  => 'info',
-                            'value' => \ForkBB\__('Search multiple forums info'),
+                            'value' => __('Search multiple forums info'),
                         ],
 
                     ],
                 ],
                 'how' => [
-                    'legend' => \ForkBB\__('Search results legend'),
+                    'legend' => __('Search results legend'),
                     'fields' => [
                         'sort_by' => [
                             'class'   => 'w4',
                             'type'    => 'select',
                             'options' => [
-                                0 => \ForkBB\__('Sort by post time'),
-                                1 => \ForkBB\__('Sort by author'),
-                                2 => \ForkBB\__('Sort by subject'),
-                                3 => \ForkBB\__('Sort by forum'),
+                                0 => __('Sort by post time'),
+                                1 => __('Sort by author'),
+                                2 => __('Sort by subject'),
+                                3 => __('Sort by forum'),
                             ],
                             'value'   => $v ? $v->sort_by : 0,
-                            'caption' => \ForkBB\__('Sort by'),
+                            'caption' => __('Sort by'),
                         ],
                         'sort_dir' => [
                             'class'   => 'w4',
                             'type'    => 'radio',
                             'values'  => [
-                                0 => \ForkBB\__('Descending'),
-                                1 => \ForkBB\__('Ascending'),
+                                0 => __('Descending'),
+                                1 => __('Ascending'),
                             ],
                             'value'   => $v ? $v->sort_dir : 0,
-                            'caption' => \ForkBB\__('Sort order'),
+                            'caption' => __('Sort order'),
                         ],
                         'show_as' => [
                             'class'   => 'w4',
                             'type'    => 'radio',
                             'values'  => [
-                                0 => \ForkBB\__('Show as posts'),
-                                1 => \ForkBB\__('Show as topics'),
+                                0 => __('Show as posts'),
+                                1 => __('Show as topics'),
                             ],
                             'value'   => $v ? $v->show_as : 0,
-                            'caption' => \ForkBB\__('Show as'),
+                            'caption' => __('Show as'),
                         ],
                         [
                             'type'  => 'info',
-                            'value' => \ForkBB\__('Search results info'),
+                            'value' => __('Search results info'),
                         ],
                     ],
 
@@ -313,7 +314,7 @@ class Search extends Page
             'btns'   => [
                 'search' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__('Search btn'),
+                    'value'     => __('Search btn'),
                     'accesskey' => 's',
                 ],
             ],
@@ -341,7 +342,7 @@ class Search extends Page
                 $search = $this->c->search;
 
                 if (! $search->prepare($query)) {
-                    $v->addError(\ForkBB\__($search->queryError, $search->queryText));
+                    $v->addError(__($search->queryError, $search->queryText));
                 } else {
 
                     if ($this->c->search->execute($v, $this->listOfIndexes, $flood)) {
@@ -363,7 +364,7 @@ class Search extends Page
             }
 
             if ($flood) {
-                $v->addError(\ForkBB\__('Search flood', $this->user->g_search_flood, $this->user->g_search_flood - \time() + $this->user->last_search));
+                $v->addError(__('Search flood', $this->user->g_search_flood, $this->user->g_search_flood - \time() + $this->user->last_search));
             }
         }
 
@@ -469,9 +470,9 @@ class Search extends Page
                     $asTopicsList  = false;
                 }
                 if ('*' === $args['author']) {
-                    $model->name   = \ForkBB\__('Search query: %s', $args['keywords']);
+                    $model->name   = __('Search query: %s', $args['keywords']);
                 } else {
-                    $model->name   = \ForkBB\__('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 +489,7 @@ class Search extends Page
                 }
                 $uid               = $this->user->id;
                 $list              = $model->actionT($action, $forum, $uid);
-                $model->name       = \ForkBB\__('Quick search ' . $action);
+                $model->name       = __('Quick search ' . $action);
                 $model->linkMarker = 'SearchAction';
                 if ($forum->id) {
                     $model->linkArgs = ['action' => $action, 'forum' => $forum->id];
@@ -515,7 +516,7 @@ class Search extends Page
                 } else {
                     $list          = $model->actionP($action, $forum, $user->id);
                 }
-                $model->name       = \ForkBB\__('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];
@@ -531,7 +532,7 @@ class Search extends Page
         if (false === $list) {
             return $this->c->Message->message('Bad request');
         } elseif (empty($list)) {
-            $this->fIswev = ['i', \ForkBB\__('No hits')];
+            $this->fIswev = ['i', __('No hits')];
             return $this->view([], 'GET', true);
         }
 
@@ -567,7 +568,7 @@ class Search extends Page
      */
     protected function crumbs(...$crumbs): array
     {
-        $crumbs[] = [$this->c->Router->link('Search'), \ForkBB\__('Search')];
+        $crumbs[] = [$this->c->Router->link('Search'), __('Search')];
         return parent::crumbs(...$crumbs);
     }
 }

+ 8 - 7
app/Models/Pages/Topic.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages;
 
 use ForkBB\Models\Page;
 use ForkBB\Models\Topic\Model as TopicModel;
+use function \ForkBB\__;
 
 class Topic extends Page
 {
@@ -206,39 +207,39 @@ class Topic extends Page
         if ($topic->closed) {
             $form['btns']['open'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Open topic'),
+                'value'     => __('Open topic'),
             ];
         } else {
             $form['btns']['close'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Close topic'),
+                'value'     => __('Close topic'),
             ];
         }
 
         if ($topic->sticky) {
             $form['btns']['unstick'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Unstick topic'),
+                'value'     => __('Unstick topic'),
             ];
         } else {
             $form['btns']['stick'] = [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Stick topic'),
+                'value'     => __('Stick topic'),
             ];
         }
 
         $form['btns'] += [
             'move' => [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Move topic'),
+                'value'     => __('Move topic'),
             ],
             'delete' => [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Delete'),
+                'value'     => __('Delete'),
             ],
             'split' => [
                 'type'      => 'submit',
-                'value'     => \ForkBB\__('Split'),
+                'value'     => __('Split'),
             ],
         ];
 

+ 17 - 16
app/Models/Pages/Userlist.php

@@ -6,6 +6,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Forum\Model as Forum;
 use InvalidArgumentException;
+use function \ForkBB\__;
 
 class Userlist extends Page
 {
@@ -17,7 +18,7 @@ class Userlist extends Page
     protected function getgroupList(): array
     {
         $list = [
-            'all' => \ForkBB\__('All users'),
+            'all' => __('All users'),
         ];
 
         foreach ($this->c->groups->getList() as $group) {
@@ -94,7 +95,7 @@ class Userlist extends Page
 
         if ($number) {
             $this->startNum = ($page - 1) * $this->c->config->o_disp_users;
-            $ids = \array_slice($ids, $this->startNum, $this->c->config->o_disp_users);
+            $ids            = \array_slice($ids, $this->startNum, $this->c->config->o_disp_users);
             $this->userList = $this->c->users->loadByIds($ids);
 
             $links = [];
@@ -114,7 +115,7 @@ class Userlist extends Page
                 $vars['sort'] = $sort;
 
                 foreach (['ASC', 'DESC'] as $j => $dir) {
-                    $vars['dir'] = $dir;
+                    $vars['dir']        = $dir;
                     $links[$i * 2 + $j] = $this->c->Router->link('Userlist', $vars);
 
                     if (
@@ -131,7 +132,7 @@ class Userlist extends Page
             $this->startNum = 0;
             $this->userList = null;
             $this->links    = [null, null, null, null, null, null];
-            $this->fIswev   = ['i', \ForkBB\__('No users found')];
+            $this->fIswev   = ['i', __('No users found')];
         }
 
         $this->fIndex       = 'userlist';
@@ -139,7 +140,7 @@ class Userlist extends Page
         $this->onlinePos    = 'userlist';
         $this->canonical    = $this->c->Router->link('Userlist', $args);
         $this->robots       = 'noindex';
-        $this->crumbs       = $this->crumbs([$this->c->Router->link('Userlist'), \ForkBB\__('User list')]);
+        $this->crumbs       = $this->crumbs([$this->c->Router->link('Userlist'), __('User list')]);
         $this->pagination   = $this->c->Func->paginate($pages, $page, 'Userlist', $args);
         $this->form         = $this->formUserlist($v);
 
@@ -162,7 +163,7 @@ class Userlist extends Page
             'btns'   => [
                 'submit' => [
                     'type'      => 'submit',
-                    'value'     => \ForkBB\__($this->user->searchUsers ? 'Search btn' : 'Submit'),
+                    'value'     => __($this->user->searchUsers ? 'Search btn' : 'Submit'),
                     'accesskey' => 's',
                 ],
             ],
@@ -176,8 +177,8 @@ class Userlist extends Page
                 'type'      => 'text',
                 'maxlength' => 25,
                 'value'     => $v->name ?: '*',
-                'caption'   => \ForkBB\__('Username'),
-                'info'      => \ForkBB\__('User search info'),
+                'caption'   => __('Username'),
+                'info'      => __('User search info'),
                 'required'  => true,
 #               'autofocus' => true,
             ];
@@ -189,28 +190,28 @@ class Userlist extends Page
             'type'    => 'select',
             'options' => $this->groupList,
             'value'   => $v->group,
-            'caption' => \ForkBB\__('User group'),
+            'caption' => __('User group'),
         ];
         $fields['sort'] = [
             'class'   => 'w4',
             'type'    => 'select',
             'options' => [
-                ['username', \ForkBB\__('Sort by name')],
-                ['num_posts', \ForkBB\__('Sort by number'), $this->user->showPostCount ? null : true],
-                ['registered', \ForkBB\__('Sort by date')],
+                ['username', __('Sort by name')],
+                ['num_posts', __('Sort by number'), $this->user->showPostCount ? null : true],
+                ['registered', __('Sort by date')],
             ],
             'value'   => $v->sort,
-            'caption' => \ForkBB\__('Sort users by'),
+            'caption' => __('Sort users by'),
         ];
         $fields['dir'] = [
             'class'   => 'w4',
             'type'    => 'radio',
             'value'   => $v->dir ?: 'ASC',
             'values'  => [
-                'ASC'  => \ForkBB\__('Ascending'),
-                'DESC' => \ForkBB\__('Descending'),
+                'ASC'  => __('Ascending'),
+                'DESC' => __('Descending'),
             ],
-            'caption' => \ForkBB\__('User sort order'),
+            'caption' => __('User sort order'),
         ];
         $form['sets']['users'] = ['fields' => $fields];
 

+ 0 - 1
app/Models/Rules/Profile.php

@@ -5,7 +5,6 @@ namespace ForkBB\Models\Rules;
 use ForkBB\Models\Model;
 use ForkBB\Models\Rules;
 use ForkBB\Models\User\Model as User;
-use RuntimeException;
 
 class Profile extends Rules
 {

+ 0 - 1
app/Models/Rules/Users.php

@@ -6,7 +6,6 @@ use ForkBB\Models\Model;
 use ForkBB\Models\Rules;
 use ForkBB\Models\User\Model as User;
 use ForkBB\Models\Rules\Profile as ProfileRules;
-use RuntimeException;
 
 class Users extends Rules
 {

+ 5 - 2
app/Models/Search/ActionP.php

@@ -6,7 +6,6 @@ use ForkBB\Models\Method;
 use ForkBB\Models\Forum\Model as Forum;
 use PDO;
 use InvalidArgumentException;
-use RuntimeException;
 
 class ActionP extends Method
 {
@@ -78,7 +77,11 @@ class ActionP extends Method
             return [];
         }
 
-        $this->model->idsList = \array_slice($list, ($this->model->page - 1) * $this->c->user->disp_posts, $this->c->user->disp_posts);
+        $this->model->idsList = \array_slice(
+            $list,
+            ($this->model->page - 1) * $this->c->user->disp_posts,
+            $this->c->user->disp_posts
+        );
 
         return $this->c->posts->view($this->model);
     }

+ 5 - 2
app/Models/Search/ActionT.php

@@ -6,7 +6,6 @@ use ForkBB\Models\Method;
 use ForkBB\Models\Forum\Model as Forum;
 use PDO;
 use InvalidArgumentException;
-use RuntimeException;
 
 class ActionT extends Method
 {
@@ -98,7 +97,11 @@ class ActionT extends Method
             return [];
         }
 
-        $this->model->idsList = \array_slice($list, ($this->model->page - 1) * $this->c->user->disp_topics, $this->c->user->disp_topics);
+        $this->model->idsList = \array_slice(
+            $list,
+            ($this->model->page - 1) * $this->c->user->disp_topics,
+            $this->c->user->disp_topics
+        );
 
         return $this->c->topics->view($this->model);
     }

+ 0 - 1
app/Models/Search/Execute.php

@@ -7,7 +7,6 @@ use ForkBB\Models\Method;
 use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\Post\Model as Post;
 use PDO;
-use InvalidArgumentException;
 use RuntimeException;
 
 class Execute extends Method

+ 3 - 6
app/Models/Search/Index.php

@@ -3,11 +3,8 @@
 namespace ForkBB\Models\Search;
 
 use ForkBB\Models\Method;
-use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\Post\Model as Post;
 use PDO;
-use InvalidArgumentException;
-use RuntimeException;
 
 class Index extends Method
 {
@@ -115,9 +112,9 @@ class Index extends Method
             }
 
             $vars = [
-                ':pid'    => $post->id,
-                ':subj'   => 's' === $key ? 1 : 0,
-                ':words'  => $list,
+                ':pid'   => $post->id,
+                ':subj'  => 's' === $key ? 1 : 0,
+                ':words' => $list,
             ];
             $sql = 'INSERT INTO ::search_matches (post_id, word_id, subject_match)
                     SELECT ?i:pid, id, ?i:subj

+ 0 - 5
app/Models/Search/Model.php

@@ -3,11 +3,6 @@
 namespace ForkBB\Models\Search;
 
 use ForkBB\Models\Model as ParentModel;
-use ForkBB\Models\Forum\Model as Forum;
-use ForkBB\Models\Post\Model as Post;
-use PDO;
-use InvalidArgumentException;
-use RuntimeException;
 
 class Model extends ParentModel
 {

+ 1 - 6
app/Models/Search/Prepare.php

@@ -3,11 +3,6 @@
 namespace ForkBB\Models\Search;
 
 use ForkBB\Models\Method;
-use ForkBB\Models\Forum\Model as Forum;
-use ForkBB\Models\Post\Model as Post;
-use PDO;
-use InvalidArgumentException;
-use RuntimeException;
 
 class Prepare extends Method
 {
@@ -197,7 +192,7 @@ class Prepare extends Method
                 $word = '(' . $this->queryText($word) . ')';
             }
             $result .= $space . $word;
-            $space = ' ';
+            $space   = ' ';
         }
         return $result;
     }

+ 0 - 5
app/Models/Search/TruncateIndex.php

@@ -3,11 +3,6 @@
 namespace ForkBB\Models\Search;
 
 use ForkBB\Models\Method;
-use ForkBB\Models\Forum\Model as Forum;
-use ForkBB\Models\Post\Model as Post;
-use PDO;
-use InvalidArgumentException;
-use RuntimeException;
 
 class TruncateIndex extends Method
 {

+ 6 - 4
app/Models/Topic/CalcStat.php

@@ -22,7 +22,7 @@ class CalcStat extends Method
         }
 
         if ($this->model->moved_to) {
-            $num_replies = 0;
+            $numReplies = 0;
         } else {
             $vars = [
                 ':tid' => $this->model->id
@@ -31,7 +31,7 @@ class CalcStat extends Method
                     FROM ::posts AS p
                     WHERE p.topic_id=?i:tid';
 
-            $num_replies = $this->c->DB->query($sql, $vars)->fetchColumn();
+            $numReplies = $this->c->DB->query($sql, $vars)->fetchColumn();
 
             $sql = 'SELECT p.id, p.poster, p.poster_id, p.posted
                     FROM ::posts AS p
@@ -57,11 +57,13 @@ class CalcStat extends Method
             $this->model->last_post_id   = $result['id'];
             $this->model->last_poster    = $result['poster'];
             $this->model->last_poster_id = $result['poster_id'];
-            $this->model->last_post      = $result['edited'] > 0 && $result['edited'] > $result['posted'] ? $result['edited'] : $result['posted'];
+            $this->model->last_post      = $result['edited'] > 0 && $result['edited'] > $result['posted']
+                ? $result['edited']
+                : $result['posted'];
         }
 
         //????
-        $this->model->num_replies = $num_replies;
+        $this->model->num_replies = $numReplies;
 
         return $this->model;
     }

+ 5 - 4
app/Models/User/Model.php

@@ -8,6 +8,7 @@ use ForkBB\Models\Model as BaseModel;
 use ForkBB\Models\Forum\Model as Forum;
 use ForkBB\Models\Post\Model as Post;
 use RuntimeException;
+use function \ForkBB\__;
 
 class Model extends DataModel
 {
@@ -218,17 +219,17 @@ class Model extends DataModel
     public function title(): string
     {
         if (isset($this->c->bans->userList[\mb_strtolower($this->username)])) { //????
-            return \ForkBB\__('Banned');
+            return __('Banned');
         } elseif ('' != $this->title) {
             return \ForkBB\cens($this->title);
         } elseif ('' != $this->g_user_title) {
             return \ForkBB\cens($this->g_user_title);
         } elseif ($this->isGuest) {
-            return \ForkBB\__('Guest');
+            return __('Guest');
         } elseif ($this->isUnverified) {
-            return \ForkBB\__('Unverified');
+            return __('Unverified');
         } else {
-            return \ForkBB\__('Member');
+            return __('Member');
         }
     }
 

+ 2 - 1
app/Models/Validators/Email.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Validators;
 use ForkBB\Core\Validator;
 use ForkBB\Core\Validators;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Email extends Validators
 {
@@ -109,7 +110,7 @@ class Email extends Validators
                 $flood = $this->c->FLOOD_INTERVAL;
             }
             if ($flood < $this->c->FLOOD_INTERVAL) {
-                $v->addError(\ForkBB\__('Email flood', (int) (($this->c->FLOOD_INTERVAL - $flood) / 60)), 'e');
+                $v->addError(__('Email flood', (int) (($this->c->FLOOD_INTERVAL - $flood) / 60)), 'e');
                 $ok = false;
             }
         }

+ 2 - 1
app/Models/Validators/Username.php

@@ -5,6 +5,7 @@ namespace ForkBB\Models\Validators;
 use ForkBB\Core\Validator;
 use ForkBB\Core\Validators;
 use ForkBB\Models\User\Model as User;
+use function \ForkBB\__;
 
 class Username extends Validators
 {
@@ -36,7 +37,7 @@ class Username extends Validators
             if (! \preg_match('%^(?=.{2,25}$)\p{L}[\p{L}\p{N}\x20\._-]+$%uD', $username)) {
                 $v->addError('The :alias is not valid format'); // ???? выводить отдельное сообщение для username
             // username = Гость
-            } elseif (\preg_match('%^(guest|' . \preg_quote(\ForkBB\__('Guest'), '%') . ')$%iu', $username)) { // ???? а зачем?
+            } elseif (\preg_match('%^(guest|' . \preg_quote(__('Guest'), '%') . ')$%iu', $username)) { // ???? а зачем?
                 $v->addError('Username guest');
             // цензура
             } elseif ($this->c->censorship->censor($username) !== $username) {

+ 10 - 8
app/config/defaultBBCode.php

@@ -1,5 +1,7 @@
 <?php
 
+use function \ForkBB\__;
+
 return [
     ['tag' => 'ROOT',
      'type' => 'block',
@@ -228,19 +230,19 @@ return [
          $hours = ($attrs['Def'] / 3600) % 24;
          $days = (int) ($attrs['Def'] / 86400);
          if ($days > 0) {
-             $arr[] = $days . \ForkBB\__('After time d');
+             $arr[] = $days . __('After time d');
          }
          if ($hours > 0) {
-             $arr[] = $hours . \ForkBB\__('After time H');
+             $arr[] = $hours . __('After time H');
          }
          if ($min > 0) {
-             $arr[] = (($min < 10) ? '0' . $min : $min) . \ForkBB\__('After time i');
+             $arr[] = (($min < 10) ? '0' . $min : $min) . __('After time i');
          }
          if ($sec > 0) {
-             $arr[] = (($sec < 10) ? '0' . $sec : $sec) . \ForkBB\__('After time s');
+             $arr[] = (($sec < 10) ? '0' . $sec : $sec) . __('After time s');
          }
 
-         $attr = \ForkBB\__('After time') . ' ' . implode(' ', $arr);
+         $attr = __('After time') . ' ' . implode(' ', $arr);
 
          return '</p><p class="f-bb-after">' . $attr . ':</p><p>';
      },
@@ -253,7 +255,7 @@ return [
          'no attr' => true,
      ],
      'handler' => function($body, $attrs) {
-         $header = isset($attrs['Def']) ? '<div class="f-bb-q-header">' . $attrs['Def'] .  ' ' . \ForkBB\__('wrote') . '</div>' : '';
+         $header = isset($attrs['Def']) ? '<div class="f-bb-q-header">' . $attrs['Def'] .  ' ' . __('wrote') . '</div>' : '';
          return "</p><blockquote class=\"f-bb-quote\">{$header}<div class=\"f-bb-q-body\"><p>{$body}</p></div></blockquote><p>";
      },
     ],
@@ -268,7 +270,7 @@ return [
          if (isset($attrs['Def'])) {
              $st = '</p><div class="quotebox" style="padding: 0px;"><div onclick="var e,d,c=this.parentNode,a=c.getElementsByTagName(\'div\')[1],b=this.getElementsByTagName(\'span\')[0];if(a.style.display!=\'\'){while(c.parentNode&&(!d||!e||d==e)){e=d;d=(window.getComputedStyle?getComputedStyle(c, null):c.currentStyle)[\'backgroundColor\'];if(d==\'transparent\'||d==\'rgba(0, 0, 0, 0)\')d=e;c=c.parentNode;}a.style.display=\'\';a.style.backgroundColor=d;b.innerHTML=\'&#9650;\';}else{a.style.display=\'none\';b.innerHTML=\'&#9660;\';}" style="font-weight: bold; cursor: pointer; font-size: 0.9em;"><span style="padding: 0 5px;">&#9660;</span>' . $attrs['Def'] . '</div><div style="padding: 6px; margin: 0; display: none;"><p>';
          } else {
-             $st = '</p><div class="quotebox" style="padding: 0px;"><div onclick="var e,d,c=this.parentNode,a=c.getElementsByTagName(\'div\')[1],b=this.getElementsByTagName(\'span\')[0];if(a.style.display!=\'\'){while(c.parentNode&&(!d||!e||d==e)){e=d;d=(window.getComputedStyle?getComputedStyle(c, null):c.currentStyle)[\'backgroundColor\'];if(d==\'transparent\'||d==\'rgba(0, 0, 0, 0)\')d=e;c=c.parentNode;}a.style.display=\'\';a.style.backgroundColor=d;b.innerHTML=\'&#9650;\';}else{a.style.display=\'none\';b.innerHTML=\'&#9660;\';}" style="font-weight: bold; cursor: pointer; font-size: 0.9em;"><span style="padding: 0 5px;">&#9660;</span>' . \ForkBB\__('Hidden text') . '</div><div style="padding: 6px; margin: 0; display: none;"><p>';
+             $st = '</p><div class="quotebox" style="padding: 0px;"><div onclick="var e,d,c=this.parentNode,a=c.getElementsByTagName(\'div\')[1],b=this.getElementsByTagName(\'span\')[0];if(a.style.display!=\'\'){while(c.parentNode&&(!d||!e||d==e)){e=d;d=(window.getComputedStyle?getComputedStyle(c, null):c.currentStyle)[\'backgroundColor\'];if(d==\'transparent\'||d==\'rgba(0, 0, 0, 0)\')d=e;c=c.parentNode;}a.style.display=\'\';a.style.backgroundColor=d;b.innerHTML=\'&#9650;\';}else{a.style.display=\'none\';b.innerHTML=\'&#9660;\';}" style="font-weight: bold; cursor: pointer; font-size: 0.9em;"><span style="padding: 0 5px;">&#9660;</span>' . __('Hidden text') . '</div><div style="padding: 6px; margin: 0; display: none;"><p>';
          }
 
          return $st . $body . '</p></div></div><p>';
@@ -303,7 +305,7 @@ return [
             }
          }
 
-         return '<a href="' . $body . '" rel="nofollow">&lt;' . \ForkBB\__('Image link') . ' - ' . $attrs['Def'] . '&gt;</a>';
+         return '<a href="' . $body . '" rel="nofollow">&lt;' . __('Image link') . ' - ' . $attrs['Def'] . '&gt;</a>';
      },
     ],
     ['tag' => 'url',