Friday, October 30, 2015

Webcenter Portal Language Translation using Resource Bundle

Webcenter Portal supports Resource Bundle with xlf file for specific portal. We can upload the resource bundle for entire portal and for specific portal also.


In the below section, I am following the Resource Bundle update for specific portal. Login to the webcenter portal and go to the administration for the specific portal.




Initially we can export the Portal resource bundle to local machine.

$cd Oracle_Fusion_Middleware_Home/ oracle_common/common/bin/

Example:-

$cd /oracle/fmw/oracle_common/common/bin/


wls:/offline> connect('weblogic','weblogic password','t3://hostname:7001')
exportMetadata(application='webcenter',server='WC_Spaces',toLocation='/u01',docs='/xliffBundles/SpacesSeedDataOverrideBundle.xlf,/oracle/webcenter/translations/scopedMD/<SCOPE_ID>/scope-resource-bundle.xlf')

Example

[oracle@webcenter /oracle/fmw/oracle_common/common/bin]$ ./wlst.sh
wls:/offline> connect('weblogic','welcome1','t3://webcenter.oracle.local:7001')

wls:/webcenter/serverConfig> exportMetadata(application='webcenter',server='WC_Spaces',toLocation='/u01',docs='/xliffBundles/SpacesSeedDataOverrideBundle.xlf,/oracle/webcenter/translations/scopedMD/ seed5002f_ac77_4d9a_be61_fe3369d004d1/scope-resource-bundle.xlf')
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)
Executing operation: exportMetadata.
Operation "exportMetadata" completed. Summary of "exportMetadata" operation is:
List of documents successfully transferred:
/oracle/webcenter/translations/scopedMD/seed5002f_ac77_4d9a_be61_fe3369d004d1/scope-resource-bundle.xlf
/xliffBundles/SpacesSeedDataOverrideBundle.xlf

2 documents successfully transferred.
wls:/webcenter/serverConfig>

Once the files are downloaded, we receives “scope-resource-bundle.xlf” file. Make a copy of the files and change the name to scope-resource-bundle_en.xlf and scope-resource-bundle_ar.xlf files.

scope-resource-bundle_en.xlf
<trans-unit id="SCOPEGUID: seed5002f_ac77_4d9a_be61_fe3369d004d1:p_attach">
<source>Attachments</source>
</trans-unit>

scope-resource-bundle_ar.xlf
<source>المرفقات</source>
</trans-unit>

Once files are updated, please copy the files in to the server file for importing it into the Webcenter Portal. 

importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/u01',docs='/oracle/webcenter/translations/scopedMD/ seed5002f_ac77_4d9a_be61_fe3369d004d1/scope-resource-bundle.xlf')

importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/u01',docs='/oracle/webcenter/translations/scopedMD/ seed5002f_ac77_4d9a_be61_fe3369d004d1/scope-resource-bundle_en.xlf')

importMetadata(application='webcenter',server='WC_Spaces',fromLocation='/u01',docs='/oracle/webcenter/translations/scopedMD/ seed5002f_ac77_4d9a_be61_fe3369d004d1/scope-resource-bundle_ar.xlf')

Once the scripts are loaded successfully, we gets the message that document transferred successfully. It is advisable to restart the Webcenter spaces managed server. After that , we can open the portal and can use the below expression for translation.


#{o_w_f_t_TranslationsRBBean[' SCOPEGUID: seed5002f_ac77_4d9a_be61_fe3369d004d1:p_attach ']}