The names of Backoffice cockpits (or perspectives), that are displayed on mouse hover, can be localized. This short tutorial describes how to achieve that.
Context
You are able to define localization labels for the name of your Backoffice cockpit (perspective).
Procedure
- First, define the name of your perspective that you would like to have displayed on mouse hover in the yourextension-backoffice-widgets.xml file, like this:
demoextension-backoffice-widgets.xml
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.hybris.com/schema/cockpitng/widgets.xsd">
<widget-extension widgetId="backofficeMainSlot">
<widget id="demoextension-perspective" widgetDefinitionId="com.hybris.demoextension.backoffice.widgets.demoextensionwidget"
template="false" slotId="perspectives" title="demoextension.perspective.name">
<!-- More settings -->
</widget>
</widget-extension>
<!-- more code -->
</widgets>
- Now, define the appropriate localization keys for the cockpit name with the com.hybris.backoffice.perspectiveChooser prefix. In the yourextension/resources/yourextension-backoffice-labels/labels.properties directory, add the entry similar to the following:
demoextension/resources/demoextension-backoffice-labels/labels.properties:
com.hybris.backoffice.perspectiveChooser.demoextension.perspective.name=The name you want to give to the cockpit
- Define more labels for other localizations in the same directory: yourextension/resources/yourextension-backoffice-labels, for example:
labels_fr.properties
com.hybris.backoffice.perspectiveChooser.demoextension.perspective.name=Mon nom de cockpit localisée (fr)
- Redeploy the application by calling ant clean all and restart the server by calling hybrisserver.bat (Windows) or ./hybrisserver.sh (Unix).
Now, when you hover your mouse over the cockpit icon, the name is displayed as per the defined localization keys.