A little emberrassing, but the solution was simply renaming the file wpsmessages-zh_CN.mo
to wpsmessages.mo
following my own file name conventions.
Basically the structure of my PHP project using gettext is like this:
/locale/pt_BR.utf8/LC_MESSAGES/wpsmessages.mo
/locale/zh_CN.utf8/LC_MESSAGES/wpsmessages.mo
...
So using bindtextdomain("wpsmessages", dirname(__FILE__) . "/locale");
gets the correct .mo
file for a locale specified by setlocale()
, but it couldn't find the file as it's name was wrong.
Hope this helps anyone being as stupid as me. :)