Skip to content

Commit 7aead6f

Browse files
committed
psalm
1 parent a9ab7df commit 7aead6f

19 files changed

+84
-63
lines changed

front/computergroup.form.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
'PluginDatabaseinventoryComputerGroup',
5555
4,
5656
'inventory',
57-
sprintf(__('%1$s adds the item %2$s'), $_SESSION['glpiname'], $_POST['name']),
57+
sprintf(__s('%1$s adds the item %2$s'), $_SESSION['glpiname'], $_POST['name']),
5858
);
5959

6060
if ($_SESSION['glpibackcreated']) {
@@ -64,7 +64,7 @@
6464
Html::back();
6565
} elseif (isset($_POST['add_staticcomputer'])) {
6666
if (!$_POST['computers_id']) {
67-
Session::addMessageAfterRedirect(__('Please select a computer', 'databaseinventory'), false, ERROR);
67+
Session::addMessageAfterRedirect(__s('Please select a computer', 'databaseinventory'), false, ERROR);
6868
Html::back();
6969
}
7070

@@ -75,7 +75,7 @@
7575
'PluginDatabaseinventoryComputerGroupStatic',
7676
4,
7777
'inventory',
78-
sprintf(__('%1$s adds the item %2$s'), $_SESSION['glpiname'], $computergroupstatic::getTypeName(0)),
78+
sprintf(__s('%1$s adds the item %2$s'), $_SESSION['glpiname'], $computergroupstatic::getTypeName(0)),
7979
);
8080

8181
if ($_SESSION['glpibackcreated']) {
@@ -94,7 +94,7 @@
9494
4,
9595
'inventory',
9696
//TRANS: %s is the user login
97-
sprintf(__('%s purges an item'), $_SESSION['glpiname']),
97+
sprintf(__s('%s purges an item'), $_SESSION['glpiname']),
9898
);
9999
}
100100
$computergroup->redirectToList();
@@ -108,7 +108,7 @@
108108
4,
109109
'inventory',
110110
//TRANS: %s is the user login
111-
sprintf(__('%s updates an item'), $_SESSION['glpiname']),
111+
sprintf(__s('%s updates an item'), $_SESSION['glpiname']),
112112
);
113113
Html::back();
114114
} else {

front/credential.form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
'PluginDatabaseinventoryCredential',
5454
4,
5555
'inventory',
56-
sprintf(__('%1$s adds the item %2$s'), $_SESSION['glpiname'], $_POST['name']),
56+
sprintf(__s('%1$s adds the item %2$s'), $_SESSION['glpiname'], $_POST['name']),
5757
);
5858

5959
if ($_SESSION['glpibackcreated']) {
@@ -71,7 +71,7 @@
7171
4,
7272
'inventory',
7373
//TRANS: %s is the user login
74-
sprintf(__('%s purges an item'), $_SESSION['glpiname']),
74+
sprintf(__s('%s purges an item'), $_SESSION['glpiname']),
7575
);
7676
}
7777
$credential->redirectToList();
@@ -85,7 +85,7 @@
8585
4,
8686
'inventory',
8787
//TRANS: %s is the user login
88-
sprintf(__('%s updates an item'), $_SESSION['glpiname']),
88+
sprintf(__s('%s updates an item'), $_SESSION['glpiname']),
8989
);
9090
Html::back();
9191
} else {

front/databaseparam.form.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
'PluginDatabaseinventoryDatabaseParam',
5656
4,
5757
'inventory',
58-
sprintf(__('%1$s adds the item %2$s'), $_SESSION['glpiname'], $_POST['name']),
58+
sprintf(__s('%1$s adds the item %2$s'), $_SESSION['glpiname'], $_POST['name']),
5959
);
6060

6161
if ($_SESSION['glpibackcreated']) {
@@ -72,7 +72,7 @@
7272
'PluginDatabaseinventoryDatabaseParam_Credential',
7373
4,
7474
'inventory',
75-
sprintf(__('%1$s adds the item %2$s'), $_SESSION['glpiname'], $databaseparam_credential::getTypeName(0)),
75+
sprintf(__s('%1$s adds the item %2$s'), $_SESSION['glpiname'], $databaseparam_credential::getTypeName(0)),
7676
);
7777

