Skip to main content

Localizing the Strings

Localizing the Strings

To localize the strings:

  1. Export the Message Dictionary to one or more XML files. To do so, do the following in the Terminal:

    1. Change to the namespace in which you are using Business Intelligence.

    2. Identify the output file and its location:

       SET file="C:\myLocation\Messages.xml"

      The specified directory must already exist; the system does not create it.

    3. Run the export command:

      • It may be practical to export only those messages in a particular domain:

         DO ##class(%Library.MessageDictionary).ExportDomainList(file,"myDomain")

        The domain names are case-sensitive.

      • Or, to export all the messages in the namespace:

         DO ##class(%Library.MessageDictionary).Export(file)
  2. For each desired language, make a copy of the message file.

  3. Edit each message file as follows:

    1. Edit the Language attribute of the root element:

      <MsgFile Language="en">
      

      Change this to the language name of the desired language.

      This must be an all-lowercase language tag that conforms to RFC1766Opens in a new tab (so that a user can choose the preferred language in the browser from the standard set). This tag consists of one or more parts: a primary language tag (such as en or ja) optionally followed by a hyphen (-) and a secondary language tag (so that the result has the form en-gb or ja-jp).

      For example:

      <MsgFile Language="es">
      
    2. Scan the file to find the <MsgDomain> element that corresponds to the appropriate domain:

      <MsgDomain Domain="myDomain">
      

      If you exported only one domain, the file contains only one <MsgDomain> element.

    3. Within this section, edit the value of each message. For example, change this:

           <Message Id="2372513034">City</Message>
      

      To this:

           <Message Id="2372513034">Ciudad</Message>
      
  4. Import the edited message file or files. To do so:

    • To import a single file:

       SET file="C:\myLocation\myfile.xml"
       DO ##class(%Library.MessageDictionary).Import(file)
    • To import all the files in the same directory:

       SET myFiles="C:\myLocation"
       DO ##class(%Library.MessageDictionary).ImportDir(myFiles,"d")
  5. Optionally use the Management Portal to verify that the message dictionary has been updated. To do so, switch to the appropriate namespace, select System Explorer > Globals, and then click View Globals for the ^IRIS.Msg global.

    Within this global, you should see a new set of subscripts that correspond to the language you have added.

  6. In your browser, find the setting that controls the language that it requests for use on localized pages. Change this setting to the language that you specified in the edited message file.

    Depending on the browser, you might need to clear the browser cache, restart the browser, or both.

  7. Access the Analyzer and validate that you see translated strings.

For more information on the utility methods in %Library.MessageDictionaryOpens in a new tab, see the class reference for that class or see String Localization and Message Dictionaries.

FeedbackOpens in a new tab