Documentation Center

Adding a new translatable error message

Adding a translatable error message allows returning specific errors with localized messages from third-party plugins.

Procedure

  1. Create a new XML file with server errors in the application server directory \InfoShare\App<projectsuffix>\Author\Configuration\.
    We suggest that you choose the file name that indicates the functional area that your errors belong to.
    For example:
    sesConnector.xml
    The XML content of the file should be valid against the schema which is described in the file Resource.xsd that can be found in the same directory.
  2. Create a localized version of the XML file with server errors. The localized file name is the name of the original XML file postfixed with dot followed by the language code.
    Languages currently supported:
    LanguagePostfix
    English.en
    German.de
    Dutch.nl
    Japanese.ja
    You need to create at least the file with the English localization. You don't have to provide the localizations in all the languages we support, but if the localization is not found, we will use the message from the English file.
    For example:
    sesConnector.en.xml
    sesConnector.nl.xml
  3. Add the new message to the file.
    For example:
    <?xml version='1.0' encoding='UTF-8'?>;
    <resourcelib xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='../Resource.xsd' version='1.0'>
        <resource resource='sesConnector' resourceid='TermNotFound' errid='500000'>The tag &quot;{term}&quot; does no longer exist. Please remove the tag.</resource>
    </resourcelib>
    • The value of the resource attribute should indicate the functional area the error belongs to. We suggest that you use the same name as for the file itself.
    • Use the resource id ("resourceid") that is short but descriptive.
    • Use the unique error id ("errid") to avoid collisions.
    • Choose the error id from the range that is higher than 500000 to avoid collisions with the standard errors.
    • Provide the error description that is as specific as possible.
    • Use parameters in curly braces (like "{term}") to provide the placeholders that have to be filled when returning the error.
  4. Add a localized version of the error message to the localized version of the XML file
    For example:
    <?xml version='1.0' encoding='UTF-8'?>
    <resourcelib xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='../Resource.xsd' version='1.0'>
        <resource resource='sesConnector' resourceid='TermNotFound' errid='500000'>De term &quot;{term}&quot; bestaat niet. Verwijder de term.</resource>
    </resourcelib>
    • Use the same values for the attributes ("resource", "resourceid", "errid").
    • Use the same placeholders in the description to be able to properly construct the localized message.
  5. Copy the created files to the server directory\InfoShare\Web<projectsuffix>\Author\ASP\Resources\.