7878
if ($_SESSION['glpibackcreated']) {
@@ -90,7 +90,7 @@
9090
'PluginDatabaseinventoryDatabaseParam_ComputerGroup',
9191
4,
9292
'inventory',
93-
sprintf(__('%1$s adds the item %2$s'), $_SESSION['glpiname'], $databaseparam_computergroup::getTypeName(0)),
93+
sprintf(__s('%1$s adds the item %2$s'), $_SESSION['glpiname'], $databaseparam_computergroup::getTypeName(0)),
9494
);
9595

9696
if ($_SESSION['glpibackcreated']) {
@@ -109,7 +109,7 @@
109109
4,
110110
'inventory',
111111
//TRANS: %s is the user login
112-
sprintf(__('%s purges an item'), $_SESSION['glpiname']),
112+
sprintf(__s('%s purges an item'), $_SESSION['glpiname']),
113113
);
114114
}
115115
$databaseparam->redirectToList();
@@ -123,7 +123,7 @@
123123
4,
124124
'inventory',
125125
//TRANS: %s is the user login
126-
sprintf(__('%s updates an item'), $_SESSION['glpiname']),
126+
sprintf(__s('%s updates an item'), $_SESSION['glpiname']),
127127
);
128128
Html::back();
129129
} else {

front/menu.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
global $CFG_GLPI;
3636

3737
Html::header(
38-
__('Database Inventory', 'databaseinventory'),
38+
__s('Database Inventory', 'databaseinventory'),
3939
$_SERVER['PHP_SELF'],
4040
'admin',
4141
'PluginDatabaseInventoryMenu',
@@ -44,7 +44,7 @@
4444
if (PluginDatabaseinventoryDatabaseParam::canView()) {
4545
echo "<div class='center'>";
4646
echo "<table class='tab_cadre'>";
47-
echo "<tr><th colspan='2'>" . __('Database Inventory', 'databaseinventory') . '</th></tr>';
47+
echo "<tr><th colspan='2'>" . __s('Database Inventory', 'databaseinventory') . '</th></tr>';
4848

4949
echo "<tr class='tab_bg_1 center'>";
5050
echo "<td><i class='fas fa-cog'></i></td>";
@@ -68,7 +68,7 @@
6868
echo '</table></div>';
6969
} else {
7070
echo "<div class='center'><br><br><img src=\"" . $CFG_GLPI['root_doc'] . '/pics/warning.png" alt="warning"><br><br>';
71-
echo '<b>' . __('Access denied') . '</b></div>';
71+
echo '<b>' . __s('Access denied') . '</b></div>';
7272
}
7373

7474
Html::footer();

hook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function plugin_databaseinventory_MassiveActions($type)
9393
case 'Agent':
9494
$class = PluginDatabaseinventoryInventoryAction::getType();
9595
$key = PluginDatabaseinventoryInventoryAction::MA_PARTIAL;
96-
$label = __('Run partial databases inventory', 'databaseinventory');
96+
$label = __s('Run partial databases inventory', 'databaseinventory');
9797

9898
return [$class . MassiveAction::CLASS_ACTION_SEPARATOR . $key => $label];
9999
}

inc/computergroup.class.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PluginDatabaseinventoryComputerGroup extends CommonDBTM
6565

6666
public static function getTypeName($nb = 0)
6767
{
68-
return _n('Computer Group', 'Computers Group', $nb, 'databaseinventory');
68+
return _sn('Computer Group', 'Computers Group', $nb, 'databaseinventory');
6969
}
7070

7171
public static function canCreate(): bool
@@ -97,7 +97,7 @@ public function rawSearchOptions()
9797
'id' => '2',
9898
'table' => $this->getTable(),
9999
'field' => 'id',
100-
'name' => __('ID'),
100+
'name' => __s('ID'),
101101
'massiveaction' => false, // implicit field is id
102102
'datatype' => 'number',
103103
];
@@ -106,15 +106,15 @@ public function rawSearchOptions()
106106
'id' => '3',
107107
'table' => $this->getTable(),
108108
'field' => 'comment',
109-
'name' => __('Comment'),
109+
'name' => __s('Comment'),
110110
'datatype' => 'text',
111111
];
112112

