TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Feature : Interpolate Strings

Open Suryac72 opened this issue 1 year ago • 2 comments

Description: Added a function to replace string inside { } with dynamic field values.

Use-case: This method helps when we use language translation in our application and want to replace dynamic values in our translated message

Example : Hello {name}, your age is {age} Output: Hello John Doe, your age is 30.

Suryac72 avatar Oct 05 '23 14:10 Suryac72

Hi @appgurueu @raklaptudirm please review this PR also once you free

Suryac72 avatar Oct 12 '23 15:10 Suryac72

Hi @appgurueu, I used this algo for injecting dynamic text in my email and messaging notifications usecase in my current project. This helps when our message is dependent on more than one language translations so that we can inject user details in our messages and email template translations.

this was the reason I contribute this small approach

Suryac72 avatar Oct 12 '23 17:10 Suryac72