I have language files named en.json and ru.json where I define the variables. For example:
levelUpMessage: "Congratulations on your new ${level}"
However, since JSON doesn’t allow backticks, what should I do to avoid using a simple string?
I have language files named en.json and ru.json where I define the variables. For example:
levelUpMessage: "Congratulations on your new ${level}"
However, since JSON doesn’t allow backticks, what should I do to avoid using a simple string?
U can use a libraray like i18next
or intl
for language support. they offer ways to format strings in different languages n help you manage transaltions. U load the JSON data, then use these libs to handle dynamic content. try this, it should help .