Syntax to get translation string in php ( {l:STRING} in PHP )

How to retrieve a translation string in PHP within ChronoForms.

Overview

The issue occurs when trying to use translation syntax directly in PHP code, which is not processed.
Use the parser's parse method to correctly interpret and return the translation string.

Answered
ChronoForms v6
mo monochrome 12 Feb, 2020
Hi,

how is the right syntax to get a translation string from Chronoforms6 in PHP?

Unfortneatly this doesn't work:

{l:MYSTRING} ---> $this->l("MYSTRING","default value");
$this->get("MYSTRING", "default");

Thanks in advance,
Thorsten
he healyhatman 12 Feb, 2020
Answer
1 Likes
At the worst you could do
$this->Parser->parse("{l:MYSTRING}");
mo monochrome 13 Feb, 2020
Hi healyhatman,

thanks for your answer!
Works like a charm!

Thanks,
Thorsten
This topic is locked and no more replies can be posted.