Is it somehow possible to use template literals in...
# suitescript
w
Is it somehow possible to use template literals inside of translation strings? Could I put
Copy code
My teststring ${variableName} in the translation
in the translation object and it would be interpreted as a template literal?
went with replace(/\$\{a\},myVariable)
m
Can't you use parameters in the translation string? E.g. set the string to
"Hello {1}"
and
translation.get({ ... })({ params: ["Tomas"] });
will output
"Hello Tomas"
.
👍 1
1
w
I can? Ok, that sounds better. Will look into that instead. 😀
Works great! Also works through translation.Handle-objects. translationCollections.myCollection.MY_STRING({params:['Tomas']})