cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ToddCorley
Level 2

External Bundles

Trying this a second way since my first message did not get posted:

I am trying to read an external bundle with no luck.

Is there a way to get IA to log more verbose information? In my output file I see "Loading externalized properties", but I don't know if it is reading files I specified on the "Project -> Locales" tab.


In the attached test project the property file contains the following entries:
Test.Value1=The first Value
_ai.Test.Value2=The second Value


I created a CustomCodePanel that only tries to print localization keys.

@Override
public boolean setupUI( CustomCodePanelProxy ccpp )
{

this.ccpp = ccpp;
System.out.println( ccpp.getVariable( "$INSTALLER_LOCALE$" ) );

String key1 = "Test.Value1";

//Referencing an External Resource Key
String key2 = "$Lbundle.Test.Value1";
String key3 = "$L{bundle.Test.Value1}";

//Internationalizing Custom Code
String key4 = "Test.Value2";
String key5 = "_ai.Test.Value2";
String key6 = "bundle.Test.Value2";
String key7 = "_ai.bundle.Test.Value2";

printValues( key1 );
printValues( key2 );
printValues( key3 );
printValues( key4 );
printValues( key5 );
printValues( key6 );
printValues( key7 );
return false;
}

private void printValues( String key )
{
System.out.println( "\n\n*******************************" );
System.out.println( "Key: " + key );
System.out.println( "CustomCodePanelProxy.getValue: " + ccpp.getValue( key ) );
System.out.println( "CustomCodePanelProxy.getVariable: " + ccpp.getVariable( key ) );
}


And I get this result in the output file:
ChooseBundledVMs: Unable to locate the VMPack Directory
Loading externalized properties
en


*******************************
Key: Test.Value1
CustomCodePanelProxy.getValue: null
CustomCodePanelProxy.getVariable: null


*******************************
Key: $Lbundle.Test.Value1
CustomCodePanelProxy.getValue: null
CustomCodePanelProxy.getVariable: null


*******************************
Key: $L{bundle.Test.Value1}
CustomCodePanelProxy.getValue: null
CustomCodePanelProxy.getVariable: null


*******************************
Key: Test.Value2
CustomCodePanelProxy.getValue: null
CustomCodePanelProxy.getVariable: null


*******************************
Key: _ai.Test.Value2
CustomCodePanelProxy.getValue: null
CustomCodePanelProxy.getVariable: null


*******************************
Key: bundle.Test.Value2
CustomCodePanelProxy.getValue: null
CustomCodePanelProxy.getVariable: null


Any suggestions?
Labels (1)
0 Kudos
(3) Replies
jhechter
Level 3

Hi Tod,

I am having the same issue. If i user $L{bundlename.key} on one of there exsiting panels it works. But if I try to access key from my custom bundle
using getValue it doesn't work

There documentation for accessing external keys is really bad since it really doesn't deal with custom panels

NOT HAPPY but you already feel the pain!
0 Kudos
jhechter
Level 3

Hi Tod,

Here is how it works. User subsitute instead of getValue(). I finally got fed up
and opened a defect this what they gave me. I tested it and it worked.

TPCInstallResource1 - Name of the bundle

str = ccpp.substitute("$L{TPCInstallResource1.daemonLabel}");
System.out.println("TPCInstallResource1.daemonLabel = " + str);
str = ccpp.substitute("$L{TPCInstallResource1.userID}");
System.out.println("TPCInstallResource1.userID = " + str);
str = ccpp.substitute("$L{TPCInstallResource1.password}");
System.out.println("TPCInstallResource1.password = " + str);
//SRAInfoDesc

str = ccpp.substitute("$L{TPCInstallResource1.SRAInfoDesc}");
System.out.println("TPCInstallResource1.SRAInfoDesc = " + str);
0 Kudos