Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 4 replies, has 2 voices.

Last updated by Mateus Getulio 1 year, 3 months ago.

Assisted by: Mateus Getulio.

Author Posts
April 15, 2024 at 7:39 pm #15521672

eranH-3

Tell us what you are trying to do?

I added a custom cookie consent banner to the footer.php of my theme, I can't find it in string translation

Is there any documentation that you are following?

Is there a similar example that we can see?

<div class="overlay" id="cookieConsentModal" style="display:none;"><div class="modal"><h2>Before You Continue</h2><p>Here at News by AI, we value your privacy and strive to enhance your reading experience. To do this, we use cookies in the following ways:</p>

  • Ensure Reliability and Security: We utilize cookies to monitor for disruptions and safeguard against spam, fraud, and other threats.
  • Understand Our Audience: Cookies help us measure engagement and analyze how our services are utilized, enabling us to tailor your experience more effectively.

<p>By consenting to our use of cookies, you're helping us improve our service and your browsing experience.</p><div class="modal-footer"> Privacy Policy <button class="accept-btn" onclick="if (!window.__cfRLUnblockHandlers) return false; acceptCookies()" data-cf-modified-97ae5706e9af48b833fcaf0b->Accept</button></div></div></div><script src="https://cdn.wpml.org/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="97ae5706e9af48b833fcaf0b-|49" defer></script><script defer src="hidden link" integrity="sha512-euoFGowhlaLqXsPWQ48qSkBSCFs3DPRyiwVu3FjR96cMPx+Fr+gpWRhIafcHwqwCqWS42RZhIudOvEI+Ckf6MA==" data-cf-beacon='{"rayId":"874dc000ed433981","version":"2024.3.0","token":"2e50b021709a4bd48c3b9467c06f5a58"}' crossorigin="anonymous"></script>

What is the link to your site?

hidden link

April 16, 2024 at 2:19 pm #15526276

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

In summary, you can register that string and scan your theme. Then the html will become accessible for you to translate inside String Translation.

We have a step-by-step guide here with a lot of details explaining this process: https://wpml.org/documentation/support/translating-the-theme-you-created/

WPML works with gettext to retrieve the texts, you can use the fuction _e('string', 'string-domain') to echo it out and register that to a domain, or the function __('string', 'string-domain') if you're only assigning the string in the code without echoing it out in that very moment, please check more here: https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/

As long as you register the strings to a domain, when you scan your theme for strings in WPML -> Theme and plugins localization(https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#scan-the-theme-or-plugin), WPML will add that string to the String Translation

Please give it a try and let me know if you find any issues in the process.

Best,
Mateus

April 17, 2024 at 4:22 am #15528991

eranH-3

Hey Mateus,

Thanks for the help,

I scanned my theme but I still can't find it, can I speak to you over live chat in the morning, please?

April 17, 2024 at 3:47 pm #15533863

eranH-3

Kor
11 : 46 : 26
it looks like my colleague is handling your ticket. Could you write a short message on the ticket explaining that a support agent is currently taking over this on chat?

April 17, 2024 at 4:04 pm #15533919

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I'm glad to know that you were able to connect to us via chat and this issue is being worked on.

If you manage to find a solution in chat, may I kindly ask you to close this ticket to avoid duplicates?

Thank you, please let us know.
Mateus