Support » Plugin: Loco Translate » Translation of addons from the LearnPress plugin

  • Dear friends, I am writing to tell you a problem that is happening to me and I do not know how to solve it.
    I have the “LearnPress” plugin, whose translation file learnpress.po I have saved in System. That’s right.

    https://www.useloom.com/share/741b497c87134e3ea6b424bb9c59a88c

    The problem arises when I want to translate the addons of this plugin that has the same developer.

    They have put the same tex-tomain to all the addons, but the .pot translation files are independent.

    If I leave those files in the Author folder, the translation does not work.

    If I try to change the translated files to the System folder, having the same name as the translation file of the main plugin (learnpress.po) will overwrite it and delete the main translation.

    I have contacted the developer of the plugins suggesting that they put each addon a different text domain so that they are not overwritten … and they respond to me and that as they have it right now, they have to have all the same name … But I can not get it to work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tim W

    (@timwhitlock)

    I don’t see the author’s reply to you, but what they’ve done is against WordPress best practice.

    There are various ways you could hack your way away around this, but I don’t know what your technical abilities are.

    1. One option is to generate your own POT file that contains all strings across the whole text domain. That would require doing string extraction, which normally is the author’s role and there’s no guarantee it won’t raise new problems.

    You’d do this by adding the source file locations of all the add-ons within the main LearnPress bundle. Then extracting the entire “learnpress” text domain into your own custom POT file, and create all your Spanish translations from that.

    2. Another option would be to fix it at code level. You could override the file slug in each add-on bundle and use WordPress filters to manipulate the loading of the MO files, so they point at your custom names.

    See Advanced Configuration:
    https://localise.biz/wordpress/plugin/manual/bundle-config

    If these options are too technical, your best bet is to pursue your line of enquiry with the author. WordPress dictates in no uncertain terms that plugin text domains should be unique. Good practice dictates that the text domain should be the “slug” of the plugin.

    Thank you very much for your answer.
    I was convinced that it was not correct what the developer said, but so many times he said he was wrong that made me seriously doubt.
    I will keep in touch with them to solve it.
    Thanks again for your time

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Translation of addons from the LearnPress plugin’ is closed to new replies.