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
  • Overall, this has been a great plugin but we ran into a strange error the other day. For whatever reason, the first key in this particular bundle localization file seems to be added as a string (rather than a key) to the resulting dictionary (test case 2 - viewing the expression). When we try to index() the value from the strange key, it returns a null (test case 2 - indexing the key). If the first line is a blank line, it seems like the plugin adds an empty string as the dictionary key with an empty value (test case 1).

    I've built an app to reproduce the issue and highlight these test cases. As a workaround, we've simply added an empty first line before the key/value pairs. I looked through the bundle file in a text editor and haven't been able to identify any strange characters either. If someone has an answer as to what is causing this behaviour, it would be greatly appreciated. Thanks! Relaxed

    Test Case 1: 

    Test Case 2 - Viewing the expression: 

    Test Case 2 - Indexing the "hello" key: 

    Test Case Appian App: /cfs-file/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-bae752e8-2344-43c9-8f1e-a06bbcf919a8/Appian-i18n-Bug-Test-Case.zip

  • Any messages in the logs? I won't get a chance to look at this until next week.

Comment Children
  • Nope, no messages at all in the logs and the loadbundle() function does still return a dictionary. It just seems like the first line isn't behaving correctly. No worries at all, let me know what you find whenever you get the chance. Thanks in advance! Slight smile