cancel
Showing results for 
Search instead for 
Did you mean: 

How to get fiori launchpad language inside a custom application ?

0 Kudos

Hi All,

When i log on to fiori launchpad selecting a DE as language and then through tile of custom app i navigate to the my custom ui5 application i do not get the language DE due to which my application does not translate to the desired language.

Using this sap.ui.getCore().getConfiguration().getLanguage() it gives me en as the language and using jquery jQuery.sap.getUriParameters().get("sap-language") it give me null.

Please let me know how can i translate my custom ui5 app to the desired language in fiori launchpad.

Regards,

Rachna Bhati

rakesh2901
Participant
0 Kudos

Hi Rachna,

Did you get solution of this problem, I am facing the same issue. I am using 1.8 library.Can you tell me your custom app version??

Please reply if you found solution.

Regards

Rakesh

rakesh2901
Participant
0 Kudos

sorry I mean I am using 1.28 UI5 version.

Regards

Rakesh

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member596543
Discoverer
0 Kudos

Hi Rakesh,

There are some standard texts in the application as well, like the Calendar legends that would display in the language selected on the Fiori launchpad. We would not be able to change/hard-code texts for such controls. Yes, for the other input controls, I could hard code, but not for the standard texts. 😞

Regards

Stephanie

former_member596543
Discoverer
0 Kudos

Hi,

I am having an issue which is related to the language change. My users have an option to select the language on the Launchpad logon page. For example he selects German, the application tiles load in German language. But there are certain applications within the launhcpad, which need to load in English, no matter what the user has selected. Is there a way we could restrict or bypass the language parameter only for certain applications of the launchpad?

I was thinking if I could probably get the current language parameter once the user opens the application and save it in some model.

sap.ui.getCore().getConfiguration().getLanguage();

Then change the same to the desired language ---> sap.ui.getCore().getConfiguration().setLanguage("EN");

Finally when the user would exit the application, I'd set it back to the original language. Would that work? Is it a good approach?

Please advise.

Thanks & regards

Stephanie

rakesh2901
Participant
0 Kudos

Hi Rego,

If you want only labels to be in English , hardcoding them in english is good option, I mean don't use i18n file.

Regards

Rakesh

abdullahgunes
Participant
0 Kudos

Hi Rachna,

You can use below method for get user language .

sap.ushell.Container.getService("UserInfo").getLanguage()

Follow this page for reference :

https://sapui5.netweaver.ondemand.com/sdk/#/api/sap.ushell.services.UserInfo

junwu
Active Contributor
0 Kudos

is your app running inside flp? or your tile opens a new tab to run your app?

0 Kudos

No, it does not opens a new tab, its inside flp.

saurabh_vakil
Active Contributor
0 Kudos

You can open the Fiori Launchpad (where your app is deployed) with the URL parameter sap-language=DE and the launchpad should automatically be displayed in German. Now if you open your custom app (and provided you have created an appropriate resource bundle file within your project - i18_de.properties to maintain German language specific static texts) you should be able to see the texts translated to German.

Another option to open the launchpad in German language without explicitly specifying the language in the URL via the sap-language parameter is in the Google Chrome browser's Languages settings page move the German language to the top of the languages list.

0 Kudos

Hi Saurabh,

Thank You for your reply.

I have maintained the appropriate bundle file as when i run standalone application it gets translated to German.

I get the parameter sap-language=DE in the url when i select DE at the time of log on but when i am accessing this parameter in my code of my custom application through sap.ui.getCore().getConfiguration().getLanguage() or jQuery.sap.getUriParameters().get("sap-language") i am not getting the language.

saurabh_vakil
Active Contributor
0 Kudos

When you open the Fiori Launchpad, append the parameter sap-language=DE in the URL rather than selecting German from the drop down on the logon page. i.e. open the URL like given below (this way you will automatically have German language set in the language drop down once the logon page loads):

http(s)://<hostname>:<port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-client=<CLIENT>&sap-language=DE

This way the Launchpad should open in German and your custom app should automatically translate static texts in German according to the values maintained in your i18n_de.properties file. There should be no need to retrieve the language in your code and then translate the static texts.

junwu
Active Contributor
0 Kudos

sap.ui.getCore().getConfiguration().getLanguage()

what you get? empty string?

0 Kudos

Tried this way it doesn't works and i would require the language in the code as i need to call a oData service to fetch data based on the basis of language.

0 Kudos

it returns en as the language.

saurabh_vakil
Active Contributor
0 Kudos

In my case even the data fetched from the backend in my custom app shows up in German if I launch the Launchpad in German language. This happens through the RFC connection which connects the front-end with the back-end; the browser language is propagated through this RFC to the backend and backend returns data in the German language. For this to work the language should be left blank in the RFC destination though.