I am currently using i18n to translate strings and I'm looking for a way to attach a variable onto the path.
This variable could be about 8 different values and each need a different translation. My locale files already include the translations but I don't know how to add my variable onto the translation path. I don't think variable interpolation helps me here.
content.state //variable
t ('.state') //locale path
I'm looking for a way to add the content.state variable to the end of the locale path so that it translates depending on what content.state is. Currently my only solution is a large if/else covering all the states.
Solved: I was trying to find a way to add a variable to the locale path inside handlebars and ended up using the concat helper.
{{ t (concat "state." content.state)}}