Need a special offer?Find out if your project fits.
+

how localization custom button title in angular2+?

Answered
mostafa asked on October 29, 2020

 tabs.unshift({
          id: "fm-tab-newtab",
          title: "Save report",
          handler: saveSlice,
          icon: this.icons.save
        });

i want to translate the lable "Save report" when the language change.

7 answers

Public
Milena Pechura Milena Pechura Flexmonster November 2, 2020

Hello, Mostafa,
 
Thank you for posting to our forum and for providing the code snippet.
 
Taking into account your case, we would like to suggest two approaches: the first one to redefine the Flexmonster label (e.g. "save"), second - to add a new label to our list.
 
1. To redefine one of the Flexmonster labels, please set the new value in the localization object. Here is an example for illustration: http://jsfiddle.net/flexmonster/51f7mqju/. Please note that we have also defined the new handler for the tab in the customizeToolbar function.
 
2. To add the new label to the component labels list, our team suggests the approach shown in the following sample: https://jsfiddle.net/flexmonster/q2rgvLhq/.
We updated the Toolbar with the new expand_all label and set the title of the tab correspondingly. After configuring the new label, we defined the localization for it.
 
For further details about localization in Flexmonster, please see this article.
 
Please let us know if our recommendations work for you and if any other questions arise.
 
Best regards,
Milena

Public
Milena Pechura Milena Pechura Flexmonster November 11, 2020

Hi, Mostafa,
 
We were wondering if our response helped you with your question.
Could you please let us know whether one of the suggested approaches works for you?
 
Looking forward to hearing from you.
 
Kind regards,
Milena

Public
Milena Pechura Milena Pechura Flexmonster November 18, 2020

Hello, Mostafa,
 
We are just checking in to ask if you have found our response helpful.
Please let us know if you have managed to translate the label.
 
Our team would be glad to hear your feedback.
 
Best regards,
Milena

Public
mostafa December 1, 2020

Hi Milena Pechura,
thank you for responding, yes i am happy for your responding, but the translate issue not working, i will check it again and i will tell you.
 
 
Regards.
Mostafa almomani | software engineer.

Public
Milena Pechura Milena Pechura Flexmonster December 2, 2020

Hello, Mostafa,
 
Thank you for giving an update on your progress.
 
Our team has prepared an Angular sample showing both previously mentioned approaches to localize the label. We have attached it as an archived project.
 
To open the example, please follow these steps:

  1. Download the attachment.
  2. Go to the project directory.
  3. Run npm install, then npm start. The application will be automatically opened in the browser.
  4. Click on the "Customizing the Toolbar" button in the navigation bar. You will see the sample we have prepared for you.

 
The code of the example is located in the pivot-angular\src\app\examples\customizing-toolbar directory. We recommend checking the .ts and .html files of this folder.
 
Please let us know if everything is clear and if the provided example works for you.
 
Best regards,
Milena

Attachments:
pivot-angular.zip

Public
Milena Pechura Milena Pechura Flexmonster December 15, 2020

Hi Mostafa,
 
How are you?
 
We would like to kindly take an interest in whether you had a chance to check our response.
Did the Angular example help to solve the issue with localization?
 
Looking forward to hearing from you.
 
Kind regards,
Milena

Public
Milena Pechura Milena Pechura Flexmonster December 24, 2020

Hello, Mostafa,
 
Hope you are doing well.
 
Our team was wondering whether the provided Angular example helped.
Could you please let us know if the issue with localization is solved?
 
We will be glad to hear your feedback.
 
Best regards,
Milena

Please login or Register to Submit Answer