Wiki

Clone wiki

XLIFF Toolkit / Glossary

Glossary

<Table of Content>

The library implements the Glossary module. From a unit, you can call hasGlossEntry() to see if the unit holds one or more glossary entry. A call to getGlossary() will return a Glossary object (even if there are currently no entries). That object holds a list of GlossEntry objects which contains all the information about the corresponding <glossEntry> element in the document.

For example the following code loops through all glossary entries in a given unit and prints the term and each translations for each entry:

#!java
if ( unit.hasGlossEntry() ) {
   for ( GlossEntry entry : unit.getGlossary() ) {
      System.out.println("term: "+entry.getTerm().getText());
         for ( Translation trans : entry ) {
            System.out.println("  translation: "+trans.getText());
         }
   }
}

Updated