Get translation string in PHP

Get translation strings in PHP for external API use.

Overview

The translation placeholder syntax works in templates but not directly in PHP functions.
Use the CF8::parse() method to process translation placeholders and retrieve the actual string value before passing it to external APIs.

Answered
ze zest96 09 Jul, 2025

How can I get {l:STRING) in PHP ?

Though echo "{l:MYSTRING}"); does show the translation, I need it to parse in a function that puts content in Google Doc (API)

Old topics suggest, but it doesn't work

$this->Parser->parse("{l:MYSTRING}");
Max_admin Max_admin 09 Jul, 2025
Answer
1 Likes

in ChronoForms v8:

CF8::parse("{l:MYSTRING}");
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply