- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Not able to read a key from external resource Bundle in project file
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Not able to read a key from external resource Bundle in project file
Hi Experts,
I just started working with IA few days back.
I am looking for help in reading a key from external resource bundles. I have defined external resource bundles as follows:
<property name="externalResourceBundles">
<object class="java.util.Vector">
<method name="addElement">
<object class="com.zerog.ia.installer.util.ExternalResourceBundle" objectID="4f263018a577">
<property name="bundleName">
<string><![CDATA[custom]]></string>
</property>
<property name="resourcePath">
<string><![CDATA[$IA_PROJECT_DIR$\i18n\custom_en.properties]]></string>
</property>
</object>
</method>
<method name="addElement">
<object class="com.zerog.ia.installer.util.ExternalResourceBundle" objectID="52c45c7ba646">
<property name="bundleName">
<string><![CDATA[custom]]></string>
</property>
<property name="resourcePath">
<string><![CDATA[$IA_PROJECT_DIR$\i18n\custom_fr.properties]]></string>
</property>
</object>
</method>
</object>
</property>
In the same project file, I have entries like below to display strings:
<property name="bundlesTitle">
<string><![CDATA[Choose Install Set]]></string>
</property>
which I would like to read from external resource bundles for I18N support.
My resource bundle custom_en.properties file contains key as below (so as resource bundles for other locales)
ChooseInstallSetAction.ba0ea906bcf1.bundlesTitle=Choose Install Set
What is the right way to use the key from resource bundle so that multiple locales can be supported.
The product documentation doesn't seems to be helping much.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @sajith,
Thank you for your post.
Just to clarify, we do not support directly modifying the project XML at all without using InstallAnywhere itself.
Here is a link to documentation with more specifics about using an external resource bundle:
https://community.flexera.com/t5/InstallAnywhere-Knowledge-Base/Creating-Adding-and-Referencing-External-Resource-Bundles/ta-p/3427
Or is that the documentation you were referring to?
Thanks,
Ian
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I'll agree here that the documentation regarding external resource bundles is lacking. We also use external bundles that we used to use in ISMP. Our "bundles" are also just <BundleName>_lang.properties files that have nothing but key-value pairs.
STRING_KEY_1=Welcome
STRING_KEY_2=another string
Any time you want to use a localized string, use the syntax $L{<BundleName>.STRING_KEY_1} . We use this for both strings used in custom code and in the project file when naming/describing install sets, features, etc. So, if your bundles are named custom_lang.properties and you named the bundle CustomStrings, you would refer to the string as $L{CustomStrings.ChooseInstallSetAction.ba0ea906bcf1.bundlesTitle}
Note: I'd be worried about using periods in your string keys, given that the period is used to split the key from the resource bundle name. @Revenera_Ian , how do you handle keys with periods?
p.s. Trust me, don't try to work with the project xml by hand, flexera made IA project files more convoluted than you could ever imagine. ISMP project files were so straightforward but IA ones make no sense. Maybe this is by design, I don't know.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)