You should not translate database contents with poedit. You would do that inside the database. The short answer: what you want cannot be achieved, unfortunately.
You can translate "fixed" strings and if you want to get variables, constant or database values translated, you have to do that via literal string translations, in the case poedit has to scan them:
<?php
if($var === 'foo') {
echo $this->translate('foo');
} else {
echo $this->translate('bar');
}
It's easier if you have a 1:n relation with a Translation
object. The view would then pull the translation from user generated content:
<?php
echo $foo->Translation['en-us']->bar;
An example of this last possibility is provided in the Gedmo doctrine extension: https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/translatable.md