Skip to end of metadata
Go to start of metadata

Introduction:

One of our clients came up with a requirement wherein they want a webdynpro application which should have a drop-down to select a language. On selection of language, only that WD Application should be running in that language without affecting the portal logon/personalized language.So thought of sharing the solution.

 Requirement:


 

Solution:

One would think this can be achieved using SAP Standard mechanism of Internationalization.

But wait...

Here the client doesn't want to change the portal logon language. The user will select language only for that application and not for all the application. Hence internationalization would not work.So here is the alternative.

Step1:

Add all the texts in all the languages you want to maintain in Message Pool. For e.g. we will maintain 2 languages: English and Chinese
Strictly follow the convention of the key: <language key from portal>_title<number>





Step2:

Create a Simple type: language. This is for Language dropdown box.
Here also follow strictly the naming convention where Value = Portal Language Key




Step3:

Open the View of Webdynpro Component and create Context elements for holding texts from message pool depanding upon language selected.

Also create the required Layout.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Associate and action with Dropdownbox event onSelect. 

Step4:
Now comes the most important part... coding...
 





Final Step:

Deploy new Archive and Run.
Create Portal View for this WD Application and assign it to a page, then page to a workset and finally workset to a Role.
Give a user this role.
Login to portal with the user having this role.
Default it will display the application in language as of personalized in portal if its maintained in message pool, otherwise by default it will pick English.
Select Chinese from drop down, application will run in Chinese without affecting portal language.

Tips: 

  1. Now in future you want to add support to one more language then you need to add the required language in Simple type Enumeration, add all the title text in that language in message pool.  Deploy new Archive and Run.
  2. Another solution approach is to use properties file which is easier to maintain if more languages needs to be added in future (Thats the part II- Comming Soon)