• Resolved robbiet63

    (@robbiet63)


    Hi,

    Great plugin! I just installed it on my multisite network and it is exactly what I’m looking for. There’s just one problem: it is not translating my plugin translation files. All other files translate just fine: e.g. files such as fr_FR.po/fr_FR.mo, admin-fr_FR.po/.mo, network-admin-fr_FR.po/.mo all translate.

    But files such as “myplugin-fr_FR.po” and “myplugin-fr_FR.mo” are not being translated. These files were being translated prior to installing your plugin, using Settings >> General >> Language. But with WCM User Language Switcher (WCM ULS) they are no longer being translated.

    I am using the CodeStyling Localization plugin as well, but I deactivated this to see if there was a conflict and still got the same problem with WCM ULS. (https://www.code-styling.de/english/development/wordpress-plugin-codestyling-localization-en)

    Thanks,
    Rob

    https://www.ads-software.com/plugins/wcm-user-language-switcher/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Franz Josef Kaiser

    (@f-j-kaiser)

    Does this happen to other plugins in your install as well? And how exactly (in code) do you register your translation files? And do you have a link to your plugin?

    Thread Starter robbiet63

    (@robbiet63)

    Good questions. I did find a plugin that has translation files and that is working correctly. (Most do not have translation files.)

    It looks from that like there something in my coding that would be the issue. I will review later this week when I have more time.

    For my plugin I am registering localization as:

    function myplugin_localization() {
         load_plugin_textdomain( 'myplugintextdomain', false, dirname( plugin_basename(__FILE__)) . '/languages/' );
    }

    All text to be translated is wrapped in
    __('Text to translate','myplugintextdomain');
    or
    _e('Text to translate','myplugintextdomain');

    My plugin does not have a link, but I would be happy to send you a login for a subsite.

    Also to note: the language for each template or subsite sets the default for my plugin’s language. Thus, for my French template-site, my plugin shows in French, and when I use WCM ULS it remains in French while all else changes. Similarly, for my English template-site, my plugin’s English version remains in English regardless of how WCM ULS is set. All subsites created from these templates then display the same behaviour.

    Plugin Author Stephen Harris

    (@stephenharris)

    Hi robbiet63. When are you calling myplugin_localization()? Also you mention you are dynamically setting the default language for each network site, can you post the code you are using to achieve that?

    Thread Starter robbiet63

    (@robbiet63)

    Hi Stephen,

    I finally had some time today to look into this. I’m afraid it was my error – I was missing the action call. I’m sorry to take your time.

    Thanks very much,
    Rob

    Plugin Author Franz Josef Kaiser

    (@f-j-kaiser)

    Hi Robbiet63,

    glad to read you figured it out. If you like the plugin, we’d appreciate if you leave us a review.

    Thanks and have a nice weekend!

    Thread Starter robbiet63

    (@robbiet63)

    Done!

    Plugin Author Franz Josef Kaiser

    (@f-j-kaiser)

    Thank you! ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Plugin translation "myplugin-fr_FR.po" not working’ is closed to new replies.