Add multilanguage support to GLPI SOC Plugin

This commit is contained in:
tips-of-mine
2025-05-31 10:57:31 +02:00
committed by GitHub
parent 5f97834036
commit c428a4271b
11 changed files with 745 additions and 4 deletions

View File

@ -12,6 +12,7 @@ This plugin provides a specialized case management system for Security Operation
- SOC-specific KPI dashboard and reporting
- Role-based access control
- Search and filtering capabilities
- Multilanguage support (German, English, French, Italian, Polish, Spanish, Portuguese)
## Requirements
- GLPI >= 10.0.0

View File

@ -8,9 +8,11 @@
<short>
<de>SOC-Case-Management GLPI-Plugin.</de>
<en>SOC-Case-Management GLPI plugin.</en>
<fr>Plugin GLPI SOC-Case-Management.</fr>ac
<fr>Plugin GLPI SOC-Case-Management.</fr>
<it>Plug-in GLPI "SOC-Case-Management".</it>
<pl>Plugin SOC-Case-Management.</pl>
<es>Plugin GLPI de SOC-Case-Management.</es>
<pt>Plugin GLPI de SOC-Case-Management.</pt>
</short>
<long>
<de>SOC-Case-Management-Integrations-GLPI-Plugin.</de>
@ -18,6 +20,8 @@
<fr>SOC-Case-Management integration GLPI plugin.</fr>
<it>Plug-in GLPI di integrazione SOC-Case-Management.</it>
<pl>Wtyczka GLPI dla SOC-Case-Management.</pl>
<es>Plugin de integración SOC-Case-Management para GLPI.</es>
<pt>Plugin de integração SOC-Case-Management para GLPI.</pt>
</long>
</description>
<homepage>https://github.com/tips-of-mine/GLPI-Plugin-SOC-Case-Management/</homepage>
@ -40,6 +44,8 @@
<lang>fr_FR</lang>
<lang>it_IT</lang>
<lang>pl_PL</lang>
<lang>es_ES</lang>
<lang>pt_PT</lang>
</langs>
<license>GPL V3+</license>
<tags>

View File

