{"id":1007,"date":"2013-06-05T18:36:28","date_gmt":"2013-06-06T04:36:28","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=1007"},"modified":"2013-06-05T18:36:28","modified_gmt":"2013-06-06T04:36:28","slug":"theme-localization","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/theme-localization\/","title":{"rendered":"Theme Localization"},"content":{"rendered":"
Wodpress theme localization seemed like an easy task. \u00a0And while all the info was there, I ran into several hiccups.<\/p>\n
This piece of open source software seems like a great tool for localization until it doesn’t work. \u00a0For me, it didn’t read the source files correctly. \u00a0If the _ or _e functions were not at the start of a line it did not pick it up. \u00a0So my results were always empty until I moved one of the functions to the start of the line.<\/p>\n
PoEdit doesn’t allow \u00a0you to edit. \u00a0Normally this is fine, but not good if the source files aren’t read correctly.<\/p>\n
<\/p>\n
This tool saved the day for me, but not without problems of it’s own. \u00a0The scanner apparently looks for the closing PHP tag “?>”. \u00a0In one of my files I had no closing tag so it didn’t work for me. \u00a0In another file I had it did have the closing tag, but it wasn’t at the end of the file so not all translations were picked up.<\/p>\n
In the end I just edited my PHP file to not have the closing PHP tags or if there were a lot, I just edited the po file manually. \u00a0After having that set I opened up PoEdit and created the .mo binary. \u00a0What a pain.<\/p>\n
<\/p>\n
The docs say to use languageCode_CountryCode.mo. \u00a0This is not true. \u00a0In your theme, just use languageCode.mo.<\/p>\n
<\/p>\n