(2017-12-30, 09:44 PM)Whiteneo Wrote: Ok undestand so the right way is using vars instead lang vars
To be clear, there is nothing wrong with assigning values to new properties of the $lang object, but in cases where MyLanguage::sprintf is used, those variables (with the number placeholders, ie. {1}, {2}) should not be overwritten. Instead create a new (unused) property:
foreach ($things as $id => $thing) {
$value1 = $thing->['property1'];
$value2 = $thing->['property2'];
$lang->new_key = $lang->sprintf($lang->existing_key_with_placeholders, $id, $value1, $value2);
echo "<a href=\"url.com\">{$lang->new_key}</a>";
}
(2017-12-30, 09:44 PM)Whiteneo Wrote: Thanks for your time.
You're welcome.

[retired]