In POEDIT, It seems that the code analyser removes any PHP comments before parsing the code.
This means that any translation that are not found in a PHP comment (// or #) or Documentation Block ( /* */) are skipped.
Is there any solution to includes them and make it detectable?
Here is an example of what I'm trying to do:
class One{
public static $enum = array(
'0' => 'No', // _('No')
'1' => 'Yes' // _('Yes')
);
}
I would like POEDIT to detect "// _('No')"
Then after, I could translate like this "echo _(One::$enum[0]);"
Thanks for any further replies :)
Carl.
-- EDIT -- Finally, after 3 years, I think I found a solution quite easy. Because the static variable is public, I can populate it youtside the class:
One::$enum = array(
'0' => _('No'),
'1' => _('Yes')
);
class One{
public static $enum = array();
}
What do you think about this solution?