I have a string let's say " my name is %@ and i study in class %@" now I want to bold the placeholder text which i will be inserting , so that the result will look something like this:" My name is Harsh and i study in class 10" and i will display it on a label
I have already tried using NSAttributedString but since the string will be localised i am not able to use the range parameter of attributed string to make it bold.

There are different ways to do so, but in my opinion, one of the easiest way would be to use tags:
Use tags around the placeholders (and other parts if needed):
Tags can be HTML, Markdown, BBCode, or any custom you'd like, then, replace the placeholder values:
Now, depending on how you want to do it, or which tag you used, you can use the init of
NSAttributedStringfrom HTML, Markdown, etc, or simply usingNSAttributedString(string: localized), look yourself for the tags and apply the render effect needed.Here's a little example:
Output: