• Resolved peterforensys

    (@peterforensys)


    Hello there!

    I installed Loco Translate and tried to translate the strings in the cookie banner like the “Always active” text near the cookie categories. I found it in Loco and translated it in there, but the string still in english.

    I tried the early loading fix what is written here: https://localise.biz/wordpress/plugin/faqs/custom-folder

    But there is still no success.

    What else should I try? I need to use the custom method in Loco so to not lose the translations by an update…

    Thanks in advance,
    Peter

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    The translation files can be in several places:

    – wp-content/languages/plugins
    – wp-content/languages/loco
    – wp-content/plugins/complianz-gdpr/languages

    Most likely you have edited one of those, while your system is loading another. For specific help with Loco Translate you can check the Loco Translate forum, as they will know more about how Loco Translate works.

    Hope this helps!

    Thread Starter peterforensys

    (@peterforensys)

    Hello!

    In wp-content/languages/plugins there is no any translation file of Complianz. (This is the “System” location in Loco)

    In wp-content/plugins/complianz-gdpr/languages I have only the .pot template file. (This is the “Author” location in Loco)

    In wp-content/languages/loco/plugins I have the complianz-gdpr-hu_HU.po file cause I selected the custom location of loco for the translation but it won’t load as I said.
    (This is the “Custom” location in Loco)

    I think this is nothing to do with Loco Translate as I use it for another plugins and it works great.

    I noticed that the translation only loads from the “System” location (wp-content/languages/plugins)

    If I choose “Author” the translations still won’t load like when I choose custom location.

    For now I use the “System” location (wp-content/languages/plugins) and I make a backup about the translation as not to lose them.

    Regards,
    Peter

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    Hi @peterforensys,

    It seems that Loco Translate needs an additional line of code to be able to use custom files:

    load_plugin_textdomain( 'complianz-gdpr' );

    As WordPress doesn’t need this for the translations, it wasn’t missed before. As adding it doesn’t seem to break anything, I’ll add it to the test queue. If no issues are found by the testers it will get merged in one of the coming updates.

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    You can use use this branch if you want to update beforehand:
    https://github.com/Really-Simple-Plugins/complianz-gdpr/tree/load-plugin-text-domain

    Tim W

    (@timwhitlock)

    To clarify – Loco Translate doesn’t strictly require “load_plugin_textdomain” although that is recommended.

    Custom files should be found with just in time text domain loading, as long as this doesn’t happen too early.

    There are lots of points of possible failure. I’m happy to look at specifics for open source plugins, but I need to get the string appearing on my screen to debug it, which means I need steps to reproduce.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Loco Translate can not translate the cookie banner’ is closed to new replies.