Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
We're going to make a couple of portal components to allow for dynamic language selection of the portal language. Of course, this assumes you have translated your portal content into the appropriate languages! To keep it simple, this example will limit itself to French, English and German, but the logic can be extended.

Because it's going to be graphic based, first find some suitable image files to display to the user. Using Google images and searching for flags gave me the ones I use here:

We need to put these into our developer studio project - I keep mine under dist/images/mimes.

Our first component, which I have called PickLanguage, is used to display the images as anchored links that will then invoke the second component.

Here's the code:

The href string points to my portal component, so if I change the name of the PAR file or component, I need to change this to the appropriate value.

The second component, which I have called ChangeLanguage, sets the user's language and then launches the portal again...

Make an iView that launches the first component and give it to a portal role, and you should be finished.

As a caveat, you must have an environment in which users can change their portal language. If they can't do this, then you need to find another way to achieve the dynamic selection.

Good luck!

21 Comments