VMware {code} Community
maxpaynebupt
Contributor
Contributor

vsphere web client 6.7's plugin can not load the .properties resource file

Before 6.7, we can place the properties file under webapp/locales, then web client load the plugin, it can find the proper properties file according to the locale value, but now, this mechanism seems not to be working any more. 

The only way is set the resource file name  and then place the resource file without locale in the name to the locales.

Just like the sample custom-object-ui, all the other samples are not working now.

 

<resources  baseUrl="locales/">   <resource>com_vmware_samples_customobject</resource></resources>
Reply
0 Kudos
6 Replies
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

Here is how to declare localization resources in your plugin.xml

<resources  baseUrl="locales/">   <resource>com_samples_myplugin</resource></resources>

 

Then you should have "locales" folder in your .war bundle where you should place your properties files. For example:

- com_samples_myplugin.properties (default properties bundle which is used when an unsupported locale is set)

com_samples_myplugin_de_DE.properties

com_samples_myplugin_fr_FR.properties

 

Regards,

Denis

Reply
0 Kudos
maxpaynebupt
Contributor
Contributor

Thank you, denis,  it seems only read the default properties file, as I have the locale set to en_US, and have the en_US.properties file under locales folder.
Reply
0 Kudos
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

 

I have deployed some sample plugins on a 6.7 environment and it seems the localization is working fine on my side.

In order to investigate the issue, can you share more information about the client and version that you are using. 

 

Any information about the client (build/version/type), about the plugin used (Flex/HTML/Hybrid) or any logs will help us.

 

Regards,

Denis

Reply
0 Kudos
maxpaynebupt
Contributor
Contributor

Hi, sorry for wrong information, we are using vSphere Client version 6.6.3.150,  we have a old plugin which is hybrid coded. U can get the samples from https://labs.vmware.com/flings/vsphere-html5-web-client, the samples are not working except custom-object-ui which is using the default properties file.
Reply
0 Kudos
Denis_Chorbadzh
VMware Employee
VMware Employee

Hi,

 

I remember having some issues with the localization which were addressed in the next versions of the vSphere Client.

As a workaround for this version, can you try using a different browser or inserting "?locale=en_US" as a parameter in the URL and see if this helps.

Reply
0 Kudos
maxpaynebupt
Contributor
Contributor

Thank you, we choose to use the default properties file, adding locale to the js need more adaptation work.
Reply
0 Kudos