Add support for locale object implementing __toString method

If the translatable object have an object as locale property, the listener don't use it. This patch add the support for this feature.