Overview
Provides a function that loads a properties file from Appian Document Management and returns a dictionary of labels and values.
How to i18n your Form:
Key Features and Functions
Functions:
I ran into the issue with the first line on the translation file not loading if the file is encoded as UTF-8-BOM instead of just UTF-8. Hope this helps.
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!
Any messages in the logs? I won't get a chance to look at this until next week.
Mike Cichy 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!
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
Are resource bundles once loaded cached in memory or are they reloaded with each call to load the bundle? Would it be a best practice to create smaller bundles for features, one bundle per application or one bundle across all applications?
@josephs646 Do you wrap the output with something else? Is your file encoded with something else other than UTF-8? The plugin is obviously designed to handle different languages, just wanted to verify the basics before I dig in through the code.
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