Browse Source

Fix files for new Fork\__() function

Visman 4 years ago
parent
commit
ae507d5a6d
51 changed files with 173 additions and 177 deletions
  1. 1 1
      app/Core/Func.php
  2. 1 1
      app/Core/Validator.php
  3. 4 4
      app/Models/Page.php
  4. 6 6
      app/Models/Pages/Admin/Bans.php
  5. 3 3
      app/Models/Pages/Admin/Categories.php
  6. 5 5
      app/Models/Pages/Admin/Forums.php
  7. 6 6
      app/Models/Pages/Admin/Groups.php
  8. 2 2
      app/Models/Pages/Admin/Host.php
  9. 3 3
      app/Models/Pages/Admin/Install.php
  10. 2 2
      app/Models/Pages/Admin/Logs.php
  11. 1 1
      app/Models/Pages/Admin/Maintenance.php
  12. 6 6
      app/Models/Pages/Admin/Options.php
  13. 6 6
      app/Models/Pages/Admin/Parser/BBCode.php
  14. 5 5
      app/Models/Pages/Admin/Parser/Smilies.php
  15. 4 4
      app/Models/Pages/Admin/Reports.php
  16. 9 9
      app/Models/Pages/Admin/Update.php
  17. 4 4
      app/Models/Pages/Admin/Users.php
  18. 2 2
      app/Models/Pages/Admin/Users/Action.php
  19. 3 3
      app/Models/Pages/Auth.php
  20. 1 1
      app/Models/Pages/Delete.php
  21. 4 4
      app/Models/Pages/Email.php
  22. 3 3
      app/Models/Pages/Feed.php
  23. 3 3
      app/Models/Pages/Message.php
  24. 1 1
      app/Models/Pages/Misc.php
  25. 3 3
      app/Models/Pages/Moderate.php
  26. 3 3
      app/Models/Pages/PostFormTrait.php
  27. 1 1
      app/Models/Pages/PostValidatorTrait.php
  28. 2 2
      app/Models/Pages/Profile.php
  29. 3 3
      app/Models/Pages/Profile/Edit.php
  30. 3 3
      app/Models/Pages/Profile/Email.php
  31. 8 8
      app/Models/Pages/Register.php
  32. 3 3
      app/Models/Pages/Report.php
  33. 7 7
      app/Models/Pages/Search.php
  34. 6 6
      app/Models/Poll/Model.php
  35. 5 5
      app/Models/Poll/Revision.php
  36. 2 2
      app/Models/Subscription/Send.php
  37. 1 1
      app/Models/Validators/Email.php
  38. 1 1
      app/templates/admin/index.forkbb.php
  39. 2 2
      app/templates/admin/logs.forkbb.php
  40. 5 5
      app/templates/admin/statistics.forkbb.php
  41. 2 2
      app/templates/ban.forkbb.php
  42. 9 9
      app/templates/forum.forkbb.php
  43. 1 1
      app/templates/layouts/debug.forkbb.php
  44. 1 1
      app/templates/layouts/install.forkbb.php
  45. 0 4
      app/templates/layouts/main.forkbb.php
  46. 3 3
      app/templates/layouts/poll.forkbb.php
  47. 2 2
      app/templates/layouts/stats.forkbb.php
  48. 6 6
      app/templates/layouts/subforums.forkbb.php
  49. 4 4
      app/templates/topic.forkbb.php
  50. 3 3
      app/templates/topic_in_search.forkbb.php
  51. 2 2
      app/templates/userlist.forkbb.php

+ 1 - 1
app/Core/Func.php

@@ -122,7 +122,7 @@ class Func
 //            $pages[] = [null, 1, true];
         } else {
             if ($cur > 0) {
-                $pages[] = [__($info, $cur, $all), 'info', null];
+                $pages[] = [__([$info, $cur, $all]), 'info', null];
                 $cur     = \min(\max(1, $cur), $all);
                 if ($cur > 1) {
                     $pages[] = [

+ 1 - 1
app/Core/Validator.php

@@ -371,7 +371,7 @@ class Validator
             list($type, $error) = $error;
         }
 
-        $this->errors[$type][] = __($error, [':alias' => __($alias), ':attr' => $attr]);
+        $this->errors[$type][] = __([$error, [':alias' => __($alias), ':attr' => $attr]]);
         $this->error           = true;
     }
 

+ 4 - 4
app/Models/Page.php

@@ -196,7 +196,7 @@ abstract class Page extends Model
         } else {
             $navUser['profile'] = [
                 $this->user->link,
-                __('User %s', $this->user->username),
+                ['User %s', $this->user->username],
                 'Your profile',
             ];
 
@@ -263,14 +263,14 @@ abstract class Page extends Model
             '1' == $this->c->config->o_maintenance
             && $this->user->isAdmin
         ) {
-            $this->fIswev = ['w', __('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', __('New reports', $this->c->Router->link('AdminReports'))];
+            $this->fIswev = ['i', __(['New reports', $this->c->Router->link('AdminReports')])];
         }
     }
 
@@ -460,7 +460,7 @@ abstract class Page extends Model
                     $active   = null;
 
                     if ($crumb->page > 1) {
-                        $name .= __(' Page %s', $crumb->page);
+                        $name .= __([' Page %s', $crumb->page]);
                     }
 
                     $this->titles = $name;

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

@@ -557,7 +557,7 @@ class Bans extends Admin
 
             foreach ($userList as $user) {
                 if ($this->c->bans->banFromName($user->username) > 0) {
-                    return $this->c->Message->message(__('User is ban', $user->username));
+                    return $this->c->Message->message(['User is ban', $user->username]);
                 }
 
                 if ($this->c->userRules->canBanUser($user)) {
@@ -565,9 +565,9 @@ class Bans extends Admin
                 }
 
                 if ($user->isAdmin) {
-                    return $this->c->Message->message(__('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(__('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');
                 }
@@ -733,14 +733,14 @@ class Bans extends Admin
             if (! $user instanceof User) { // ???? может ли вернутся несколько юзеров?
                 $v->addError('No user message');
             } elseif ($this->c->bans->banFromName($user->username) > 0) {
-                $v->addError(__('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(__('User is admin message', $user->username));
+                    $v->addError(__(['User is admin message', $user->username]));
                 } elseif ($user->isAdmMod) {
-                    $v->addError(__('User is mod message', $user->username));
+                    $v->addError(__(['User is mod message', $user->username]));
                 }
             }
         }

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

@@ -129,7 +129,7 @@ class Categories extends Admin
                     'type'      => 'text',
                     'maxlength' => '80',
                     'caption'   => __('Add category label'),
-                    'info'      => __('Add category help', $this->c->Router->link('AdminForums'), __('Forums')),
+                    'info'      => __(['Add category help', $this->c->Router->link('AdminForums'), __('Forums')]),
                 ],
             ],
         ];
@@ -182,7 +182,7 @@ class Categories extends Admin
             $this->c->Router->link('AdminCategoriesDelete', $args),
             __('Delete category head'),
         ];
-        $this->aCrumbs[] = __('"%s"', $category['cat_name']);
+        $this->aCrumbs[] = __(['"%s"', $category['cat_name']]);
         $this->form      = $this->formDelete($args, $category);
         $this->classForm = 'deletecategory';
         $this->titleForm = 'Delete category head';
@@ -206,7 +206,7 @@ class Categories extends Admin
                         'confirm' => [
                             'caption' => __('Confirm delete'),
                             'type'    => 'checkbox',
-                            'label'   => __('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,
                         ],

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

@@ -271,7 +271,7 @@ class Forums extends Admin
             ),
             __('Delete forum head'),
         ];
-        $this->aCrumbs[] = __('"%s"', $forum->forum_name);
+        $this->aCrumbs[] = __(['"%s"', $forum->forum_name]);
         $this->form      = $this->formDelete($args, $forum);
         $this->classForm = 'deleteforum';
         $this->titleForm = 'Delete forum head';
@@ -295,7 +295,7 @@ class Forums extends Admin
                         'confirm' => [
                             'caption' => __('Confirm delete'),
                             'type'    => 'checkbox',
-                            'label'   => __('I want to delete forum %s', $forum->forum_name),
+                            'label'   => __(['I want to delete forum %s', $forum->forum_name]),
                             'value'   => '1',
                             'checked' => false,
                         ],