@ -24,7 +24,7 @@ class PluginSocCase extends CommonDBTM {
* @return string
*/
static function getTypeName($nb = 0) {
return _n('SOC Case', 'SOC Cases', $nb);
return _n('SOC Case', 'SOC Cases', $nb, 'soc');
}
/**
@ -56,7 +56,7 @@ class PluginSocCase extends CommonDBTM {
self::SEVERITY_CRITICAL => __('Critical', 'soc'),
self::SEVERITY_HIGH => __('High', 'soc'),
self::SEVERITY_MEDIUM => __('Medium', 'soc'),
self::SEVERITY_MEDIUM => __('Low', 'soc')
self::SEVERITY_LOW => __('Low', 'soc')
];
}

102
locales/de_DE/soc.po Normal file
View File

@ -0,0 +1,102 @@
msgid ""
msgstr ""
"Project-Id-Version: GLPI SOC Case Management Plugin\n"
"POT-Creation-Date: 2025-04-15 12:00+0200\n"
"PO-Revision-Date: 2025-04-15 12:00+0200\n"
"Last-Translator: Your Organization\n"
"Language-Team: German\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "SOC Case"
msgstr "SOC-Fall"
msgid "SOC Cases"
msgstr "SOC-Fälle"
msgid "SOC Dashboard"
msgstr "SOC-Dashboard"
msgid "SOC Case Management Dashboard"
msgstr "SOC-Fallmanagement-Dashboard"
msgid "Total Cases"
msgstr "Gesamtfälle"
msgid "New Cases"
msgstr "Neue Fälle"
msgid "Critical Cases"
msgstr "Kritische Fälle"
msgid "Recent Cases"
msgstr "Aktuelle Fälle"
msgid "No cases found."
msgstr "Keine Fälle gefunden."
msgid "View all cases"
msgstr "Alle Fälle anzeigen"
msgid "Create new case"
msgstr "Neuen Fall erstellen"
msgid "Status"
msgstr "Status"
msgid "Severity"
msgstr "Schweregrad"
msgid "Critical"
msgstr "Kritisch"
msgid "High"
msgstr "Hoch"
msgid "Medium"
msgstr "Mittel"
msgid "Low"
msgstr "Niedrig"
msgid "New"
msgstr "Neu"
msgid "Assigned"
msgstr "Zugewiesen"
msgid "In Progress"
msgstr "In Bearbeitung"
msgid "Pending"
msgstr "Ausstehend"
msgid "Resolved"
msgstr "Gelöst"
msgid "Closed"
msgstr "Geschlossen"
msgid "Technician"
msgstr "Techniker"
msgid "Description"
msgstr "Beschreibung"
msgid "Case created"
msgstr "Fall erstellt"
msgid "%s updated %s from %s to %s"
msgstr "%s hat %s von %s auf %s aktualisiert"
msgid "Ticket %s created: %s"
msgstr "Ticket %s erstellt: %s"
msgid "Change %s created: %s"
msgstr "Änderung %s erstellt: %s"
msgid "[SOC Case #%s] %s"
msgstr "[SOC-Fall #%s] %s"

102
locales/en_GB/soc.po Normal file
View File

@ -0,0 +1,102 @@
msgid ""
msgstr ""
"Project-Id-Version: GLPI SOC Case Management Plugin\n"
"POT-Creation-Date: 2025-04-15 12:00+0200\n"
"PO-Revision-Date: 2025-04-15 12:00+0200\n"
"Last-Translator: Your Organization\n"
"Language-Team: English\n"
"Language: en_GB\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "SOC Case"
msgstr "SOC Case"
msgid "SOC Cases"
msgstr "SOC Cases"
msgid "SOC Dashboard"
msgstr "SOC Dashboard"
msgid "SOC Case Management Dashboard"
msgstr "SOC Case Management Dashboard"
msgid "Total Cases"
msgstr "Total Cases"
msgid "New Cases"
msgstr "New Cases"
msgid "Critical Cases"
msgstr "Critical Cases"
msgid "Recent Cases"
msgstr "Recent Cases"
msgid "No cases found."
msgstr "No cases found."
msgid "View all cases"
msgstr "View all cases"
msgid "Create new case"
msgstr "Create new case"
msgid "Status"
msgstr "Status"
msgid "Severity"
msgstr "Severity"
msgid "Critical"
msgstr "Critical"
msgid "High"
msgstr "High"
msgid "Medium"
msgstr "Medium"
msgid "Low"
msgstr "Low"
msgid "New"
msgstr "New"
msgid "Assigned"
msgstr "Assigned"
msgid "In Progress"
msgstr "In Progress"
msgid "Pending"
msgstr "Pending"
msgid "Resolved"
msgstr "Resolved"
msgid "Closed"
msgstr "Closed"
msgid "Technician"
msgstr "Technician"
msgid "Description"
msgstr "Description"
msgid "Case created"
msgstr "Case created"
msgid "%s updated %s from %s to %s"
msgstr "%s updated %s from %s to %s"
msgid "Ticket %s created: %s"
msgstr "Ticket %s created: %s"
msgid "Change %s created: %s"
msgstr "Change %s created: %s"
msgid "[SOC Case #%s] %s"
msgstr "[SOC Case #%s] %s"

102
locales/es_ES/soc.po Normal file
View File

@ -0,0 +1,102 @@
msgid ""
msgstr ""
"Project-Id-Version: GLPI SOC Case Management Plugin\n"
"POT-Creation-Date: 2025-04-15 12:00+0200\n"
"PO-Revision-Date: 2025-04-15 12:00+0200\n"
"Last-Translator: Your Organization\n"
"Language-Team: Spanish\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "SOC Case"
msgstr "Caso SOC"
msgid "SOC Cases"
msgstr "Casos SOC"
msgid "SOC Dashboard"
msgstr "Panel SOC"
msgid "SOC Case Management Dashboard"
msgstr "Panel de gestión de casos SOC"
msgid "Total Cases"
msgstr "Total de casos"
msgid "New Cases"
msgstr "Nuevos casos"
msgid "Critical Cases"
msgstr "Casos críticos"
msgid "Recent Cases"
msgstr "Casos recientes"
msgid "No cases found."
msgstr "No se encontraron casos."
msgid "View all cases"
msgstr "Ver todos los casos"
msgid "Create new case"
msgstr "Crear nuevo caso"
msgid "Status"
msgstr "Estado"
msgid "Severity"
msgstr "Gravedad"
msgid "Critical"
msgstr "Crítico"
msgid "High"
msgstr "Alto"
msgid "Medium"
msgstr "Medio"
msgid "Low"
msgstr "Bajo"
msgid "New"
msgstr "Nuevo"
msgid "Assigned"
msgstr "Asignado"
msgid "In Progress"
msgstr "En progreso"
msgid "Pending"
msgstr "Pendiente"
msgid "Resolved"
msgstr "Resuelto"
msgid "Closed"
msgstr "Cerrado"
msgid "Technician"
msgstr "Técnico"
msgid "Description"
msgstr "Descripción"
msgid "Case created"
msgstr "Caso creado"
msgid "%s updated %s from %s to %s"
msgstr "%s actualizó %s de %s a %s"
msgid "Ticket %s created: %s"
msgstr "Ticket %s creado: %s"
msgid "Change %s created: %s"
msgstr "Cambio %s creado: %s"
msgid "[SOC Case #%s] %s"
msgstr "[Caso SOC #%s] %s"

102
locales/fr_FR/soc.po Normal file
View File

@ -0,0 +1,102 @@
msgid ""
msgstr ""
"Project-Id-Version: GLPI SOC Case Management Plugin\n"
"POT-Creation-Date: 2025-04-15 12:00+0200\n"
"PO-Revision-Date: 2025-04-15 12:00+0200\n"
"Last-Translator: Your Organization\n"
"Language-Team: French\n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid "SOC Case"
msgstr "Cas SOC"
msgid "SOC Cases"
msgstr "Cas SOC"
msgid "SOC Dashboard"
msgstr "Tableau de bord SOC"
msgid "SOC Case Management Dashboard"
msgstr "Tableau de bord de gestion des cas SOC"
msgid "Total Cases"
msgstr "Total des cas"
msgid "New Cases"
msgstr "Nouveaux cas"
msgid "Critical Cases"
msgstr "Cas critiques"
msgid "Recent Cases"
msgstr "Cas récents"
msgid "No cases found."
msgstr "Aucun cas trouvé."
msgid "View all cases"
msgstr "Voir tous les cas"
msgid "Create new case"
msgstr "Créer un nouveau cas"
msgid "Status"
msgstr "Statut"
msgid "Severity"
msgstr "Sévérité"
msgid "Critical"
msgstr "Critique"
msgid "High"
msgstr "Élevée"
msgid "Medium"
msgstr "Moyenne"
msgid "Low"
msgstr "Faible"
msgid "New"
msgstr "Nouveau"
msgid "Assigned"
msgstr "Assigné"
msgid "In Progress"
msgstr "En cours"
msgid "Pending"
msgstr "En attente"
msgid "Resolved"
msgstr "Résolu"
msgid "Closed"
msgstr "Fermé"
msgid "Technician"
msgstr "Technicien"
msgid "Description"
msgstr "Description"
msgid "Case created"
msgstr "Cas créé"
msgid "%s updated %s from %s to %s"
msgstr "%s a mis à jour %s de %s à %s"
msgid "Ticket %s created: %s"
msgstr "Ticket %s créé: %s"
msgid "Change %s created: %s"
msgstr "Changement %s créé: %s"
msgid "[SOC Case #%s] %s"
msgstr "[Cas SOC #%s] %s"

102
locales/it_IT/soc.po Normal file
View File

@ -0,0 +1,102 @@
msgid ""
msgstr ""
"Project-Id-Version: GLPI SOC Case Management Plugin\n"
"POT-Creation-Date: 2025-04-15 12:00+0200\n"
"PO-Revision-Date: 2025-04-15 12:00+0200\n"
"Last-Translator: Your Organization\n"
"Language-Team: Italian\n"
"Language: it_IT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "SOC Case"
msgstr "Caso SOC"
msgid "SOC Cases"
msgstr "Casi SOC"
msgid "SOC Dashboard"
msgstr "Dashboard SOC"
msgid "SOC Case Management Dashboard"
msgstr "Dashboard di gestione casi SOC"
msgid "Total Cases"
msgstr "Casi totali"
msgid "New Cases"
msgstr "Nuovi casi"
msgid "Critical Cases"
msgstr "Casi critici"
msgid "Recent Cases"
msgstr "Casi recenti"
msgid "No cases found."
msgstr "Nessun caso trovato."
msgid "View all cases"
msgstr "Visualizza tutti i casi"
msgid "Create new case"
msgstr "Crea nuovo caso"
msgid "Status"
msgstr "Stato"
msgid "Severity"
msgstr "Gravità"
msgid "Critical"
msgstr "Critico"
msgid "High"
msgstr "Alto"
msgid "Medium"
msgstr "Medio"
msgid "Low"
msgstr "Basso"
msgid "New"
msgstr "Nuovo"
msgid "Assigned"
msgstr "Assegnato"
msgid "In Progress"
msgstr "In corso"
msgid "Pending"
msgstr "In attesa"
msgid "Resolved"
msgstr "Risolto"
msgid "Closed"
msgstr "Chiuso"
msgid "Technician"
msgstr "Tecnico"
msgid "Description"
msgstr "Descrizione"
msgid "Case created"
msgstr "Caso creato"
msgid "%s updated %s from %s to %s"
msgstr "%s ha aggiornato %s da %s a %s"
msgid "Ticket %s created: %s"
msgstr "Ticket %s creato: %s"
msgid "Change %s created: %s"
msgstr "Modifica %s creata: %s"
msgid "[SOC Case #%s] %s"
msgstr "[Caso SOC #%s] %s"

102
locales/pl_PL/soc.po Normal file
View File

@ -0,0 +1,102 @@
msgid ""
msgstr ""
"Project-Id-Version: GLPI SOC Case Management Plugin\n"
"POT-Creation-Date: 2025-04-15 12:00+0200\n"
"PO-Revision-Date: 2025-04-15 12:00+0200\n"
"Last-Translator: Your Organization\n"
"Language-Team: Polish\n"
"Language: pl_PL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
msgid "SOC Case"
msgstr "Przypadek SOC"
msgid "SOC Cases"
msgstr "Przypadki SOC"
msgid "SOC Dashboard"
msgstr "Panel SOC"
msgid "SOC Case Management Dashboard"
msgstr "Panel zarządzania przypadkami SOC"
msgid "Total Cases"
msgstr "Wszystkie przypadki"
msgid "New Cases"
msgstr "Nowe przypadki"
msgid "Critical Cases"
msgstr "Krytyczne przypadki"
msgid "Recent Cases"
msgstr "Ostatnie przypadki"
msgid "No cases found."
msgstr "Nie znaleziono przypadków."
msgid "View all cases"
msgstr "Zobacz wszystkie przypadki"
msgid "Create new case"
msgstr "Utwórz nowy przypadek"
msgid "Status"
msgstr "Status"
msgid "Severity"
msgstr "Ważność"
msgid "Critical"
msgstr "Krytyczny"
msgid "High"
msgstr "Wysoki"
msgid "Medium"
msgstr "Średni"
msgid "Low"
msgstr "Niski"
msgid "New"
msgstr "Nowy"
msgid "Assigned"
msgstr "Przypisany"
msgid "In Progress"
msgstr "W trakcie"
msgid "Pending"
msgstr "Oczekujący"
msgid "Resolved"
msgstr "Rozwiązany"
msgid "Closed"
msgstr "Zamknięty"
msgid "Technician"
msgstr "Technik"
msgid "Description"
msgstr "Opis"
msgid "Case created"
msgstr "Przypadek utworzony"
msgid "%s updated %s from %s to %s"
msgstr "%s zaktualizował %s z %s na %s"
msgid "Ticket %s created: %s"
msgstr "Zgłoszenie %s utworzone: %s"
msgid "Change %s created: %s"
msgstr "Zmiana %s utworzona: %s"
msgid "[SOC Case #%s] %s"
msgstr "[Przypadek SOC #%s] %s"

102
locales/pt_PT/soc.po Normal file
View File

@ -0,0 +1,102 @@
msgid ""
msgstr ""
"Project-Id-Version: GLPI SOC Case Management Plugin\n"
"POT-Creation-Date: 2025-04-15 12:00+0200\n"
"PO-Revision-Date: 2025-04-15 12:00+0200\n"
"Last-Translator: Your Organization\n"
"Language-Team: Portuguese\n"
"Language: pt_PT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "SOC Case"
msgstr "Caso SOC"
msgid "SOC Cases"
msgstr "Casos SOC"
msgid "SOC Dashboard"
msgstr "Painel SOC"
msgid "SOC Case Management Dashboard"
msgstr "Painel de gestão de casos SOC"
msgid "Total Cases"
msgstr "Total de casos"
msgid "New Cases"
msgstr "Novos casos"
msgid "Critical Cases"
msgstr "Casos críticos"
msgid "Recent Cases"
msgstr "Casos recentes"
msgid "No cases found."
msgstr "Nenhum caso encontrado."
msgid "View all cases"
msgstr "Ver todos os casos"
msgid "Create new case"
msgstr "Criar novo caso"
msgid "Status"
msgstr "Estado"
msgid "Severity"
msgstr "Gravidade"
msgid "Critical"
msgstr "Crítico"
msgid "High"
msgstr "Alto"
msgid "Medium"
msgstr "Médio"
msgid "Low"
msgstr "Baixo"
msgid "New"
msgstr "Novo"
msgid "Assigned"
msgstr "Atribuído"
msgid "In Progress"
msgstr "Em progresso"
msgid "Pending"
msgstr "Pendente"
msgid "Resolved"
msgstr "Resolvido"
msgid "Closed"
msgstr "Fechado"
msgid "Technician"
msgstr "Técnico"
msgid "Description"
msgstr "Descrição"
msgid "Case created"
msgstr "Caso criado"
msgid "%s updated %s from %s to %s"
msgstr "%s atualizou %s de %s para %s"
msgid "Ticket %s created: %s"
msgstr "Ticket %s criado: %s"
msgid "Change %s created: %s"
msgstr "Alteração %s criada: %s"
msgid "[SOC Case #%s] %s"
msgstr "[Caso SOC #%s] %s"

View File

@ -70,6 +70,9 @@ function plugin_init_soc() {
$PLUGIN_HOOKS['javascript']['soc'] = ['/plugins/soc/js/soc.js'];
$PLUGIN_HOOKS['add_css']['soc'] = ['/plugins/soc/css/soc.css'];
// Initialize translations
$PLUGIN_HOOKS['init_translations']['soc'] = 'initTranslations';
if (Session::haveRight('plugin_soc_case', READ)) {
$PLUGIN_HOOKS['menu_toadd']['soc'] = ['management' => 'PluginSocCase'];
}
@ -88,3 +91,20 @@ function plugin_init_soc() {
]);
}
}
/**
* Initialize plugin translations
*
* @return void
*/
function initTranslations() {
global $CFG_GLPI;
$domain = 'soc';
$locale_dir = GLPI_ROOT . '/plugins/soc/locales/';
if (file_exists($locale_dir)) {
// Load plugin translations
$GLOBALS['LANG']->addTranslationFile('gettext', $locale_dir, $domain, $_SESSION['glpilanguage']);
}
}