113113
$tab[] = [
114114
'id' => '5',
115115
'table' => PluginDatabaseinventoryComputerGroupDynamic::getTable(),
116116
'field' => 'search',
117-
'name' => __('Number of dynamic items', 'databaseinventory'),
117+
'name' => __s('Number of dynamic items', 'databaseinventory'),
118118
'nosearch' => true,
119119
'massiveaction' => false,
120120
'forcegroupby' => true,
@@ -127,7 +127,7 @@ public function rawSearchOptions()
127127
'id' => '6',
128128
'table' => PluginDatabaseinventoryComputerGroupStatic::getTable(),
129129
'field' => 'id',
130-
'name' => __('Number of static items', 'databaseinventory'),
130+
'name' => __s('Number of static items', 'databaseinventory'),
131131
'forcegroupby' => true,
132132
'usehaving' => true,
133133
'nosearch' => true,
@@ -140,7 +140,7 @@ public function rawSearchOptions()
140140
'id' => '7',
141141
'table' => PluginDatabaseinventoryComputerGroupDynamic::getTable(),
142142
'field' => '_virtual_dynamic_list',
143-
'name' => __('List of dynamic items', 'databaseinventory'),
143+
'name' => __s('List of dynamic items', 'databaseinventory'),
144144
'massiveaction' => false,
145145
'forcegroupby' => true,
146146
'nosearch' => true,
@@ -155,7 +155,7 @@ public function rawSearchOptions()
155155
'table' => Computer::getTable(),
156156
'field' => 'name',
157157
'datatype' => 'itemlink',
158-
'name' => __('List of static items', 'databaseinventory'),
158+
'name' => __s('List of static items', 'databaseinventory'),
159159
'forcegroupby' => true,
160160
'massiveaction' => false,
161161
'joinparams' => [

inc/computergroupdynamic.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PluginDatabaseinventoryComputerGroupDynamic extends CommonDBTM
3434

3535
public static function getTypeName($nb = 0)
3636
{
37-
return _n('Dynamic group', 'Dynamic groups', $nb, 'databaseinventory');
37+
return _sn('Dynamic group', 'Dynamic groups', $nb, 'databaseinventory');
3838
}
3939

4040
public static function canCreate(): bool

inc/computergroupstatic.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class PluginDatabaseinventoryComputerGroupStatic extends CommonDBRelation
7474

7575
public static function getTypeName($nb = 0)
7676
{
77-
return _n('Static group', 'Static groups', $nb, 'databaseinventory');
77+
return _sn('Static group', 'Static groups', $nb, 'databaseinventory');
7878
}
7979

8080
public static function canCreate(): bool

inc/contactlog.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function canPurge(): bool
8080

8181
public static function getTypeName($nb = 0)
8282
{
83-
return _n('Contact log', 'Contact logs', $nb, 'databaseinventory');
83+
return _sn('Contact log', 'Contact logs', $nb, 'databaseinventory');
8484
}
8585

8686
public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)

inc/credential.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function canPurge(): bool
8080

8181
public static function getTypeName($nb = 0)
8282
{
83-
return _n('Credential', 'Credentials', $nb, 'databaseinventory');
83+
return _sn('Credential', 'Credentials', $nb, 'databaseinventory');
8484
}
8585

8686
public function rawSearchOptions()
@@ -91,7 +91,7 @@ public function rawSearchOptions()
9191
'id' => '2',
9292
'table' => $this->getTable(),
9393
'field' => 'id',
94-
'name' => __('ID'),
94+
'name' => __s('ID'),
9595
'massiveaction' => false, // implicit field is id
9696
'datatype' => 'number',
9797
];
@@ -100,31 +100,31 @@ public function rawSearchOptions()
100100
'id' => '3',
101101
'table' => $this->getTable(),
102102
'field' => 'login',
103-
'name' => __('Login'),
103+
'name' => __s('Login'),
104104
'datatype' => 'text',
105105
];
106106

107107
$tab[] = [
108108
'id' => '4',
109109
'table' => $this->getTable(),
110110
'field' => 'port',
111-
'name' => __('Port'),
111+
'name' => __s('Port'),
112112
'datatype' => 'number',
113113
];
114114

115115
$tab[] = [
116116
'id' => '5',
117117
'table' => $this->getTable(),
118118
'field' => 'socket',
119-
'name' => __('Socket'),
119+
'name' => __s('Socket'),
120120
'datatype' => 'text',
121121
];
122122

123123
$tab[] = [
124124
'id' => '6',
125125
'table' => PluginDatabaseinventoryCredentialType::getTable(),
126126
'field' => 'name',
127-
'name' => _n('Type', 'Types', 1),
127+
'name' => _sn('Type', 'Types', 1),
128128
'datatype' => 'dropdown',
129129
];
130130

0 commit comments

Comments
 (0)