@@ -350,7 +350,7 @@ class Forums extends Admin
                 $this->c->Router->link($marker, $args),
                 __('Edit forum head'),
             ];
-            $this->aCrumbs[] = __('"%s"', $forum->forum_name);
+            $this->aCrumbs[] = __(['"%s"', $forum->forum_name]);
             $this->titleForm = 'Edit forum head';
             $this->classForm = 'editforum';
         }
@@ -501,7 +501,7 @@ class Forums extends Admin
                     'value'   => $forum->no_sum_mess,
                     'values'  => [0 => __('Yes'), 1 => __('No')],
                     'caption' => __('Count messages label'),
-                    'info'    => __('Count messages help', $this->c->Router->link('AdminUsers'), __('Users')),
+                    'info'    => __(['Count messages help', $this->c->Router->link('AdminUsers'), __('Users')]),
                 ],
             ],
         ];
@@ -509,7 +509,7 @@ class Forums extends Admin
         $form['sets']['forum-info'] = [
             'info' => [
                 'info1' => [
-                    'value' => __('Group permissions info', $this->c->Router->link('AdminGroups'), __('User groups')),
+                    'value' => __(['Group permissions info', $this->c->Router->link('AdminGroups'), __('User groups')]),
                     'html'  => true,
                 ],
             ],

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

@@ -206,7 +206,7 @@ class Groups extends Admin
                 $this->c->Router->link($marker, $vars),
                 __('Edit group'),
             ];
-            $this->aCrumbs[] = __('"%s"', $group->g_title);
+            $this->aCrumbs[] = __(['"%s"', $group->g_title]);
             $this->titleForm = 'Edit group';
             $this->classForm = 'editgroup';
         } else {
@@ -385,7 +385,7 @@ class Groups extends Admin
             'maxlength' => '50',
             'value'     => $group->g_user_title,
             'caption'   => __('User title label'),
-            'info'      => __('User title help', $group->groupGuest ? __('Guest') : __('Member')),
+            'info'      => __(['User title help', $group->groupGuest ? __('Guest') : __('Member')]),
         ];
         $form['sets']['group-titles'] = [
             'legend' => __('Titles subhead'),
@@ -414,7 +414,7 @@ class Groups extends Admin
                 'options' => $options,
                 'value'   => $group->g_promote_next_group,
                 'caption' => __('Promote users label'),
-                'info'    => __('Promote users help', __('Disable promotion')),
+                'info'    => __(['Promote users help', __('Disable promotion')]),
             ];
             $fieldset['g_promote_min_posts'] = [
                 'type'    => 'number',
@@ -764,7 +764,7 @@ class Groups extends Admin
             $this->c->Router->link('AdminGroupsDelete', $args),
             __('Group delete'),
         ];
-        $this->aCrumbs[] = __('"%s"', $group->g_title);
+        $this->aCrumbs[] = __(['"%s"', $group->g_title]);
         $this->form      = $this->formDelete($args, $group, $count, $groups);
         $this->titleForm = 'Group delete';
         $this->classForm = 'deletegroup';
@@ -804,7 +804,7 @@ class Groups extends Admin
                         'options' => $groups,
                         'value'   => $this->c->config->i_default_user_group,
                         'caption' => __('Move users label'),
-                        'info'    => __('Move users info', $group->g_title, $count),
+                        'info'    => __(['Move users info', $group->g_title, $count]),
                     ],
                 ],
             ];
@@ -815,7 +815,7 @@ class Groups extends Admin
                 'confirm' => [
                     'caption' => __('Confirm delete'),
                     'type'    => 'checkbox',
-                    'label'   => __('I want to delete this group', $group->g_title),
+                    'label'   => __(['I want to delete this group', $group->g_title]),
                     'value'   => '1',
                     'checked' => false,
                 ],

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

@@ -36,12 +36,12 @@ class Host extends Admin
         $this->back    = true;
         $this->fIswev  = [
             'i',
-            __('Host info', $ip, $host, $this->c->Router->link(
+            __(['Host info', $ip, $host, $this->c->Router->link(
                 'AdminUsersResult',
                 [
                     'data' => "ip:{$ip}",
                 ]
-            )),
+            )]),
         ];
 
         return $this;

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

@@ -96,7 +96,7 @@ class Install extends Admin
 
         // версия PHP
         if (\version_compare(\PHP_VERSION, self::PHP_MIN, '<')) {
-            $this->fIswev = ['e', __('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])];
         }
 
         // типы БД
@@ -116,7 +116,7 @@ class Install extends Admin
         foreach ($folders as $folder) {
             if (! \is_writable($folder)) {
                 $folder       = \str_replace(\dirname($this->c->DIR_APP), '', $folder);
-                $this->fIswev = ['e', __('Alert folder', $folder)];
+                $this->fIswev = ['e', __(['Alert folder', $folder])];
             }
         }
 
@@ -526,7 +526,7 @@ class Install extends Admin
             $stmt = $this->c->DB->query('SELECT 1 FROM ::users LIMIT 1');
 
             if (! empty($stmt->fetch())) {
-                $v->addError(__('Existing table error', $v->dbprefix, $v->dbname));
+                $v->addError(__(['Existing table error', $v->dbprefix, $v->dbname]));
 
                 return $dbhost;
             }

+ 2 - 2
app/Models/Pages/Admin/Logs.php

@@ -151,7 +151,7 @@ class Logs extends Admin
             'btns'   => [
                 'delete'  => [
                     'type'  => 'submit',
-                    'value' => __('Delete log %s', $this->c->LogViewer->getName($path)),
+                    'value' => __(['Delete log %s', $this->c->LogViewer->getName($path)]),
                 ],
                 'cancel'  => [
                     'type'  => 'btn',
@@ -178,7 +178,7 @@ class Logs extends Admin
         $this->logName    = $this->c->LogViewer->getName($path);
         $this->aCrumbs[]  = [
             $this->c->Router->link('AdminLogsAction', $args),
-            __('Log %s', $this->logName),
+            __(['Log %s', $this->logName]),
         ];
 
         return $this;

+ 1 - 1
app/Models/Pages/Admin/Maintenance.php

@@ -235,7 +235,7 @@ class Maintenance extends Admin
                 'clear' => $v->clear ? '1' : '0',
             ];
 
-            return $this->c->Redirect->page('AdminRebuildIndex', $args)->message(__('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');
         }

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

@@ -476,10 +476,10 @@ class Options extends Admin
                     'type'    => 'select',
                     'options' => [
                         0  => __('No cache'),
-                        5  => __('%d Minutes', 5),
-                        15 => __('%d Minutes', 15),
-                        30 => __('%d Minutes', 30),
-                        60 => __('%d Minutes', 60),
+                        5  => __(['%d Minutes', 5]),
+                        15 => __(['%d Minutes', 15]),
+                        30 => __(['%d Minutes', 30]),
+                        60 => __(['%d Minutes', 60]),
                     ],
                     'value'   => $config->i_feed_ttl,
                     'caption' => __('Feed TTL label'),
@@ -527,7 +527,7 @@ class Options extends Admin
                     'maxlength' => '255',
                     'value'     => $config->o_avatars_dir,
                     'caption'   => __('Upload directory label'),
-                    'info'      => __('Upload directory help', $this->c->PUBLIC_URL),
+                    'info'      => __(['Upload directory help', $this->c->PUBLIC_URL]),
                     'required'  => true,
                 ],
                 'i_avatars_width' => [
@@ -768,7 +768,7 @@ class Options extends Admin
                     'value'   => $config->b_pm,
                     'values'  => $yn,
                     'caption' => __('Allow PM label'),
-                    'info'    => __('Allow PM help', __('User groups'), $this->c->Router->link('AdminGroups')),
+                    'info'    => __(['Allow PM help', __('User groups'), $this->c->Router->link('AdminGroups')]),
                 ],
             ],
         ];

+ 6 - 6
app/Models/Pages/Admin/Parser/BBCode.php

@@ -190,7 +190,7 @@ class BBCode extends Parser
 
             $form['sets']["bbcode{$id}"] = [
                 'class'  => 'bbcode',
-                'legend' => __('BBCode %s', $tag),
+                'legend' => __(['BBCode %s', $tag]),
                 'fields' => $fields,
             ];
         }
