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.