Sidebar

Using iTop

Creating your iTop

iTop Customization

"How to" examples
DataModel

User Interface

Automation & Ticket management

Portal Customization

(Re-)Define dictionary entries

Prerequisite: You must be familiar with the Syntax used in Tutorials and have already created an extension.

learning:
Change a label for a field, a button, a menu,...
level:
Beginner
domains:
Dictionary, XML
min version:
2.1.0

Goal

With this tutorial you will learn how to modify a label displayed somewhere in iTop and create new dictionary entries.

Check the reference for understanding Dictionary entries naming conventions

with the Designer

Dictionary Editor

All the dictionary entries can be edited globally using the tab “Dictionary” under the main tab “Editors”:

Dictionary Editor default screen

Search is case sensitive!

Use the form to search for the dictionary entries to be edited. You can search on the code of the entry (for example Class:Person) or its content, or both. If both criteria (code and content) are supplied, only entries matching both criterias are displayed.

For each entry matching the search criteria, several text input areas are displayed, one for each language enabled for your licence. Should you need more languages, please contact Combodo support to have them enabled for your licence.

Modify entries

Dictionary Edition Modify

To apply your modifications to the dictionary, either press the validation mark next to each modified entry, or use the “Apply All” button at the top.

To prevent the loss of modifications, the “Search” button is disabled as long as there are modified entries. To re-enable it, either apply or cancel all modifications.
When an entry does not exist in the dictionary, it is displayed as an input area with a yellow background. If you supply a value and press apply, the entry will be created. Be cautious since the current version of the editor does not support deleting an entry, and depending on the type of entry, an empty string may not produce the same result as an non-existing entry.

Missing translation

You can now search for entries which would not be translated:

Dictionary missing translation

New entry

If the dictionary entry you are looking for, does not exist (for example a new entry from the XML portal) then you can create it with the “New” button.

Dictionary Editor New

Again to prevent loss of on-going modification, the “New” button isn't displayed as long as you have modified entries.

Dictionary Editor New Popup

If you enter a unique entry code which exist already, your entries will overwrite the existing one without warning
Check the entry code naming conventions before adding new entry code

Delete/Remove entry

If you want to delete/remove an entry:

  1. you just have to search for them,
  2. select the one to delete,
  3. press the button.


with an iTop Extension

Modify an XML entry

You want to change an iTop label.

First things to do is to find its code.

For generic labels, check those files your-itop/dictionary/en.dictionary.itop.xxx.php, where xxx is:

  • ui for labels used in the User Interface (UI)
  • core for labels of field types and generic objects such as: History, Trigger-Action, DataSynchro, BulkExport,…

For a label related to a Datamodel class, its code will be in your-itop/datamodels/2.x/xxx/en.dict.xxx.php where xxx is the module name which handle that class.

Once you have the code, you just need to redefine its value in a extension, as described below.
Note the _delta=“redefine” to replace the existing value and the _delta=“force” if you are not sure that there was previously an entry for that code.

In this example we will suppose that in your iTop, the “Requestor” of a UserRequest, should be called Beneficiary, so here is how to do this:

itop_design / dictionaries
    <dictionary id="EN US" _delta="must_exist">
      <entries>
        <entry id="Class:UserRequest/Attribute:caller_id" _delta="redefine">
          <![CDATA[Beneficiary]]>
        </entry>
        <entry id="Class:UserRequest/Attribute:caller_id+" _delta="force">
          <![CDATA[Choose the client person who will get the requested service]]>
        </entry>
      </entries>
    </dictionary>
The second entry, with the same code completed by a plus sign correspond to additional information, displayed for Attribute as a tooltip when moving your mouse over the field in read mode
The caller_id is a field of the Ticket class, but the above entry was made on UserRequest class, as a result on other Ticket sub-classes such as Incident or Change, this field will still be labelled Requestor.

New XML entry

Note the _delta=“define” to create a new entry, it will fail if that entry already exist.

itop_design / dictionaries
    <dictionary id="EN US" _delta="must_exist">
      <entries>
        <entry id="Class:Team/Attribute:dashboard" _delta="define">
          <![CDATA[Overview]]>
        </entry>
      </entries>
    </dictionary>
Here we created an entry in the english dictionary.
Replace EN US by FR FR for French labels.

Duplicate the XML structure if you want to defined labels for multiple languages.

Check here for ISO country values. iTop supports any language, but natively includes only a few.

More on iTop translation

Using dictionary files

Instead of defining dictionary entries in XML, you may define them in php file, one per language. See here for an example of this method

latest/customization/add-dictionay-entry.txt · Last modified: 2024/09/10 10:25 by 127.0.0.1
Back to top
Contact us