Support » Plugin: Tweet Blender » [Plugin: Tweet Blender] Language files are not loading

  • Thank you for adding localization to Tweet Blender!

    However, the language files do not load for me.

    For all my plugins, I need to load the language files at init to get them to work. That could be because I have multilingual sites using a language switcher plugin to choose the display language, not just a localized site.

    I modified Tweet Blender as follows to get the files to load:
    Line 31 tweet-blender.php
    function tb_lang_init() {
    load_plugin_textdomain(‘tweetblender’, false, dirname(plugin_basename(__FILE__)) . “/lang/”);
    add_action(‘init’, ‘tb_lang_init’);

    Could you add this change? it should not affect anyone negatively.

    A tip from copied below explains quite nicely why the init load is needed.

    Load the Domain at the Right Time

    For plugin localization to work at all, a plugin must load the .mo file by calling load_plugin_textdomain at some point. However, many plugins load it too soon. It’s a good idea not to call load_plugin_textdomain any sooner than the WordPress “init” action event, so that the plugin will work with other internationalization plugins, plugins which might be doing things that need priority. In the following example, “myplugin” defines a function that is executed at the “init” event:

    function myplugin_init() {
    add_action(‘init’, ‘myplugin_init’);

  • The topic ‘[Plugin: Tweet Blender] Language files are not loading’ is closed to new replies.