0

Add support for translatable Dashboard items

Eduardo de Oliveira 2 months ago updated 2 months ago 1

Hello,

The function to add a new dashboard (as seem in GLPI-Inventory plug-in and on GLPI-core itself) seems to assign the "name" in English, but on GLPI Core, it seems to assign the Dashboard name based on the current GLPI user language during install into ``glpi_dashboards_dashboards`` DB.

It would be great if GLPI could provide a way for plug-in and core classes to create translatable Dashboard names. I was able to translate a name if it's in English by adding ``$dashboard['name'] = __($dashboard['name']);`` into the foreach loop of ``getAll()`` function of ``Dashboard`` class, but it would require that the name of the Dashboard is saved in English on DB and to provide a way to ensure that the translation would be gathered by Transiflex since the translation happens on the fly instead of hardcoded, and as since the Transiflex bot doesn't extract those kind of strings, it would not detect the current Dashboard names as translatable as it is.

It could use a similar translation support as GLPI "Dropdowns".