How to translate modal parameters in Angular

Recently, I was looking for the best techniques to write clean and optimize my Angular code. I have gone through a lot of articles, and as we know, it is limitless. Then I thought of consolidating the checklist with different basic Angular topics which helped me and might help others too in the future.

Image for post

These small articles not only help you to write a better and clean Angular Code but also clear the concepts of front-end technologies. This will help you to build your strong base and can help you in the upcoming frontend interviews.

Let’s discuss the most common topic translations. We do support translations in our Angular applications. By doing so sometimes we might come across situations where we need to translate multiple parameters that are dependent on each other? How we can translate parameters for dynamic values?

Let’s see the scenario first.

Scenario: I am using some dynamic values to create a string and sending that to the sweetalert2 configuration. There are a lot of ways we can translate the title text before passing it to sweetalert2 but it is getting difficult when we have dynamic values in the title itself.

I have added the below solution which solves our issue.

#angular #programming #technology

How to Translate Dynamic String Values In Angular
1.40 GEEK