cancel
Showing results for 
Search instead for 
Did you mean: 

Options to pass language to UI5 Applications

Former Member
0 Kudos

All:

We use NON-SAP Portal as an entry point/employee facing portal where all applicaitions(SAP & NON-SAP) presented to the employee as a tiles. We have provisoned an employee with an option to chose their choice of language during the runtime at the Portal Level. For example, As an employee, I have the ability to switch between languages between  EN & FR and vice veras and we don't want to update language selection of the employee to business suite systems. 

Based on the language selction of the employee on the portal, We need to load & translate the applicaitons in the selected language. What are the mulitple options avaiable for this case to pass the language parameter to UI5 applcations.

1. Can Language be set in the Cookie Like MYSAPSSO2 and SAP-UserContenct?

     I have tried this option where SAP-UserContext is set with Lanaguage and Client. However, UI5 applicaiton consuming these cookies weren't able to      pick up the language from the cookie instead Language is picked up from browser.

    

2. Passing the language as URL parameter like sap-language=FR / EN. What are the downsides to this option to use in Production. I prefer to avoid passing the value as URL parameter to avoid visibility to end users on the language selection and potential overwrite.

What are your thoughts on this options. 

3. Consider Browser language as the default language. This option doesn't work since we do share systems to access enterprise applications and chaging the browser language effects other employees who may/may not know how to change back the language to Default per region and in turn increage support calls.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member183518
Active Participant
0 Kudos

You can define the language in the global config object before bootstrapping SAPUI5.


window["sap-ui-config"] = {

  language : "FR",

  };

Using the Global Configuration Object for Configuration - User Interface Add-On for SAP NetWeaver - ...

Former Member
0 Kudos

Thank you Sakthivel for addgin code snippet to define language in global config object. How do you get language value from NON-SAP Portal where the language was selected by an Employee.

Do you suggest passing language as URL parameter? like sap-language=FR?

former_member182372
Active Contributor
0 Kudos

it is not

sap-language=FR

but

sap-ui-language=fr

as i showed your earlier

former_member182372
Active Contributor
0 Kudos

SAPUI5 SDK - Demo Kit

language

Type: string

Default value: user language

URL: Yes

Modifiable at runtime: No

This configuration parameter defines the language that shall be used for localized texts, formatting, and so on.

The default value is not static, but determined from the browser or user language in the following order:

  1. navigator.language
  2. navigator.browserLanguage
  3. navigator.userLanguage

SAPUI5 SDK - Demo Kit

The URL parameter name is composed of the name of the configuration option and the

sap-ui- prefix.



Former Member
0 Kudos

Thanks Maksim for sharing your thoughts. However, I think navigator options provided are taken up from Browser where as browser language could be different to language choice of the employee selected at the portal level.

I am looking for options to pass language selcted by an employee at the portal to SAP UI5 applications.

former_member182372
Active Contributor
0 Kudos

SAPUI5 Explored

works for me