@@ -345,7 +345,7 @@ class BBCode extends Parser
             __($title),
         ];
         if ($id > 0) {
-            $this->aCrumbs[] = __('"%s"', $this->c->bbcode->bbcodeTable[$id]['bb_tag']);
+            $this->aCrumbs[] = __(['"%s"', $this->c->bbcode->bbcodeTable[$id]['bb_tag']]);
         }
         $this->aCrumbs[] = [
             $this->c->Router->link('AdminBBCode'),
@@ -537,7 +537,7 @@ class BBCode extends Parser
             $structure->no_attr,
             'no_attr',
             'no_attr',
-            __('No attr subhead', $tagStr),
+            __(['No attr subhead', $tagStr]),
             __('Allowed no_attr info')
         );
 
@@ -545,7 +545,7 @@ class BBCode extends Parser
             $structure->def_attr,
             'def_attr',
             'def_attr',
-            __('Def attr subhead', $tagStr),
+            __(['Def attr subhead', $tagStr]),
             __('Allowed def_attr info')
         );
 
@@ -554,8 +554,8 @@ class BBCode extends Parser
                 $attr,
                 $name,
                 "{$name}_attr",
-                __('Other attr subhead', $tagStr, $name),
-                __('Allowed %s attr info', $name)
+                __(['Other attr subhead', $tagStr, $name]),
+                __(['Allowed %s attr info', $name])
             );
         }
 

+ 5 - 5
app/Models/Pages/Admin/Parser/Smilies.php

@@ -191,7 +191,7 @@ class Smilies extends Parser
             $fields["smile{$id}-pic"] = [
                 'class'     => ['pic', 'smile'],
                 'type'      => 'str',
-                'value'     => __('<img src="%1$s" alt="%2$s">', $this->c->PUBLIC_URL . '/img/sm/' . $cur['sm_image'], $cur['sm_image']),
+                'value'     => __(['<img src="%1$s" alt="%2$s">', $this->c->PUBLIC_URL . '/img/sm/' . $cur['sm_image'], $cur['sm_image']]),
                 'caption'   => __('Picture label'),
                 'html'      => true,
             ];
@@ -211,7 +211,7 @@ class Smilies extends Parser
 
             $form['sets']["smile{$id}"] = [
                 'class'  => 'smile',
-                'legend' => __('Smiley number %s', $i),
+                'legend' => __(['Smiley number %s', $i]),
                 'fields' => $fields,
             ];
 
@@ -271,7 +271,7 @@ class Smilies extends Parser
             $fields["image{$key}-pic"] = [
                 'class'     => ['pic', 'image'],
                 'type'      => 'str',
-                'value'     => __('<img src="%1$s" alt="%2$s">', $this->c->PUBLIC_URL . '/img/sm/' . $name, $name),
+                'value'     => __(['<img src="%1$s" alt="%2$s">', $this->c->PUBLIC_URL . '/img/sm/' . $name, $name]),
                 'caption'   => __('Picture label'),
                 'html'      => true,
             ];
@@ -366,9 +366,9 @@ class Smilies extends Parser
                 \is_file($file)
                 && @\unlink($file)
             ) {
-                $message = __('File %s deleted redirect', $args['name']);
+                $message = ['File %s deleted redirect', $args['name']];
             } else {
-                $message = __('File %s not deleted redirect', $args['name']);
+                $message = ['File %s not deleted redirect', $args['name']];
             }
         } else {
             return $this->c->Message->message('Bad request');

+ 4 - 4
app/Models/Pages/Admin/Reports.php

@@ -77,11 +77,11 @@ class Reports extends Admin
         foreach ($reports as $report) {
             if ($noZapped) {
                 $cur = [
-                    'legend' => __('Reported %s', \ForkBB\dt($report->created)),
+                    'legend' => __(['Reported %s', \ForkBB\dt($report->created)]),
                 ];
             } else {
                 $cur = [
-                    'legend' => __('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'] = [];
@@ -99,13 +99,13 @@ class Reports extends Admin
                 $forum = $topic->parent;
                 $cur['fields']['post' . $report->id] = [
                     'type'    => 'str',
-                    'value'   => __('Post #%s ', $post->id, $post->link, $topic->censorSubject, $topic->link, $forum->forum_name, $forum->link),
+                    'value'   => __(['Post #%s ', $post->id, $post->link, $topic->censorSubject, $topic->link, $forum->forum_name, $forum->link]),
                     'html'    => true,
                 ];
             } else {
                 $cur['fields']['post' . $report->id] = [
                     'type'    => 'str',
-                    'value'   => __('Post #%s', $report->post_id),
+                    'value'   => __(['Post #%s', $report->post_id]),
                 ];
             }
             $cur['fields']['reason' . $report->id] = [

+ 9 - 9
app/Models/Pages/Admin/Update.php

@@ -154,7 +154,7 @@ class Update extends Admin
                         null === $e
                         && \version_compare(\PHP_VERSION, self::PHP_MIN, '<')
                     ) {
-                        $e = __('You are running error', 'PHP', \PHP_VERSION, $this->c->FORK_REVISION, self::PHP_MIN);
+                        $e = __(['You are running error', 'PHP', \PHP_VERSION, $this->c->FORK_REVISION, self::PHP_MIN]);
                     }
 
                     // база не от ForkBB ????
@@ -185,7 +185,7 @@ class Update extends Admin
                             null === $e
                             && true === $this->c->DB->tableExists($test_table)
                         ) {
-                            $e = __('The %s table already exists. Delete it.', $test_table);
+                            $e = __(['The %s table already exists. Delete it.', $test_table]);
                         }
 
                         $schema = [
@@ -198,14 +198,14 @@ class Update extends Admin
                             null === $e
                             && false === $this->c->DB->createTable($test_table, $schema)
                         ) {
-                            $e = __('Unable to create %s table', $test_table);
+                            $e = __(['Unable to create %s table', $test_table]);
                         }
 
                         if (
                             null === $e
                             && false === $this->c->DB->addField($test_table, 'test_field', 'VARCHAR(80)', false, '')
                         ) {
-                            $e = __('Unable to add test_field field to %s table', $test_table);
+                            $e = __(['Unable to add test_field field to %s table', $test_table]);
                         }
 
                         $sql = "INSERT INTO ::{$test_table} (test_field) VALUES ('TEST_VALUE')";
@@ -213,21 +213,21 @@ class Update extends Admin
                             null === $e
                             && false === $this->c->DB->exec($sql)
                         ) {
-                            $e = __('Unable to insert line to %s table', $test_table);
+                            $e = __(['Unable to insert line to %s table', $test_table]);
                         }
 
                         if (
                             null === $e
                             && false === $this->c->DB->dropField($test_table, 'test_field')
                         ) {
-                            $e = __('Unable to drop test_field field from %s table', $test_table);
+                            $e = __(['Unable to drop test_field field from %s table', $test_table]);
                         }
 
                         if (
                             null === $e
                             && false === $this->c->DB->dropTable($test_table)
                         ) {
-                            $e = __('Unable to drop %s table', $test_table);
+                            $e = __(['Unable to drop %s table', $test_table]);
                         }
                     }
 
