Firstly, this moodlelib.php hack smells and I would suggest not to do such things. The only reliable and supported way is to have proper locale installed on the server.
Secondly, is there a chance that the old hardcoded arabic string got actually saved into the database? Where exactly are you seeing it? If it is somehow stored in the database and displayed from it, it would explain why you still see the old text even after reverting the code.
I am not aware of any cache that might affect this. But again, it depends on how many hacks like this are actually there on the site. Can't help much here, sorry.