Load Resource Bundle

Overview

Provides a function that loads a properties file from Appian Document Management and returns a dictionary of labels and values.

  • Can be used for internationalizing form labels, instructions, etc.  
  • The file is read from the Document Management system of Appian instead of from a specific path on disk
  • Loads the entire file into a dictionary instead of reading one key/value pair at a time
  • Supports complex characters (Chinese, Russian, etc.) by forcing UTF-8 character encoding

How to i18n your Form:

  1. Store your key=value pairs in a properties file as an Appian document for each supported language.
  2. One each SAIL form, load the key=value pairs using one of the plugin functions. 3) On your form, any place you want internationalized text, set the text by indexing into the returned dictionary of bundle data by specific keys.

Key Features and Functions

Functions:

  • loadbundle() load a single bundle resource file which is an Appian document
  • loadbundlefromfolder() load one or more bundle resource files from an Appian folder for a specific locale
Anonymous
Parents
  • I've tried to use this plug-in and working fine for the most part but I've found an issue that I can't seem to resolve within this plug-in:

    inside the properties file I have a row: "caseDetails=DÉTAILS DU CAS"

    when using the loadbundle() function the row is being returned from that properties file as "caseDetails:D�TAILS DU CAS"

    I can replace char(65533) with char(233) when displaying this value. This solution is clearly not perfect since I am needing to assume that the � char should in fact be a É, but the same seems to be true with other accented chars. 

    A more graceful way of handling this is to simply replace this label function/plug-in with:


    if(
    userlocale(
    loggedInUser()
    ) = "fr_FR",
    "DÉTAILS DU CAS",
    "CASE DETAILS"
    )

    Of course there are a number of other ways I could do this (reference data held within a DB, using constants etc) but given that the plug-in suggests it works with complex characters I feel that I am missing something (also this loadbundle function seems to be substantially quicker than retrieving the same number of "translations" through a DB query, so my current preference is to stick with this plug-in)

    Any thoughts?

  • Re: example, the readme file explains the usage, there really isn't much to this other than loading key-value pairs from a file. See playbook page for usage: https://community.appian.com/w/the-appian-playbook/100/application-internationalization

Comment Children
No Data