Skip to content

Commit a5f29e7

Browse files
committed
Tradução para outros idiomas
1 parent 5617363 commit a5f29e7

File tree

16 files changed

+547
-46
lines changed

16 files changed

+547
-46
lines changed

inc/config.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class SmartAssignConfigClass {
55
public static $PLUGIN_SMARTASSIGN_ENV = 'desenvolvimento';
66
public static $PLUGIN_SMARTASSIGN_NAME = 'Smart Assign';
77
public static $PLUGIN_SMARTASSIGN_CODE = 'smartassign';
8-
public static $PLUGIN_SMARTASSIGN_VERSION = '2.0.1';
8+
public static $PLUGIN_SMARTASSIGN_VERSION = '2.1.0';
99
public static $PLUGIN_SMARTASSIGN_AUTHOR = 'Richard Loureiro';
1010
public static $PLUGIN_SMARTASSIGN_LICENSE = 'GPLv3';
1111
public static $PLUGIN_SMARTASSIGN_HOME_PAGE = 'https://www.linkedin.com/in/richard-ti/';
@@ -97,14 +97,14 @@ public static function getRrOptionsTable() {
9797

9898
// Define o nome do menu.
9999
static function getMenuName() {
100-
return __('Smart Assign');
100+
return __('Smart Assign', 'smartassign');
101101
}
102102

103103
// Define o conteúdo do menu.
104104
static function getMenuContent() {
105105
global $CFG_GLPI;
106106
$menu = [];
107-
$menu['title'] = __('Smart Assign');
107+
$menu['title'] = __('Smart Assign', 'smartassign');
108108
$menu['page'] = $CFG_GLPI['root_doc'] . "/plugins/smartassign/front/config.form.php";
109109
$menu['icon'] = 'fas fa-user-check';
110110
return $menu;

inc/config.form.class.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66

77
class SmartAssignConfigFormClass extends CommonDBTM {
88

9-
// Propriedade para armazenar a dependência
9+
// Property to store dependency
1010
private $rrAssignmentsEntity;
1111

1212
public function __construct() {
13-
PluginSmartAssignLogger::addWarning(__METHOD__ . ' - construtor chamado');
13+
PluginSmartAssignLogger::addWarning(__METHOD__ . ' - constructor called');
1414

15-
// Inicializar a dependência no construtor
15+
// Initialize dependency in constructor
1616
$this->rrAssignmentsEntity = new PluginSmartAssignRRAssignmentsEntity();
1717
}
1818

1919
public function renderTitle() {
2020
$injectHTML = <<< EOT
2121
<p>
2222
<div align='center'>
23-
<h1>Configurações do SmartAssign</h1>
23+
<h1>SmartAssign</h1>
2424
</div>
2525
</p>
2626
EOT;
@@ -31,16 +31,16 @@ public function showFormSmartAssign() {
3131
global $CFG_GLPI, $DB;
3232

3333
if (self::checkCentralInterface()) {
34-
PluginSmartAssignLogger::addWarning(__METHOD__ . ' - exibir conteúdo');
34+
PluginSmartAssignLogger::addWarning(__METHOD__ . ' - displaying content');
3535
self::displayContent();
3636
} else {
37-
echo "<div align='center'><br><img src='" . $CFG_GLPI['root_doc'] . "/pics/warning.png'><br>" . __("Acesso negado") . "</div>";
37+
echo "<div align='center'><br><img src='" . $CFG_GLPI['root_doc'] . "/pics/warning.png'><br>" . __("Access denied", 'smartassign') . "</div>";
3838
}
3939
}
4040

4141
public static function checkCentralInterface() {
4242
$currentInterface = Session::getCurrentInterface();
43-
PluginSmartAssignLogger::addWarning(__METHOD__ . ' - interface atual: ' . $currentInterface);
43+
PluginSmartAssignLogger::addWarning(__METHOD__ . ' - current interface: ' . $currentInterface);
4444
return $currentInterface === 'central';
4545
}
4646

@@ -50,47 +50,47 @@ public function displayContent() {
5050
$auto_assign_mode = Html::cleanInputText(self::getAutoAssignMode());
5151
$settings = self::getSettings();
5252

53-
// Gerar o token CSRF e armazená-lo na sessão
53+
// Generate CSRF token and store it in the session
5454
$csrfToken = Session::getNewCSRFToken();
5555
$_SESSION['_glpi_csrf_token'] = $csrfToken;
5656

5757
echo "<div class='center'>";
5858
echo "<form name='settingsForm' action='config.form.php' method='post' enctype='multipart/form-data'>";
59-
echo Html::hidden('_glpi_csrf_token', ['value' => $csrfToken]); // Utiliza o token armazenado na sessão
59+
echo Html::hidden('_glpi_csrf_token', ['value' => $csrfToken]); // Use token stored in session
6060
echo "<table class='tab_cadre_fixe'>";
6161

62-
// Título do Formulário
63-
echo "<tr><th colspan='4'>Distribuição inteligente de chamados, com base no grupo encarregado da Categoria ITIL</th></tr>";
62+
// Form Title
63+
echo "<tr><th colspan='4'>" . __('Smart ticket distribution based on ITIL Category group', 'smartassign') . "</th></tr>";
6464
echo "<tr><th colspan='4'><hr /></th></tr>";
6565

6666
echo "<tr><th colspan='4'>";
67-
echo "Atribuir o grupo encarregado da Categoria ITIL? &nbsp;&nbsp;";
68-
echo "<input type='radio' name='auto_assign_group' value='1'" . ($auto_assign_group ? " checked='checked'" : "") . "> Sim&nbsp;&nbsp;";
69-
echo "<input type='radio' name='auto_assign_group' value='0'" . (!$auto_assign_group ? " checked='checked'" : "") . "> Não";
67+
echo __('Assign the ITIL Category group?', 'smartassign') . "&nbsp;&nbsp;";
68+
echo "<input type='radio' name='auto_assign_group' value='1'" . ($auto_assign_group ? " checked='checked'" : "") . "> " . __('Yes', 'smartassign') . "&nbsp;&nbsp;";
69+
echo "<input type='radio' name='auto_assign_group' value='0'" . (!$auto_assign_group ? " checked='checked'" : "") . "> " . __('No', 'smartassign') . "";
7070
echo "</th></tr>";
7171

7272
echo "<tr><th colspan='4'>";
73-
echo "Atribuição do tecnico por Categoria ou Grupo encarregado? &nbsp;&nbsp;";
74-
echo "<input type='radio' name='auto_assign_type' value='1'" . ($auto_assign_type ? " checked='checked'" : "") . "> Categoria&nbsp;&nbsp;";
75-
echo "<input type='radio' name='auto_assign_type' value='0'" . (!$auto_assign_type ? " checked='checked'" : "") . "> Grupo";
76-
echo "<br><span style='font-size: 12px; color: #555;'>Quando categoria, a divisão é feita igualitariamente dentro de cada categoria, com base no grupo. Quando grupo, a divisão é feita igualitariamente entre categorias com o mesmo grupo.</span>";
73+
echo __('Assign technician by ITIL Category or group?', 'smartassign') . "&nbsp;&nbsp;";
74+
echo "<input type='radio' name='auto_assign_type' value='1'" . ($auto_assign_type ? " checked='checked'" : "") . "> " . __('Category', 'smartassign') . "&nbsp;&nbsp;";
75+
echo "<input type='radio' name='auto_assign_type' value='0'" . (!$auto_assign_type ? " checked='checked'" : "") . "> " . __('Group', 'smartassign') . "";
76+
echo "<br><span style='font-size: 12px; color: #555;'>" . __('For category, the distribution is done equally within each category based on the group. For group, the distribution is done equally among categories with the same group.', 'smartassign') . "</span>";
7777
echo "</th></tr>";
7878

7979
echo "<tr><th colspan='4'>";
80-
echo "Atribuição do tecnico por Rodizio ou Balanceamento? &nbsp;&nbsp;";
81-
echo "<input type='radio' name='auto_assign_mode' value='1'" . ($auto_assign_mode ? " checked='checked'" : "") . "> Rodizio&nbsp;&nbsp;";
82-
echo "<input type='radio' name='auto_assign_mode' value='0'" . (!$auto_assign_mode ? " checked='checked'" : "") . "> Balanceamento";
83-
echo "<br><span style='font-size: 12px; color: #555;'>Quando Rodizio, a divisão é feita igualitariamente. Quando Balanceamento, a divisão é feita com base no tecnico com menos chamados abertos na fila.</span>";
80+
echo __('Assign technician by rotation or balancing?', 'smartassign') . "&nbsp;&nbsp;";
81+
echo "<input type='radio' name='auto_assign_mode' value='1'" . ($auto_assign_mode ? " checked='checked'" : "") . "> " . __('Rotation', 'smartassign') . "&nbsp;&nbsp;";
82+
echo "<input type='radio' name='auto_assign_mode' value='0'" . (!$auto_assign_mode ? " checked='checked'" : "") . "> " . __('Balancing', 'smartassign') . "";
83+
echo "<br><span style='font-size: 12px; color: #555;'>" . __('For rotation, distribution is equal. For balancing, distribution is based on the technician with fewer open tickets in the queue.', 'smartassign') . "</span>";
8484
echo "</th></tr>";
8585

8686
echo "<tr><th colspan='4'><hr /></th></tr>";
87-
echo "<tr><th>ITIL Category</th><th>Grupo</th><th>Número de Membros</th><th>Configuração</th></tr>";
87+
echo "<tr><th>" . __('ITIL Category', 'smartassign') . "</th><th>" . __('Group', 'smartassign') . "</th><th>" . __('Number of members', 'smartassign') . "</th><th>" . __('Configuration', 'smartassign') . "</th></tr>";
8888

8989
foreach ($settings as $row) {
9090
$id = $row['id'];
9191
$itilcategories_id = $row['itilcategories_id'];
9292
$category_name = Html::cleanInputText($row['category_name']);
93-
$group_name = isset($row['group_name']) ? Html::cleanInputText($row['group_name']) : "<em>Nenhum grupo atribuído</em>";
93+
$group_name = isset($row['group_name']) ? Html::cleanInputText($row['group_name']) : "<em>" . __('No group assigned', 'smartassign') . "</em>";
9494
$num_group_members = isset($row['num_group_members']) ? Html::cleanInputText($row['num_group_members']) : "<em>N/A</em>";
9595
$is_active = $row['is_active'];
9696

@@ -100,14 +100,14 @@ public function displayContent() {
100100
echo "<td>{$num_group_members}</td>";
101101
echo "<td>";
102102
echo Html::hidden("itilcategories_id_{$id}", ['value' => $itilcategories_id]);
103-
echo "<input type='radio' name='is_active_{$id}' value='1' " . ($is_active ? "checked='checked'" : "") . "> Ativado&nbsp;&nbsp;";
104-
echo "<input type='radio' name='is_active_{$id}' value='0' " . (!$is_active ? "checked='checked'" : "") . "> Desativado";
103+
echo "<input type='radio' name='is_active_{$id}' value='1' " . ($is_active ? "checked='checked'" : "") . "> " . __('Active', 'smartassign') . "&nbsp;&nbsp;";
104+
echo "<input type='radio' name='is_active_{$id}' value='0' " . (!$is_active ? "checked='checked'" : "") . "> " . __('Inactive', 'smartassign') . "";
105105
echo "</td>";
106106
echo "</tr>";
107107
}
108108

109109
echo "<tr><td colspan='4'><hr/></td></tr>";
110-
echo "<tr><td colspan='4' style='text-align: right;'><input type='submit' name='save' class='submit' value=" . __('Salvar') . ">&nbsp;&nbsp;<input type='submit' class='submit' name='cancel' value=" . __('Cancelar') . "></td></tr>";
110+
echo "<tr><td colspan='4' style='text-align: right;'><input type='submit' name='save' class='submit' value=" . __('Save', 'smartassign') . ">&nbsp;&nbsp;<input type='submit' class='submit' name='cancel' value=" . __('Cancel', 'smartassign') . "></td></tr>";
111111
echo "</table>";
112112
}
113113

@@ -132,24 +132,24 @@ protected static function getAutoAssignMode() {
132132
}
133133

134134
public function saveSettings() {
135-
// Validação do token CSRF
135+
// CSRF token validation
136136
if (!isset($_POST['_glpi_csrf_token']) || $_POST['_glpi_csrf_token'] !== $_SESSION['_glpi_csrf_token']) {
137-
die('Token CSRF inválido');
137+
die(__('Invalid CSRF token', 'smartassign'));
138138
}
139139

140140
PluginSmartAssignLogger::addWarning(__METHOD__ . ' - POST: ' . print_r($_POST, true));
141141
$rrAssignmentsEntity = new PluginSmartAssignRRAssignmentsEntity();
142142

143-
//Salvar opções)
143+
// Save options
144144
$rrAssignmentsEntity->updateAutoAssignGroup($_POST['auto_assign_group']);
145145
$rrAssignmentsEntity->updateAutoAssignType($_POST['auto_assign_type']);
146146
$rrAssignmentsEntity->updateAutoAssignMode($_POST['auto_assign_mode']);
147147

148-
// Salvar todas as atribuições
148+
// Save all assignments
149149
foreach (self::getSettings() as $row) {
150150
$itilCategoryId = $_POST["itilcategories_id_{$row['id']}"];
151151
$newValue = $_POST["is_active_{$row['id']}"];
152152
$rrAssignmentsEntity->updateIsActive($itilCategoryId, $newValue);
153153
}
154154
}
155-
}
155+
}

locales/en_GB.mo

2.18 KB
Binary file not shown.

locales/en_GB.po

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: GLPI - Smart Assign Plugin\n"
4+
"Report-Msgid-Bugs-To: [email protected]\n"
5+
"POT-Creation-Date: 2025-01-13\n"
6+
"PO-Revision-Date: 2025-01-13 14:49-0300\n"
7+
"Last-Translator: Richard Loureiro <[email protected]>, 2025\n"
8+
"Language-Team: English (US) <[email protected]>\n"
9+
"Language: en_GB\n"
10+
"MIME-Version: 1.0\n"
11+
"Content-Type: text/plain; charset=UTF-8\n"
12+
"Content-Transfer-Encoding: 8bit\n"
13+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
14+
"X-Generator: Poedit 3.5\n"
15+
16+
msgid "Access denied"
17+
msgstr "Access denied"
18+
19+
msgid "Smart ticket distribution based on ITIL Category group"
20+
msgstr "Smart ticket distribution based on ITIL Category group"
21+
22+
msgid "Assign the ITIL Category group?"
23+
msgstr "Assign the ITIL Category group?"
24+
25+
msgid "Yes"
26+
msgstr "Yes"
27+
28+
msgid "No"
29+
msgstr "No"
30+
31+
msgid "Assign technician by ITIL Category or group?"
32+
msgstr "Assign technician by ITIL Category or group?"
33+
34+
msgid "Category"
35+
msgstr "Category"
36+
37+
msgid "Group"
38+
msgstr "Group"
39+
40+
msgid "For category, the distribution is done equally within each category based on the group. For group, the distribution is done equally among categories with the same group."
41+
msgstr "For category, the distribution is done equally within each category based on the group. For group, the distribution is done equally among categories with the same group."
42+
43+
msgid "Assign technician by rotation or balancing?"
44+
msgstr "Assign technician by rotation or balancing?"
45+
46+
msgid "Rotation"
47+
msgstr "Rotation"
48+
49+
msgid "Balancing"
50+
msgstr "Balancing"
51+
52+
msgid "For rotation, distribution is equal. For balancing, distribution is based on the technician with fewer open tickets in the queue."
53+
msgstr "For rotation, distribution is equal. For balancing, distribution is based on the technician with fewer open tickets in the queue."
54+
55+
msgid "ITIL Category"
56+
msgstr "ITIL Category"
57+
58+
msgid "Number of members"
59+
msgstr "Number of members"
60+
61+
msgid "Configuration"
62+
msgstr "Configuration"
63+
64+
msgid "No group assigned"
65+
msgstr "No group assigned"
66+
67+
msgid "Active"
68+
msgstr "Active"
69+
70+
msgid "Inactive"
71+
msgstr "Inactive"
72+
73+
msgid "Save"
74+
msgstr "Save"
75+
76+
msgid "Cancel"
77+
msgstr "Cancel"
78+
79+
msgid "Invalid CSRF token"
80+
msgstr "Invalid CSRF token"

locales/en_US.mo

2.18 KB
Binary file not shown.

locales/en_US.po

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: GLPI - Smart Assign Plugin\n"
4+
"Report-Msgid-Bugs-To: [email protected]\n"
5+
"POT-Creation-Date: 2025-01-12 13:00+0000\n"
6+
"PO-Revision-Date: 2025-01-13 14:33-0300\n"
7+
"Last-Translator: Richard Loureiro <[email protected]>, 2025\n"
8+
"Language-Team: English (US) <[email protected]>\n"
9+
"Language: en_US\n"
10+
"MIME-Version: 1.0\n"
11+
"Content-Type: text/plain; charset=UTF-8\n"
12+
"Content-Transfer-Encoding: 8bit\n"
13+
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
14+
"X-Generator: Poedit 3.5\n"
15+
16+
msgid "Access denied"
17+
msgstr "Access denied"
18+
19+
msgid "Smart ticket distribution based on ITIL Category group"
20+
msgstr "Smart ticket distribution based on ITIL Category group"
21+
22+
msgid "Assign the ITIL Category group?"
23+
msgstr "Assign the ITIL Category group?"
24+
25+
msgid "Yes"
26+
msgstr "Yes"
27+
28+
msgid "No"
29+
msgstr "No"
30+
31+
msgid "Assign technician by ITIL Category or group?"
32+
msgstr "Assign technician by ITIL Category or group?"
33+
34+
msgid "Category"
35+
msgstr "Category"
36+
37+
msgid "Group"
38+
msgstr "Group"
39+
40+
msgid "For category, the distribution is done equally within each category based on the group. For group, the distribution is done equally among categories with the same group."
41+
msgstr "For category, the distribution is done equally within each category based on the group. For group, the distribution is done equally among categories with the same group."
42+
43+
msgid "Assign technician by rotation or balancing?"
44+
msgstr "Assign technician by rotation or balancing?"
45+
46+
msgid "Rotation"
47+
msgstr "Rotation"
48+
49+
msgid "Balancing"
50+
msgstr "Balancing"
51+
52+
msgid "For rotation, distribution is equal. For balancing, distribution is based on the technician with fewer open tickets in the queue."
53+
msgstr "For rotation, distribution is equal. For balancing, distribution is based on the technician with fewer open tickets in the queue."
54+
55+
msgid "ITIL Category"
56+
msgstr "ITIL Category"
57+
58+
msgid "Number of members"
59+
msgstr "Number of members"
60+
61+
msgid "Configuration"
62+
msgstr "Configuration"
63+
64+
msgid "No group assigned"
65+
msgstr "No group assigned"
66+
67+
msgid "Active"
68+
msgstr "Active"
69+
70+
msgid "Inactive"
71+
msgstr "Inactive"
72+
73+
msgid "Save"
74+
msgstr "Save"
75+
76+
msgid "Cancel"
77+
msgstr "Cancel"
78+
79+
msgid "Invalid CSRF token"
80+
msgstr "Invalid CSRF token"

locales/es_ES.mo

2.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)