Skip to Content

Fiori Launchpad Plugin internationalization/translation

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 18, 2018 at 08:27 AM

    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


    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • Posted on Oct 03, 2018 at 02:46 PM

    Hello Istvan

    did you find a solution for your problem?

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

  • Posted on Oct 10, 2018 at 09:38 AM

    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!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.