Reply To: Plugin translation

#4853
Mark
Keymaster

    Hi Arturas,
    Thank you very much for posting here. I hope others may benefit from this great question. The short answer is yes … I think.

    The longer answer is that WordPress has moved its translation capabilities from the POT (portable object template) , PO (portable object), and MO (machine object) files to polyglots. Since WordPress 4.6 came out, translations now take translate.wordpress.org as priority, and so plugins that are translated via translate.wordpress.org do not necessary require load_plugin_textdomain() anymore … which leads to all the POT, PO, MO stuff. You can read all the gory details one can stand here https://make.wordpress.org/meta/handbook/documentation/translations/. (If you understand it, please let me know how it works. 🙂 )

    I’ve chosen to use this technology, because it’s the way WordPress is going for core, themes, and plugins, and because a lot smarter people than me have thought this through and implemented it. (The core team really is very good.) SO, while older plugins like MSTW Schedules & Scoreboards have the POT and PO files, the old technology, newer plugins like MSTW Bracket Builder do not, they use the new technology.

    Now we get to the rub. SO while the premium version of MSTW Bracket Builder source code is “translation ready”, the plugin is not in the WordPress.org plugin directory (because it’s not free). The best I understand things, I can’t use the WordPress polygots technology for it. Therefore I will have to generate a .POT file for it (using POEdit), add it to a /lang directory, and add a load_plugin_textdomain() call. Then you, and other users, can create translations for it, set WP_LANG environment variable for the translation, and away you go. (You are the first one who has asked.)

    I have added this to “the list”. I am currently in the throws of a BIG MSTW League Manager plugin upgrade, so I’m not sure when I will get to it. If you need it by a specified date, please contact me via e-mail outside this forum, and we can discuss getting it done.

    Hope this makes some sense and helps some.

    Regards,
    -Mark