Fix for resource files with the same name crash ResourceBasedTextResource

Updated ResourceBasedTextResource logic

It will not track resources using their full name to avoid
name collisions. It will also apply a right-to-left matching
when figuring out which resource to use to look up the
provided key.

Fixes #1028