'How to change string value dynamically with string interpolation for a string loaded from json file

I have 3 json files for translations. I want to translate this message: "ERROR_MESSAGE": "Verification failed, %s tries left.".

I am using sprintf package, and when I load the string it doesn't change the value dynamically. The % sign shouldn't be escaped, so it would work in my opinion.

sprintf(loadedString, [remainingTries]);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source