Support » Plugin: Loco Translate » System file is loaded before custom file

  • Resolved yomela

    (@yomela)


    Hi there,

    I am using your translation plugin already for a while. Thank you very much for this great plugin. I really like it as it is very handy and easy to use.

    But I do have one problem since a while → I have some plugins that of a sudden „create“ system-translation files additionally to the author files that existed right from the beginning. Those system-files haven’t actually been there when I first startet creating custom files for customizing translations.

    I already studied your documentation carefully and as recommended I do have all my translations saved in the „Custom“ folder at  “wp-content/languages/loco/”

    BUT although I read in your manual that it is always the custom file loaded first those „new“ files in the system-folder are actually always loaded before my custom files.

    I even started to delete the newly created system files and in consequence my custom files are loaded again BUT those system files are actually automatically recreated after at the latest 24 hours (without initiating any manual updates).

    Do you have any idea what could have happened that those newly created system files are loaded before my custom files? Do you have any little advise or hint for this? I would appreciate it so much.

    Thank you very much in advance.

    Best regards

    Ariadne

    • This topic was modified 9 months, 1 week ago by yomela.

    The page I need help with: [log in to see the link]

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

    (@timwhitlock)

    those „new“ files in the system-folder are actually always loaded before my custom files.

    It could be that your plugin is loading them directly without going through the proper WordPress l10n functions. I am guessing here because I would need to see the code that bootstraps the translation files.

    Hi Tim,

    thank you very much for your fast answer.

    When I get it right, the plugin does not load translations as plugins are supposed to do normally?

    It’s actually the modern tribe event plugin .

    Are you by pure chance already familiar with the conflixt with this plugin?

    Best regards

    Ariadne

    • This reply was modified 9 months, 1 week ago by yomela.
    Plugin Author Tim W

    (@timwhitlock)

    Can you provide an example string which demonstrates the behaviour you are reporting?

    Hi,

    of course. See f.ex. the blue button text “Get Tickets” at https://yomela.de/event/visionen-ziele-2020/

    I translated it as

    Custom file -> “Tickets kaufen (CUSTOM)”
    System file -> “Tickets kaufen (SYSTEM)”

    and it shows up the system file translation.

    Plugin Author Tim W

    (@timwhitlock)

    I can’t find any such string in the events calendar plugin.

    Sorry, the mentioned string is actually part of this event plugin https://wordpress.org/plugins/event-tickets/

    Plugin Author Tim W

    (@timwhitlock)

    And what do I have to do to get this string appearing on my screen? To debug this for you, I need to reproduce the problem.

    Hi Tim,

    I just realised that the “get ticket” translation is part of the free “event tickets” plugin but it is only displayed after activating the premium “event tickets pro” version.

    But I found another string, that can be reproduced with the free event plugins by modern tribe.

    You could for ex. have a look at the string “out of stock” of the “Event Tickets” plugin.

    It’ll appear on your screen after the following steps

    – install + activate “The events calender” + “Event Tickets”
    – create a new event
    – add a rsvp (Tickets -> + New RSVP) and set the capacity to 0
    – publish and view the event

    After customizing the translation of “Out of stock” in the system file of the “Event Tickets”-Plugin it will be displayed instead of the custom file translation.

    I hope I got you right and this is what you were asking for. Thank you so much for your help and time.

    Best regards

    Ariadne

    • This reply was modified 9 months, 1 week ago by yomela.
    Plugin Author Tim W

    (@timwhitlock)

    Yes, I can reproduce this.

    I think the reason in this example is that the event-tickets plugin accesses its translations too early. It does so before Loco Translate is loaded, so it can’t do anything about it.

    how bad 🙁 but thanks a lot anyway for having a closer look and checking my issue.

    Just one last question: Does this mean that your initial assumption (It could be that your plugin is loading them directly without going through the proper WordPress l10n functions.) was correct?

    Because I would like to know how to communicate/explain the issue as precise as possible to the modern tribe support.

    Could you tell me what exactly the event plugin has to change/fix?

    Best regards and thanks a lot in advance

    Ariadne

    Plugin Author Tim W

    (@timwhitlock)

    They’re not obliged to fix anything, but this may help explain:

    https://localise.biz/wordpress/plugin/faqs/custom-folder#step4

    Hey Tim,

    thank you very much. You helped me a lot!

    Have a nice day. Best regrads, Ariadne

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘System file is loaded before custom file’ is closed to new replies.