I'm working on come code that uses Smarty for templating. I have a php function that creates an array of strings, and this function is called from a Smarty { } block. Within that Smarty block I need to separately translate each string in the array (using |@translate) and then join/combine the elements of the array into a single comma-delimited string. I'd prefer to do this in a compact way.
So, for example, if I have a php array containing ["Hello", "beautiful", "world"] and the translation is to French then the output string should be "Bonjour,beau,monde".
I'm sure this is simple but I'm new to php/smarty and I'm struggling to find a compact way to do this. I'd appreciate some help. Thanks!