[SOLVED] How to translate text when there is a variable inside

I am struggling with translating a text in which a variable is inside. I am using sprint_f() for it:
 

$email = testemail@live.nl;
notices::add('success', language::translate('email_confirmation', sprintf('A link is sent to %s',$email)));

This is how it is stored in translations:

email_confirmation -> A link is sent to testemail@live.nl

I was expecting that the translations looked like:

A link is sent to %s

How can i achieve this?

Hello,
you can try this:

$email = 'testemail@live.nl';
notices::add('success', sprintf(language::translate('email_confirmation', 'A link is sent to %s'),$email));

Found the correct one that works:

$email = $_POST['email'];
notices::add('success', sprintf(language::translate('email_confirmation_sent1', 'A link is sent to %s'),$email));

The translation function should be inside the sprint_f() function!

Dit topic is gesloten wegens langdurige inactiviteit. Erop posten is niet mogelijk.
Bekijk de code op GitHub