@@ -265,11 +265,11 @@ class Update extends Admin
     {
         if (\substr($this->c->DB_DSN, 0, 6) === 'sqlite') {
             if (! \hash_equals($this->c->DB_DSN, "sqlite:{$dbpass}")) {  // ????
-                $v->addError(__('Invalid file error', self::CONFIG_FILE));
+                $v->addError(__(['Invalid file error', self::CONFIG_FILE]));
             }
         } else {
             if (! \hash_equals($this->c->DB_PASSWORD, $dbpass)) {
-                $v->addError(__('Invalid password error', self::CONFIG_FILE));
+                $v->addError(__(['Invalid password error', self::CONFIG_FILE]));
             }
         }
 

+ 4 - 4
app/Models/Pages/Admin/Users.php

@@ -102,12 +102,12 @@ abstract class Users extends Admin
             switch ($action) {
                 case self::ACTION_BAN:
                     if ($this->c->bans->banFromName($user->username) > 0) {
-                        $this->fIswev = ['i', __('User is ban', $user->username)];
+                        $this->fIswev = ['i', __(['User is ban', $user->username])];
 
                         return false;
                     }
                     if (! $this->c->userRules->canBanUser($user)) {
-                        $this->fIswev = ['v', __('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', __('No ban admins message')];
                         }
@@ -117,7 +117,7 @@ abstract class Users extends Admin
                     break;
                 case self::ACTION_DEL:
                     if (! $this->c->userRules->canDeleteUser($user)) {
-                        $this->fIswev = ['v', __('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', __('No delete admins message')];
                         }
@@ -127,7 +127,7 @@ abstract class Users extends Admin
                     break;
                 case self::ACTION_CHG:
                     if (! $this->c->userRules->canChangeGroup($user, $profile)) {
-                        $this->fIswev = ['v', __('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', __('No move admins message')];
                         }

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

@@ -173,7 +173,7 @@ class Action extends Users
                             'value'   => 0,
                             'values'  => $yn,
                             'caption' => __('Delete users'),
-                            'info'    => __('Confirm delete info', $names),
+                            'info'    => __(['Confirm delete info', $names]),
                         ],
                         'delete_posts' => [
                             'type'    => 'radio',
@@ -340,7 +340,7 @@ class Action extends Users
                             'options'   => $this->groupListForChange($profile),
                             'value'     => $this->c->config->i_default_user_group,
                             'caption'   => __('New group label'),
-                            'info'      => __('New group help', $names),
+                            'info'      => __(['New group help', $names]),
                         ],
                         'confirm' => [
                             'type'    => 'radio',

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

@@ -155,7 +155,7 @@ class Auth extends Page
                             'id'        => 'passinlogin',
                             'type'      => 'password',
                             'caption'   => __('Passphrase'),
-                            'info'      => __('<a href="%s">Forgotten?</a>', $this->c->Router->link('Forget')),
+                            'info'      => __(['<a href="%s">Forgotten?</a>', $this->c->Router->link('Forget')]),
                             'required'  => true,
                         ],
                         'save' => [
@@ -262,7 +262,7 @@ class Auth extends Page
                     );
                     $tplData = [
                         'fRootLink' => $this->c->Router->link('Index'),
-                        'fMailer'   => __('Mailer', $this->c->config->o_board_title),
+                        'fMailer'   => __(['Mailer', $this->c->config->o_board_title]),
                         'username'  => $tmpUser->username,
                         'link'      => $link,
                     ];
@@ -300,7 +300,7 @@ class Auth extends Page
                     $this->c->Log->warning('Passphrase reset: email form, fail', $context);
                 }
 
-                return $this->c->Message->message(__('Forget mail', $this->c->config->o_admin_email), false, 0);
+                return $this->c->Message->message(['Forget mail', $this->c->config->o_admin_email], false, 0);
             }
 
             $this->fIswev = $v->getErrors();

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

@@ -105,7 +105,7 @@ class Delete extends Page
                             'value'   => __('Topic') . ' «' . $post->parent->censorSubject . '»',
                         ],
                         'info2' => [
-                            'value'   => __($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,
                         ],
                     ],

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

@@ -58,7 +58,7 @@ class Email extends Page
         $floodSize = \time() - (int) $this->user->last_email_sent;
         $floodSize = $floodSize < $this->user->g_email_flood ? $this->user->g_email_flood - $floodSize : 0;
         if ($floodSize > 0) {
-            $this->fIswev = ['e', __('Flood message', $floodSize)];
+            $this->fIswev = ['e', __(['Flood message', $floodSize])];
         }
 
         $data = [
@@ -125,7 +125,7 @@ class Email extends Page
 
         $this->nameTpl   = 'email';
         $this->robots    = 'noindex';
-        $this->crumbs    = $this->crumbs(__('Send email to %s', $this->curUser->username));
+        $this->crumbs    = $this->crumbs(__(['Send email to %s', $this->curUser->username]));
         $this->formTitle = __('Send email');
         $this->form      = $this->formEmail($args, $data);
 
@@ -145,7 +145,7 @@ class Email extends Page
             ],
             'sets'   => [
                 'send-email' => [
-                    'legend' => __('Send email to %s', $this->curUser->username),
+                    'legend' => __(['Send email to %s', $this->curUser->username]),
                     'fields' => [
                         'subject' => [
                             'type'      => 'text',
@@ -193,7 +193,7 @@ class Email extends Page
     {
         $tplData = [
             'fTitle'      => $this->c->config->o_board_title,
-            'fMailer'     => __('Mailer', $this->c->config->o_board_title),
+            'fMailer'     => __(['Mailer', $this->c->config->o_board_title]),
             'username'    => $this->curUser->username,
             'sender'      => $this->user->username,
             'mailSubject' => $data['subject'],

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

@@ -67,7 +67,7 @@ class Feed extends Page
                 'id'            => $this->c->Router->link('Feed', $args),
                 'title'         => $this->c->config->o_board_title . __('Title separator') . $topic->subject,
                 'link'          => $topic->link,
-                'description'   => __('The most recent posts in %s topic', $topic->subject),
+                'description'   => __(['The most recent posts in %s topic', $topic->subject]),
                 'updated'       => $topic->last_post,
                 'items'         => [],
             ];
@@ -113,9 +113,9 @@ class Feed extends Page
                 ];
 
                 if (0 === $fid) {
-                    $feed['description'] = __('The most recent posts at %s board', $this->c->config->o_board_title);
+                    $feed['description'] = __(['The most recent posts at %s board', $this->c->config->o_board_title]);
                 } else {
-                    $feed['description'] = __('The most recent posts in %s forum', $forum->forum_name);
+                    $feed['description'] = __(['The most recent posts in %s forum', $forum->forum_name]);
                     $feed['title']      .= __('Title separator') . $forum->forum_name;
                 }
 

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

@@ -18,7 +18,7 @@ class Message extends Page
     /**
      * Подготавливает данные для шаблона
      */
-    public function message(string $message, bool $back = true, int $status = 400, array $headers = []): Page
+    public function message(/* string|array */ $message, bool $back = true, int $status = 400, array $headers = []): Page
     {
         $this->nameTpl    = 'message';
         $this->httpStatus = \max(200, $status);
@@ -42,13 +42,13 @@ class Message extends Page
         }
 
         if (
-            '' == $message
+            '' === $message
             && empty($this->fIswev)
         ) {
             $message = 'Empty message';
         }
 
-        if ('' != $message) {
+        if ('' !== $message) {
             $this->fIswev = [$type, __($message)];
         }
 

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

@@ -115,6 +115,6 @@ class Misc extends Page
             ]
         );
 
-        return $this->c->Message->message(__('Confirm your email address', $link), true, 100);
+        return $this->c->Message->message(['Confirm your email address', $link], true, 100);
     }
 }

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

@@ -550,9 +550,9 @@ class Moderate extends Page
         $headers = [];
         foreach ($objects as $object) {
             if ($object instanceof Topic) {
-                $headers[] = __('Topic «%s»', $object->censorSubject);
+                $headers[] = __(['Topic «%s»', $object->censorSubject]);
             } else {
-                $headers[] = __('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]);
             }
         }
 
@@ -567,7 +567,7 @@ class Moderate extends Page
 
         if ($this->firstTopic instanceof Topic) {
             $form['sets']['info']['info']['info2'] = [
-                'value' => __('All posts will be posted in the «%s» topic', $this->firstTopic->censorSubject),
+                'value' => __(['All posts will be posted in the «%s» topic', $this->firstTopic->censorSubject]),
             ];
         }
 

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

@@ -213,7 +213,7 @@ trait PostFormTrait
             ];
             $fieldset['poll[hide_result]'] = [
                 'type'     => 'checkbox',
-                'label'    => __('Hide poll results up to %s voters', $term),
+                'label'    => __(['Hide poll results up to %s voters', $term]),
                 'value'    => '1',
                 'checked'  => (bool) ($vars['poll']['hide_result'] ?? false),
                 'disabled' => $vars['pollNoEdit'] ?? null,
@@ -248,14 +248,14 @@ trait PostFormTrait
                     $fieldset["poll[answer][{$qid}][{$fid}]"] = [
                         'type'      => 'text',
                         'maxlength' => '240',
-                        'caption'   => __('Answer %s label', $fid),
+                        'caption'   => __(['Answer %s label', $fid]),
                         'value'     => $vars['poll']['answer'][$qid][$fid] ?? null,
                         'disabled'  => $vars['pollNoEdit'] ?? null,
                     ];
                 }
 
                 $form['sets']["uesm-q-{$qid}"] = [
-                    'legend' => __('Question %s legend', $qid),
+                    'legend' => __(['Question %s legend', $qid]),
                     'fields' => $fieldset,
                 ];
             }

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

@@ -89,7 +89,7 @@ trait PostValidatorTrait
         $time = \time() - (int) $this->user->last_post;
 
         if ($time < $this->user->g_post_flood) {
-            $v->addError(__('Flood message', $this->user->g_post_flood - $time), 'e');
+            $v->addError(__(['Flood message', $this->user->g_post_flood - $time]), 'e');
         }
 
         return $submit;

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

@@ -43,7 +43,7 @@ abstract class Profile extends Page
         $this->fIndex    = $this->rules->my ? 'profile' : 'userlist';
         $this->nameTpl   = 'profile';
         $this->onlinePos = 'profile-' . $this->curUser->id; // ????
-        $this->title     = __('%s\'s profile', $this->curUser->username);
+        $this->title     = __(['%s\'s profile', $this->curUser->username]);
 
         return true;
     }
