Localizing document descriptor files

The document template descriptor files remain in the main doctemplates folder, and you edit them there. Descriptor files are XML-based files that conform to the specification defined in file document-template.xsd. To view document template descriptor files in Guidewire Studio for PolicyCenter, navigate in the Studio Product window to the following location:
  • configuration > config > resources > doctemplates

The descriptor file defines context objects, among other items. Context objects are values that PolicyCenter inserts into the document template to replace defined symbols. For example, PolicyCenter replaces <%=Subject%> in the document template with the value defined for the symbol Subject in the descriptor file.

Example

For example, in the base configuration, PolicyCenter provides an XML definition for the AccountEmailSent template descriptor associated with the AccountEmailSent document content template. The descriptor file defines a context object for the Subject symbol. You can define as many context objects and associated symbols as you need. You can add elements that localize the template for any languages supported by your system.

<?xml version="1.0" encoding="UTF-8"?>
<DocumentTemplateDescriptor 
      id="EmailSent.gosu.htm" 
      description="Record of an email being sent"
      ... 
      keywords="CA, email">
                                                
  <DescriptorLocalization language="languageCode" name="localizedName"
        description="localizedDescription" />

  ...
                                                  
  <ContextObject name="Subject" type="string">
    <DefaultObjectValue></DefaultObjectValue>
    <ContextObjectLocalization language="languageCode" display-name="localizedName" />
    ...
  </ContextObject>

  ...
                                                  
</DocumentTemplateDescriptor>

XML elements to localize

Localizing a template descriptor file requires that you localize a number of items in the file. The following list describes some of the main items that you can localize in a descriptor file.

Element

Attribute

Description

<DocumentTemplateDescriptor>

  • keywords

Localize the keywords associated with this template to facilitate the search for this template in the PolicyCenter search screen.

<DescriptorLocalization>

  • language
  • name
  • description

Subelement of <DocumentTemplateDescriptor> – Enter a valid GWLanguage value for language, such as gw.i18n.ILocale.LANGUAGE_EN_US, which uses the language typecode en_US. The language typecode must be defined in the LanguageType typelist. See also, Setting regional formats for a block of Gosu code.

You can also localize the name and description of this template as it appears in PolicyCenter.

<ContextObjectLocalization>

  • language
  • display-name

Subelement of <ContextObject> – Enter a valid GWLanguage value for language. See the previous description for more information.

You can also localize the name of this template as it appears PolicyCenter.

To localize a document template descriptor file, add the appropriate <DescriptorLocalization> and <ContextObjectLocalization> subelements to the file.

Important: There is only one copy of each document template descriptor file. Do not create additional copies in locale folders. Instead, add localization elements to the descriptor files in the doctemplates folder.