• Resolved p4ssc3

    (@passce)


    Hello, I have a problem with the location of the translation files. If I put my .po and .mo in the “custom” location (in the Loco folder), it ONLY applies if those same files are also in the System folder. I don’t understand, since the custom folder is supposed to be loaded first, why is it only taken into account if there are also translation files in the system folder? Thanks

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

    (@timwhitlock)

    To answer your question I would have to see the code that loads the text domain.

    Thread Starter p4ssc3

    (@passce)

    Okay, how can I show you that ?

    Plugin Author Tim W

    (@timwhitlock)

    A link to download whatever theme/plugin is causing the issue would be useful. Also instructions on how to render an offending string on the screen.

    Thread Starter p4ssc3

    (@passce)

    okay but don’t want to do it in public access here… Do you have an email?.

    Plugin Author Tim W

    (@timwhitlock)

    I only offer to debug other people’s code in public. I don’t provide help examining what’s wrong with closed source or commercial code.

    Thread Starter p4ssc3

    (@passce)

    Ok so I do it here and later I will edit the messagr to remove it.

    All the files of the website (multisite) : https://jchuactif30.fr/wp-content/uploads/sites/15/Fichiers_2022-08-25_ID-EJZHEZ5U01.zip

    Hre you can see the issue : https://cos-mairie-ales.com/
    “No event found!” -> it’s supposed to be french

    thanks

    Plugin Author Tim W

    (@timwhitlock)

    This is a 3G file. I’m not trawling through your whole website. The string presumably comes from a plugin. Just post that plugin please.

    Also, a link to your website doesn’t constitute the instructions I asked for.

    Thread Starter p4ssc3

    (@passce)

    Well i don’t know what plugin is responsable of the bug. Please, I can’t modify my message anymore… “modify” link not there anymore. Can you do that ?

    Thread Starter p4ssc3

    (@passce)

    I just realized what you meant, sorry
    This is the plugin : https://we.tl/t-amqIXeCS57

    Plugin Author Tim W

    (@timwhitlock)

    I’ve had a good look at this. The cause of the behaviour you describe is that under some circumstances your plugin doesn’t load the “modern-events-calendar-lite” text domain. It instead loads a text domain called “mec”.

    This means that automatic (or “just in time”) domain loading is invoked when translations are displayed from the “modern-events-calendar-lite” domain.

    In the case of automatic loading, WordPress checks for installed (system) translations before calling any filterable functions. This means Loco translate can’t override the file that gets loaded. I will add this as a caveat in my FAQ on custom file loading.

    It’s worth mentioning also that your plugin seems to display translations BEFORE it’s attempted to load any, so relying on auto-loading is probably a good idea. For that reason I recommend you simply leave your system file in place. If you’re worried about adding unnecessary overhead loading two files, then ensure the system file is empty.

    I’m marking this as resolved as I believe I’ve found the reason for the error and provided the only solution I can, which is to leave both files in place.

    Thread Starter p4ssc3

    (@passce)

    Okay thank you very much for your help

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Location issue’ is closed to new replies.