@@ -66,7 +66,7 @@ abstract class Profile extends Page
      */
     protected function crumbs(/* mixed */ ...$crumbs): array
     {
-        $crumbs[] = [$this->curUser->link, __('User %s', $this->curUser->username)];
+        $crumbs[] = [$this->curUser->link, __(['User %s', $this->curUser->username])];
         $crumbs[] = [$this->c->Router->link('Userlist'), __('User list')];
 
         return parent::crumbs(...$crumbs);

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

@@ -326,12 +326,12 @@ class Edit extends Profile
             $fields['upload_avatar'] = [
                 'type'      => 'file',
                 'caption'   => __('New avatar'),
-                'info'      => __('New avatar info',
+                'info'      => __(['New avatar info',
                     \ForkBB\num($this->c->config->i_avatars_width),
                     \ForkBB\num($this->c->config->i_avatars_height),
                     \ForkBB\num($this->c->config->i_avatars_size),
                     \ForkBB\size($this->c->config->i_avatars_size)
-                ),
+                ]),
                 'accept'  => $this->accept,
             ];
         }
@@ -452,7 +452,7 @@ class Edit extends Profile
                 'type'    => 'textarea',
                 'value'   => $this->curUser->signature,
                 'caption' => __('Signature'),
-                'info'    => __('Sig max size', \ForkBB\num($this->curUser->g_sig_length), \ForkBB\num($this->curUser->g_sig_lines)),
+                'info'    => __(['Sig max size', \ForkBB\num($this->curUser->g_sig_length), \ForkBB\num($this->curUser->g_sig_lines)]),
             ];
             $form['sets']['signature'] = [
                 'class'  => 'data-edit',

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

@@ -144,7 +144,7 @@ class Email extends Profile
                         );
                         $tplData = [
                             'fRootLink' => $this->c->Router->link('Index'),
-                            'fMailer'   => __('Mailer', $this->c->config->o_board_title),
+                            'fMailer'   => __(['Mailer', $this->c->config->o_board_title]),
                             'username'  => $this->curUser->username,
                             'link'      => $link,
                         ];
@@ -184,10 +184,10 @@ class Email extends Profile
                         $this->c->users->update($this->curUser);
 
                         return $this->c->Message
-                            ->message(__('Activate email sent', $this->c->config->o_admin_email), false, 200);
+                            ->message(['Activate email sent', $this->c->config->o_admin_email], false, 200);
                     } else {
                         return $this->c->Message
-                            ->message(__('Error mail', $this->c->config->o_admin_email), true, 200);
+                            ->message(['Error mail', $this->c->config->o_admin_email], true, 200);
                     }
                 }
             }

+ 8 - 8
app/Models/Pages/Register.php

