cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sajith
Flexera beginner

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.

0 Kudos
2 Replies
Flexera Flexera_Ian
Flexera

Re: Not able to read a key from external resource Bundle in project file

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-Exte...

Or is that the documentation you were referring to?

Thanks,

Ian

0 Kudos
wtuckerhcl
Occasional contributor

Re: Not able to read a key from external resource Bundle in project file

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. @Flexera_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.