cancel
Showing results for 
Search instead for 
Did you mean: 

REG: Session language in application

Former Member
0 Kudos

Dear All,

I have a req where I need to capture to session language for displaying data in an WD application....

If the session lang is Arabic.. I need to send that u201CARu201D as a parameter to RFC to fetch the data...

If the session lang is English... I need to send the u201CENu201D as a parameter to RFC to fetch the data...

Let me know how I can achieve this.

Regards,

Vijay.

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi,

use the following code to get the language of the session:

java.util.Locale locale = WDClientUser.getCurrentUser().getLocale();

This will return the locale for the session. pass this locale string to the RFC.

Regards,

Poojith MV

Former Member
0 Kudos

Dear Poojith,

The above code is giving the preferred language of the browser.. but not the session language.

I need the language being maintained in the session.

Regards,

Vijay.

former_member214651
Active Contributor
0 Kudos

Hi,

Yes, the above code will give u the language of the Browser of the Language of the user who logs into the portal. Assume the Browser language is english and the language of the user in User Administration is Arabic, then this code will give arabic over english.

Please give some more details on what r u trying to achieve in ur application

Regards,

Poojith MV

Former Member
0 Kudos

Dear Poojith,

The following is my senario:

Users log in to the Portal where default language is English. The iViews Master language is English.

There is a button in the TLN which switches the Portal display language into Arabic. The text direction is from right to left..The iViews are replaced by a new set of iViews whose master language is Arabic. This is achieved by customizing the TLN and DLN par files.

I need to fetch the transactional data from RFC based on the language the Portal is currently in.

Here I'm trying to send the session lang as input to RFC to fetch the data in appropriate language.

Let me know how I can capture the session language.

Let me know if there is better way to achieve the same.

Regards,

Vijay.

Former Member
0 Kudos

Hi,

Did you try the following code:


WDResourceHandler.getCurrentSessionLocale().getLanguage()

Hope this helps.

Regards,

Manoj

Former Member
0 Kudos

Dear Manoj,

Solved..! Thanks.

Regards,

Vijay.

Answers (0)