@@ -42,7 +42,7 @@ class Register extends Page
                 'password' => 'Passphrase',
             ])->addMessages([
                 'agree.required'    => ['cancel', 'cancel'],
-                'agree.token'       => ['w', __('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',
             ]);
@@ -192,7 +192,7 @@ class Register extends Page
 
             $tplData = [
                 'fRootLink' => $this->c->Router->link('Index'),
-                'fMailer'   => __('Mailer', $this->c->config->o_board_title),
+                'fMailer'   => __(['Mailer', $this->c->config->o_board_title]),
                 'username'  => $v->username,
                 'userLink'  => $this->c->Router->link(
                     'User',
@@ -238,7 +238,7 @@ class Register extends Page
             $tplData = [
                 'fTitle'    => $this->c->config->o_board_title,
                 'fRootLink' => $this->c->Router->link('Index'),
-                'fMailer'   => __('Mailer', $this->c->config->o_board_title),
+                'fMailer'   => __(['Mailer', $this->c->config->o_board_title]),
                 'username'  => $v->username,
                 'link'      => $link,
             ];
@@ -263,11 +263,11 @@ class Register extends Page
 
             // письмо активации аккаунта отправлено
             if ($isSent) {
-                return $this->c->Message->message(__('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', __('Error welcom mail', $this->c->config->o_admin_email)];
+                $auth->fIswev = ['w', __(['Error welcom mail', $this->c->config->o_admin_email])];
 
                 return $auth->forget([], 'GET', $v->email);
             }
@@ -300,7 +300,7 @@ class Register extends Page
 
             $tplData = [
                 'fRootLink' => $this->c->Router->link('Index'),
-                'fMailer'   => __('Mailer', $this->c->config->o_board_title),
+                'fMailer'   => __(['Mailer', $this->c->config->o_board_title]),
                 'username'  => $v->username,
                 'ip'        => $this->user->ip,
                 'userInDB'  => $userInDB->username,
@@ -333,11 +333,11 @@ class Register extends Page
 
             // письмо активации аккаунта отправлено
             if ($isSent) {
-                return $this->c->Message->message(__('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', __('Error welcom mail', $this->c->config->o_admin_email)];
+                $auth->fIswev = ['w', __(['Error welcom mail', $this->c->config->o_admin_email])];
 
                 return $auth->forget([], 'GET', $v->email);
             }

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

@@ -37,7 +37,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', __('Flood message', $floodSize)];
+            $this->fIswev = ['e', __(['Flood message', $floodSize])];
         }
 
         $data = [];
@@ -95,7 +95,7 @@ class Report extends Page
                 }
 
                 if (false === $result && 1 === $this->c->config->i_report_method) {
-                    $this->fIswev = ['e', __('Error mail', $this->c->config->o_admin_email)];
+                    $this->fIswev = ['e', __(['Error mail', $this->c->config->o_admin_email])];
                 } else {
                     return $this->c->Redirect->page('ViewPost', ['id' => $post->id])->message('Report redirect');
                 }
@@ -161,7 +161,7 @@ class Report extends Page
     protected function sendReport(ReportModel $report): bool
     {
         $tplData = [
-            'fMailer'      => __('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',

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

@@ -159,7 +159,7 @@ class Search extends Page
                     'fields' => [
                         [
                             'type'  => 'info',
-                            'value' => __('<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' => [
@@ -198,7 +198,7 @@ class Search extends Page
                     'fields' => [
                         [
                             'type'  => 'info',
-                            'value' => __('<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' => [
@@ -324,7 +324,7 @@ class Search extends Page
                 $search = $this->c->search;
 
                 if (! $search->prepare($query)) {
-                    $v->addError(__($search->queryError, $search->queryText));
+                    $v->addError(__([$search->queryError, $search->queryText]));
                 } else {
 
                     if ($this->c->search->execute($v, $this->listOfIndexes, $flood)) {
@@ -346,7 +346,7 @@ class Search extends Page
             }
 
             if ($flood) {
-                $v->addError(__('Flood message', $this->user->g_search_flood - \time() + $this->user->last_search));
+                $v->addError(__(['Flood message', $this->user->g_search_flood - \time() + $this->user->last_search]));
             }
         }
 
@@ -434,9 +434,9 @@ class Search extends Page
                     $asTopicsList  = false;
                 }
                 if ('*' === $args['author']) {
-                    $model->name   = __('Search query: %s', $args['keywords']);
+                    $model->name   = __(['Search query: %s', $args['keywords']]);
                 } else {
-                    $model->name   = __('Search query: %1$s and Author: %2$s', $args['keywords'], $args['author']);
+                    $model->name   = __(['Search query: %1$s and Author: %2$s', $args['keywords'], $args['author']]);
                 }
                 $model->linkMarker = $advanced ? 'SearchAdvanced' : 'Search';
                 $model->linkArgs   = $args;
@@ -484,7 +484,7 @@ class Search extends Page
                 } else {
                     $list = $model->actionP($action, $forum, $user->id);
                 }
-                $model->name       = __('Quick search user ' . $action, $user->username);
+                $model->name       = __(['Quick search user ' . $action, $user->username]);
                 $model->linkMarker = 'SearchAction';
                 if ($forum->id) {
                     $model->linkArgs = ['action' => $action, 'uid' => $user->id, 'forum' => $forum->id];

+ 6 - 6
app/Models/Poll/Model.php

@@ -244,7 +244,7 @@ class Model extends DataModel
         } elseif (! $this->isOpen) {
             return __('This poll is closed');
         } elseif (! $this->canSeeResult) {
-            return __('Poll results are hidden up to %s voters', $this->parent->poll_term);
+            return __(['Poll results are hidden up to %s voters', $this->parent->poll_term]);
         } elseif ($this->userVoted) {
             return __('You voted');
         } else {
@@ -268,23 +268,23 @@ class Model extends DataModel
             if ($this->type[$q] > 1) {
                 $count = \count($vote[$q]);
                 if (0 == $count) {
-                    return __('No vote on question %s', $q);
+                    return __(['No vote on question %s', $q]);
                 } elseif ($count > $this->type[$q]) {
-                    return __('Too many answers selected in question %s', $q);
+                    return __(['Too many answers selected in question %s', $q]);
                 }
 
                 foreach (\array_keys($vote[$q]) as $a) {
                     if (! isset($this->answer[$q][$a])) {
-                        return __('The selected answer is not present in question %s', $q);
+                        return __(['The selected answer is not present in question %s', $q]);
                     }
 
                     $data[] = [$q, $a];
                 }
             } else {
                 if (! isset($vote[$q][0])) {
-                    return __('No vote on question %s', $q);
+                    return __(['No vote on question %s', $q]);
                 } elseif (! isset($this->answer[$q][$vote[$q][0]])) {
-                    return __('The selected answer is not present in question %s', $q);
+                    return __(['The selected answer is not present in question %s', $q]);
                 }
 
                 $data[] = [$q, $vote[$q][0]];

+ 5 - 5
app/Models/Poll/Revision.php

@@ -74,7 +74,7 @@ class Revision extends Action
 
                 continue;
             } elseif ($emptyQ) {
-                $this->error = __('Question number %s is preceded by an empty question', $qid);
+                $this->error = __(['Question number %s is preceded by an empty question', $qid]);
 
                 return;
             }
@@ -83,7 +83,7 @@ class Revision extends Action
                 empty($answers[$qid])
                 || ! \is_array($answers[$qid])
             ) {
-                $this->error = __('For question number %s, the structure of answers is broken', $qid);
+                $this->error = __(['For question number %s, the structure of answers is broken', $qid]);
 
                 return;
             }
@@ -114,7 +114,7 @@ class Revision extends Action
             }
 
             if (! empty($answers[$qid])) {
-                $this->error = __('For question number %s, the structure of answers is broken', $qid);
+                $this->error = __(['For question number %s, the structure of answers is broken', $qid]);
 
                 return;
             } elseif ($countA < 2) {
@@ -122,11 +122,11 @@ class Revision extends Action
 
                 return;
             } elseif (! isset($types[$qid])) {
-                $this->error = __('For question number %s, there is no value for the maximum number of answers for voting', $qid);
+                $this->error = __(['For question number %s, there is no value for the maximum number of answers for voting', $qid]);
 
                 return;
             } elseif ($types[$qid] > $countA) {
-                $this->error = __('For question number %s, the maximum number of answers for voting more answers', $qid);
+                $this->error = __(['For question number %s, the maximum number of answers for voting more answers', $qid]);
 
                 return;
             }

+ 2 - 2
app/Models/Subscription/Send.php

@@ -107,7 +107,7 @@ class Send extends Method
                         'topicLink'       => $topic->link,
                         'unsubscribeLink' => $forum->link,
                         'button'          => __('Unsubscribe'),
-                        'fMailer'         => __('Mailer', $this->c->config->o_board_title),
+                        'fMailer'         => __(['Mailer', $this->c->config->o_board_title]),
                     ];
                 } else {
                     $tplData = [
@@ -117,7 +117,7 @@ class Send extends Method
                         'postLink'        => $post->link,
                         'unsubscribeLink' => $topic->link,
                         'button'          => __('Unsubscribe'),
-                        'fMailer'         => __('Mailer', $this->c->config->o_board_title),
+                        'fMailer'         => __(['Mailer', $this->c->config->o_board_title]),
                     ];
                 }
 

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

@@ -128,7 +128,7 @@ class Email extends RulesValidator
             }
 
             if ($flood < $this->c->FLOOD_INTERVAL) {
-                $v->addError(__('Account email flood', (int) (($this->c->FLOOD_INTERVAL - $flood) / 60)), 'e');
+                $v->addError(__(['Account email flood', (int) (($this->c->FLOOD_INTERVAL - $flood) / 60)]), 'e');
                 $ok = false;
             }
         }

+ 1 - 1
app/templates/admin/index.forkbb.php

@@ -24,7 +24,7 @@
           <fieldset>
             <dl>
               <dt>{!! __('ForkBB version label') !!}</dt>
-              <dd>{!! __('ForkBB version data', $p->revision) !!}</dd>
+              <dd>{!! __(['ForkBB version data', $p->revision]) !!}</dd>
             </dl>
             <dl>
               <dt>{!! __('Server statistics label') !!}</dt>

+ 2 - 2
app/templates/admin/logs.forkbb.php

@@ -20,7 +20,7 @@
     @foreach ($p->logsInfo as $hash => $cur)
               <li class="f-lgli">
                 <span class="f-lgname f-lgsname">
-                  <a class="f-lganame" href="{{ $cur['linkView'] }}" title="{{ __('View log %s', $cur['log_name']) }}">{{ $cur['log_name'] }}</a>
+                  <a class="f-lganame" href="{{ $cur['linkView'] }}" title="{{ __(['View log %s', $cur['log_name']]) }}">{{ $cur['log_name'] }}</a>
                 </span>
                 <span class="f-llv @if ($cur['emergency']) f-llvem @endif" title="{{ __('Level emergency') }}"><span>{{ num($cur['emergency']) }}</span></span>
                 <span class="f-llv @if ($cur['alert']) f-llval @endif" title="{{ __('Level alert') }}"><span>{{ num($cur['alert']) }}</span></span>
@@ -43,7 +43,7 @@
 @endisset
 @isset ($p->logData)
       <section id="fork-logview" class="f-admin">
-        <h2>{!! __('Log %s', $p->logName) !!}</h2>
+        <h2>{!! __(['Log %s', $p->logName]) !!}</h2>
         <div>
           <fieldset>
             <ul id="id-lgdtlt">

+ 5 - 5
app/templates/admin/statistics.forkbb.php

@@ -5,14 +5,14 @@
           <fieldset>
             <dl>
               <dt>{!! __('Server load label') !!}</dt>
-              <dd>{!! __('Server load data', $p->serverLoad, $p->numOnline) !!}</dd>
+              <dd>{!! __(['Server load data', $p->serverLoad, $p->numOnline]) !!}</dd>
             </dl>
 @if ($p->user->isAdmin)
             <dl>
               <dt>{!! __('Environment label') !!}</dt>
               <dd>
-                {!! __('Environment data OS', PHP_OS) !!}<br>
-                {!! __('Environment data version', PHP_VERSION) !!} - <a href="{{ $p->linkInfo }}">{!! __('Show info') !!}</a><br>
+                {!! __(['Environment data OS', \PHP_OS]) !!}<br>
+                {!! __(['Environment data version', \PHP_VERSION]) !!} - <a href="{{ $p->linkInfo }}">{!! __('Show info') !!}</a><br>
     @if ($p->linkAcc)
                 {!! __('Environment data acc') !!} <a href="{{ $p->linkAcc }}">{{ $p->accelerator }}</a>
     @else
@@ -25,8 +25,8 @@
               <dd>
                 {{ $p->dbVersion }}
     @if ($p->tRecords && $p->tSize)
-                <br>{!! __('Database data rows', num($p->tRecords)) !!}
-                <br>{!! __('Database data size', size($p->tSize)) !!}
+                <br>{!! __(['Database data rows', num($p->tRecords)]) !!}
+                <br>{!! __(['Database data size', size($p->tSize)]) !!}
     @endif
     @if ($p->tOther)
                 <br><br>{!! __('Other')!!}

+ 2 - 2
app/templates/ban.forkbb.php

@@ -7,11 +7,11 @@
       <p>{!! __('Ban message') !!}</p>
 @endif
 @if ($p->ban['expire'])
-      <p>{!! __('Ban message 2', dt($p->ban['expire'], true)) !!}</p>
+      <p>{!! __(['Ban message 2', dt($p->ban['expire'], true)]) !!}</p>
 @endif
 @if ($p->ban['message'])
       <p>{!! __('Ban message 3') !!}</p>
       <p><b>{{ $p->ban['message'] }}</b></p>
 @endif
-      <p>{!! __('Ban message 4', $p->adminEmail) !!}</p>
+      <p>{!! __(['Ban message 4', $p->adminEmail]) !!}</p>
     </section>

+ 9 - 9
app/templates/forum.forkbb.php

@@ -28,10 +28,10 @@
     <section class="f-subforums">
       <ol class="f-ftlist">
         <li id="id-subforums{{ $p->model->id }}" class="f-category">
-          <h2 class="f-ftch2">{{ __('Sub forum', 2) }}</h2>
+          <h2 class="f-ftch2">{{ __(['Sub forum', 2]) }}</h2>
           <ol class="f-table">
             <li class="f-row f-thead" value="0">
-              <div class="f-hcell f-cmain">{!! __('Sub forum', 1) !!}</div>
+              <div class="f-hcell f-cmain">{!! __(['Sub forum', 1]) !!}</div>
               <div class="f-hcell f-cstats">{!! __('Stats') !!}</div>
               <div class="f-hcell f-clast">{!! __('Last post') !!}</div>
             </li>
@@ -60,12 +60,12 @@
       <div class="f-ftlist">
         <ol class="f-table">
           <li class="f-row f-thead" value="0">
-            <div class="f-hcell f-cmain">{!! __('Topic', 1) !!}</div>
+            <div class="f-hcell f-cmain">{!! __(['Topic', 1]) !!}</div>
             <div class="f-hcell f-cstats">{!! __('Stats') !!}</div>
             <div class="f-hcell f-clast">{!! __('Last post') !!}</div>
           </li>
     @foreach ($p->topics as $id => $topic)
-        @if (empty($topic->id) && $iswev = ['e' => [__('Topic %s was not found in the database', $id)]])
+        @if (empty($topic->id) && $iswev = ['e' => [__(['Topic %s was not found in the database', $id])]])
           <li id="topic-{{ $id }}" class="f-row">
             @include ('layouts/iswev')
           </li>
@@ -126,7 +126,7 @@
             @endif
                 </h3>
                 <p><!-- inline -->
-                  <span class="f-cmposter">{!! __('by %s', $topic->poster) !!}</span>
+                  <span class="f-cmposter">{!! __(['by %s', $topic->poster]) !!}</span>
             @if ($p->searchMode)
                   <span class="f-cmforum"><a href="{{ $topic->parent->link }}">{{ $topic->parent->forum_name }}</a></span>
             @endif
@@ -134,14 +134,14 @@
               </div>
             </div>
             <div class="f-cell f-cstats">
-              <span>{!! __('%s Reply', $topic->num_replies, num($topic->num_replies)) !!}</span>
+              <span>{!! __(['%s Reply', $topic->num_replies, num($topic->num_replies)]) !!}</span>
             @if ($topic->showViews)
-              <span>{!! __('%s View', $topic->num_views, num($topic->num_views)) !!}</span>
+              <span>{!! __(['%s View', $topic->num_views, num($topic->num_views)]) !!}</span>
             @endif
             </div>
             <div class="f-cell f-clast">
-              <span class="f-cltopic">{!! __('Last post <a href="%1$s">%2$s</a>', $topic->linkLast, dt($topic->last_post)) !!}</span>
-              <span class="f-clposter">{!! __('by %s', $topic->last_poster) !!}</span>
+              <span class="f-cltopic">{!! __(['Last post <a href="%1$s">%2$s</a>', $topic->linkLast, dt($topic->last_post)]) !!}</span>
+              <span class="f-clposter">{!! __(['by %s', $topic->last_poster]) !!}</span>
             </div>
           </li>
         @endif

+ 1 - 1
app/templates/layouts/debug.forkbb.php

@@ -1,6 +1,6 @@
     <aside id="fork-debug">
       <h2>{!! __('Debug table') !!}</h2>
-      <p id="id-fdebugtime">[ {!! __('Querytime', num($p->time, 3), $p->numQueries) !!} - {!! __('Memory usage', size($p->memory)) !!} {!! __('Peak usage', size($p->peak)) !!} ]</p>
+      <p id="id-fdebugtime">[ {!! __(['Querytime', num($p->time, 3), $p->numQueries]) !!} - {!! __(['Memory usage', size($p->memory)]) !!} {!! __(['Peak usage', size($p->peak)]) !!} ]</p>
 @if ($p->queries)
       <table>
         <thead>

+ 1 - 1
app/templates/layouts/install.forkbb.php

@@ -33,7 +33,7 @@
 @if (! $p->fIswev['e'])
     @if ($form = $p->form2)
     <section class="f-install">
-      <h2>{!! __('Install', $p->rev) !!}</h2>
+      <h2>{!! __(['Install', $p->rev]) !!}</h2>
       <div class="f-fdiv">
         @include ('layouts/form')
       </div>

+ 0 - 4
app/templates/layouts/main.forkbb.php

@@ -54,11 +54,7 @@
         @foreach ($p->fNavigationUser as $key => $val)
           <li id="fork-nav-{{ $key }}" class="f-menu-item"><!-- inline -->
             <a class="f-menu-a @if ($key == $p->fIndex) active @endif" href="{{ $val[0] }}" @if ($val[2]) title="{{ __($val[2]) }}" @endif>
-            @if (\is_array($val[1]))
-              <span class="f-menu-span">{!! __(...$val[1]) !!}</span>
-            @else
               <span class="f-menu-span">{!! __($val[1]) !!}</span>
-            @endif
             </a>
             @if ($val[3])
             <ul class="f-submenu-items">

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

@@ -5,10 +5,10 @@
 @endif
 @foreach ($poll->question as $q => $question)
             <fieldset id="id-question-{{ $q }}" class="f-poll-q">
-              <legend class="f-poll-ql">{!! __('Question %s legend', $q) !!}</legend>
+              <legend class="f-poll-ql">{!! __(['Question %s legend', $q]) !!}</legend>
               <h3 class="f-poll-qt">{{ $question }}</h3>
     @if (($poll->canVote || ! $poll->tid) && $poll->type[$q] > 1)
-              <p class="f-poll-mult">{!! __('You can choose up to %s answers', $poll->type[$q]) !!}</p>
+              <p class="f-poll-mult">{!! __(['You can choose up to %s answers', $poll->type[$q]]) !!}</p>
     @endif
               <ol class="f-poll-as">
     @foreach ($poll->answer[$q] as $a => $answer)
@@ -34,7 +34,7 @@
                 </li>
     @endforeach
               </ol>
-              <p class="f-poll-total">{!! __('In total voted: %s', $poll->total[$q] ?? 0) !!}</p>
+              <p class="f-poll-total">{!! __(['In total voted: %s', $poll->total[$q] ?? 0]) !!}</p>
             </fieldset>
 @endforeach
 @if ($poll->canVote)

+ 2 - 2
app/templates/layouts/stats.forkbb.php

@@ -18,9 +18,9 @@
     @endif
 @endif
 @if ($p->online)
-        <dd>{!! __('Visitors online', num($p->online->numUsers), num($p->online->numGuests)) !!}</dd>
+        <dd>{!! __(['Visitors online', num($p->online->numUsers), num($p->online->numGuests)]) !!}</dd>
     @if ($p->stats)
-        <dd>{!! __('Most online', num($p->online->maxNum), dt($p->online->maxTime)) !!}</dd>
+        <dd>{!! __(['Most online', num($p->online->maxNum), dt($p->online->maxTime)]) !!}</dd>
     @endif
 @endif
       </dl>

+ 6 - 6
app/templates/layouts/subforums.forkbb.php

@@ -24,7 +24,7 @@
                   </h3>
         @if ($cur->subforums)
                   <dl class="f-inline f-fsub"><!-- inline -->
-                    <dt>{!! __('Sub forum', \count($cur->subforums)) !!}</dt>
+                    <dt>{!! __(['Sub forum', \count($cur->subforums)]) !!}</dt>
             @foreach ($cur->subforums as $sub)
                     <dd><a href="{{ $sub->link }}">{{ $sub->forum_name }}</a></dd>
             @endforeach
@@ -35,7 +35,7 @@
         @endif
         @if ($cur->moderators)
                   <dl class="f-inline f-modlist"><!-- inline -->
-                    <dt>{!! __('Moderated by', \count($cur->moderators)) !!}</dt>
+                    <dt>{!! __(['Moderated by', \count($cur->moderators)]) !!}</dt>
             @foreach ($cur->moderators as $mod)
                 @if ($mod['link'])
                     <dd><a href="{{ $mod['link'] }}">{{ $mod['name'] }}</a></dd>
@@ -48,13 +48,13 @@
                 </div>
               </div>
               <div class="f-cell f-cstats">
-                <span>{!! __('%s Topic', $cur->tree->num_topics, num($cur->tree->num_topics)) !!}</span>
-                <span>{!! __('%s Post', $cur->tree->num_posts, num($cur->tree->num_posts)) !!}</span>
+                <span>{!! __(['%s Topic', $cur->tree->num_topics, num($cur->tree->num_topics)]) !!}</span>
+                <span>{!! __(['%s Post', $cur->tree->num_posts, num($cur->tree->num_posts)]) !!}</span>
               </div>
               <div class="f-cell f-clast">
         @if ($cur->tree->last_post_id)
-                <span class="f-cltopic">{!! __('Last post in the topic "<a href="%1$s">%2$s</a>"', $cur->tree->linkLast, $cur->tree->censorLast_topic) !!}</span>
-                <span class="f-clposter">{!! __('by %s', $cur->tree->last_poster) !!}</span>
+                <span class="f-cltopic">{!! __(['Last post in the topic "<a href="%1$s">%2$s</a>"', $cur->tree->linkLast, $cur->tree->censorLast_topic]) !!}</span>
+                <span class="f-clposter">{!! __(['by %s', $cur->tree->last_poster]) !!}</span>
                 <span class="f-cltime">{{ dt($cur->tree->last_post) }}</span>
         @else
                 <span class="f-cltopic">{!! __('Never') !!}</span>

+ 4 - 4
app/templates/topic.forkbb.php

@@ -42,7 +42,7 @@
     <section class="f-main f-topic">
       <h2>{{ $p->model->censorSubject }}</h2>
 @foreach ($p->posts as $id => $post)
-    @if (empty($post->id) && $iswev = ['e' => [__('Message %s was not found in the database', $id)]])
+    @if (empty($post->id) && $iswev = ['e' => [__(['Message %s was not found in the database', $id])]])
         @include ('layouts/iswev')
     @else
       <article id="p{{ $post->id }}" class="f-post @if (1 == $post->user->gender) f-user-male @elseif (2 == $post->user->gender) f-user-female @endif @if ($post->user->online) f-user-online @endif @if (1 === $post->postNumber) f-post-first @endif">
@@ -57,7 +57,7 @@
           <span class="f-post-posted"><time datetime="{{ \gmdate('c', $post->posted) }}">{{ dt($post->posted) }}</time></span>
         @endif
         @if ($post->edited)
-          <span class="f-post-edited" title="{{ __('Last edit', $post->editor, dt($post->edited)) }}">{!! __('Edited') !!}</span>
+          <span class="f-post-edited" title="{{ __(['Last edit', $post->editor, dt($post->edited)]) }}">{!! __('Edited') !!}</span>
         @endif
           <span class="f-post-number"><a href="{{ $post->link }}" rel="bookmark">#{{ $post->postNumber }}</a></span>
         </header>
@@ -83,7 +83,7 @@
         @endif
               <li class="f-usertitle">{{ $post->user->title() }}</li>
         @if ($p->user->showUserInfo && $p->user->showPostCount && $post->user->num_posts)
-              <li class="f-postcount">{!! __('%s post', $post->user->num_posts, num($post->user->num_posts)) !!}</li>
+              <li class="f-postcount">{!! __(['%s post', $post->user->num_posts, num($post->user->num_posts)]) !!}</li>
         @endif
         @if ($linkPromote = $p->user->linkPromote($post))
               <li class="f-promoteuser"><a href="{{ $linkPromote }}">{!! __('Promote user') !!}</a></li>
@@ -94,7 +94,7 @@
             @if ($p->user->isAdmMod && '' != $post->user->admin_note)
               <li class="f-admin-note" title="{{ __('Admin note') }}">{{ $post->user->admin_note }}</li>
             @endif
-              <li>{!! __('Registered: %s', dt($post->user->registered, true)) !!}</li>
+              <li>{!! __(['Registered: %s', dt($post->user->registered, true)]) !!}</li>
             @if ($post->user->location)
               <li>{!! __('From') !!} {{ $post->user->censorLocation }}</li>
             @endif

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

@@ -32,7 +32,7 @@
     <section class="f-main f-topic">
       <h2>{{ $p->model->name }}</h2>
 @foreach ($p->posts as $id => $post)
-    @if (empty($post->id) && $iswev = ['e' => [__('Message %s was not found in the database', $id)]])
+    @if (empty($post->id) && $iswev = ['e' => [__(['Message %s was not found in the database', $id])]])
         @include ('layouts/iswev')
     @else
       <article id="p{{ $post->id }}" class="f-post f-post-search @if (1 == $post->user->gender) f-user-male @elseif (2 == $post->user->gender) f-user-female @endif @if ($post->user->online) f-user-online @endif">
@@ -64,9 +64,9 @@
             <ul class="f-post-search-info">
               <li class="f-psi-forum">{!! __('Forum') !!}: <a href="{{ $post->parent->parent->link }}">{{ $post->parent->parent->forum_name }}</a></li>
               <li class="f-psi-topic">{!! __('Topic') !!}: <a href="{{ $post->parent->link }}">{{ $post->parent->censorSubject }}</a></li>
-              <li class="f-psi-reply">{!! __('%s Reply', $post->parent->num_replies, num($post->parent->num_replies)) !!}</li>
+              <li class="f-psi-reply">{!! __(['%s Reply', $post->parent->num_replies, num($post->parent->num_replies)]) !!}</li>
         @if ($post->parent->showViews)
-              <li class="f-psi-view">{!! __('%s View', $post->parent->num_views, num($post->parent->num_views)) !!}</li>
+              <li class="f-psi-view">{!! __(['%s View', $post->parent->num_views, num($post->parent->num_views)]) !!}</li>
         @endif
             </ul>
           </div>

+ 2 - 2
app/templates/userlist.forkbb.php

@@ -85,9 +85,9 @@
         @endif
             <span class="f-cell f-ctitle"><small>(</small><i>{{ $user->title() }}</i><small>),</small></span>
         @if ($p->user->showPostCount)
-            <span class="f-cell f-cnumposts">{!! __('<b>%s</b><small> post,</small>', $user->num_posts, num($user->num_posts)) !!}</span>
+            <span class="f-cell f-cnumposts">{!! __(['<b>%s</b><small> post,</small>', $user->num_posts, num($user->num_posts)]) !!}</span>
         @endif
-            <span class="f-cell f-cdatereg">{!! __('<small>registered: </small><b>%s</b>', dt($user->registered, true)) !!}</span>
+            <span class="f-cell f-cdatereg">{!! __(['<small>registered: </small><b>%s</b>', dt($user->registered, true)]) !!}</span>
           </li>
     @endforeach
         </ol>