Hi everyone, I'm using Chronoform's multilingual system, but I'm having an issue with the syntax when trying to include variable data within a string to be translated. For example, I want to write something like
'hello {data:name} thanks for writing...
',
and I tried writing it as
{l:hello {data:name} thanks for writing...}
,
but it's not working. Can someone tell me what the correct syntax is for this case?
Thank you in advance for your help and support!
I also tried using a %s placeholder with the syntax
{l:hello %s thanks for writing...|{data:name}}
,
but it's not working. The output only shows a single closing curly brace '}'
.
Thank you, but I was hoping to find a more dynamic solution rather than having to create a series of translations.
I think for long strings with variables inside you better do it with output buffering:
The event switcher will check the active language and display a different message with different translated content, and the output buffer will capture the whole output of the message and return it inside a variable: {var:translated_message}
BUT, you need to wait for the next update to be able to use the new shortcode {str:locale} OR you can get it now in PHP as $this->locale, you can return it as a variable and use {var:php_action_name} for the switcher
new update is out!