I don't understand your problem. As far as I can tell, you want a function to which you pass a string, it tries to look it up in a database to find a translation, and if it can't find it, it returns that original string. Where is the problem, given that the funciton was passed the information it needs in the first place? What did I miss?