Trying to make changes to page (post/article) text just before they are rendered
I can't help with the code, but could you use the String Overrides module for this?

Features:

Easily replace anything that's passed through t()
Locale support, allowing you to override strings in any language
Ability to import/export *.po files, for easy migration from the Locale module
Note that this is not a replacement to Locale as having thousands of overrides can cause more pain then benefit. Use this only if you need a few easy text changes.