cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Launchpad Plugin internationalization/translation

istvanherman
Explorer
0 Kudos

Dear All,

I have a requirement to add a new button to the Fiori Launchpad's Me section. I started to implement a FLP Plugin and it works fine except one thing: I do not find the way how to use the i18n files.

For example I have the button called "User settings" and I want that if the user logon in German language then he/she see "Benutzereinstellungen".

I have the same problem on the opened fragment but I suppose if we solve the first issue I got the solution for the second one also.

My current solution is the hardcoded version but it's not enough good:

rendererPromise.then(function (oRenderer) {
				oRenderer.addActionButton("sap.m.Button", {
					id: "userSettingsButton",
					icon: "sap-icon://user-settings",
					text: "User settings",
					press: function () {
						if (!this._userSettingFragment) {
							this._userSettingFragment = sap.ui.xmlfragment("com.flp.plugin.fragments.UserSettings", this);


						}


						this._userSettingFragment.open();
					}
				}, true, false, [sap.ushell.renderers.fiori2.RendererExtensions.LaunchpadState.Home]);

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Hello Istvan

I was finally able to resolve this issue. Look at my code snippet especially line 21 and 27:

The first thing you do is to get the resource boundle and save it in a variable. It is also important that you do that before the renderer function in order to get the right context from "this". After that you can easily access all texts from this variable as shown in the image above. I hope this helps!

Best regards,
Blazenko

istvanherman
Explorer
0 Kudos

Hi Blazenko,

Yes, I have also found that solution but unfortunately that only partly solution from my point of view because I call a popup with this button:

So I just figured out that I will use the same IDs on my fragment definition and in i18n and on this way I can set text "dynamically" with an array and a for cycle. Unfortunately it is necessary because I could not reach i18n files from my fragment anyhow.

So my result right now (without data):

BR, Istvan

Answers (2)

Answers (2)

0 Kudos

I was not able to find a better solution, too. I will probably do the same as you did: Take the browser language and then set the appropriate text in the buttons. Thank you for your reply!

0 Kudos

Hello Istvan

did you find a solution for your problem?

istvanherman
Explorer
0 Kudos

Hello,

No, unfortunately I don't have any good solution for that. The only way I could handle that I set every text to their object one by one with:

sap.ui.getCore().byId("elementId").setText();

Not the best solution but better than nothing. If you find a better solution please share it with us.