Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was unable to find and translate strings from the Ultimate GDPR & CCPA plugin using WPML.

Solution:
1. We recommended following the guides to find strings that don't appear on the String Translation page:
- Ultimate GDPR & CCPA translation guide
- Finding strings in WPML documentation

2. We provided a workaround for a fatal error that occurred, which was resolved by following a solution from another support ticket.

3. We advised the client to add Gettext functions to the code to make the strings available for translation, as per the WPML documentation:
Enabling text translation for themes not compatible with WPML

If the solution provided is not relevant due to being outdated or not applicable to your case, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.

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 8 replies, has 2 voices.

Last updated by Carlos Rojas 8 months, 1 week ago.

Assisted by: Carlos Rojas.

Author Posts
March 21, 2024 at 10:22 am

erkkiM

Translate strings from Ultimate GDPR & CCPA

March 21, 2024 at 10:55 am
March 21, 2024 at 11:14 am #15435853

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Hi there,
This is the ticket where we will continue working on this issue.

Is it possible to deactivate all plugins and activate a default WordPress theme to double-check if the issue disappears?

If the above is not possible, then could you create a staging site with a copy of the live site?

March 22, 2024 at 6:00 am #15438775

erkkiM

its open ticket...
i did but info to MARCH 21, 2024 AT 10:55 AM - acc and passwords info is there.

March 22, 2024 at 7:31 am #15438870

erkkiM

Also here is file you can translate it manually but its not what im looking for.
hidden link

<?php

/**
* functions.php
* Overwrite translations when using TCF modal (Ultimate GDPR & CCPA plugin)
* Add this snippet to your functions.php (theme) or use custom wordpress plugin
* You can customize each translation that is displayed in TCF modal.
* List of partners, purposes, examples, descriptions can't be customized (those are fetched from official site of The Transparency & Consent Framework (TCF) v2.2)
*/

function ct_tcf_custom_translations($translations) {

/**
* Overwrite all strings from main translations
* List of available languages for TCF modal:
* 'en' => 'English',
* 'ca' => 'Catalan',
* 'cs' => 'Czech',
* 'da' => 'Danish',
* 'de' => 'German',
* 'el' => 'Greek',
* 'es' => 'Spanish',
* 'fi' => 'Finnish',
* 'fr' => 'French',
* 'gl' => 'Galician',
* 'hr' => 'Croatian',
* 'hu' => 'Hungarian',
* 'it' => 'Italian',
* 'nl' => 'Dutch',
* 'no' => 'Norwegian',
* 'pl' => 'Polish',
* 'pt_br' => 'Portuguese (Brazil)',
* 'ro' => 'Romanian',
* 'ru' => 'Russian',
* 'sr_cyrl' => 'Serbian (Cyrillic)',
* 'sr_latn' => 'Serbian (Latin)',
* 'sv' => 'Swedish',
* 'tr' => 'Turkish',
* 'zh' => 'Chinese'
*/

$my_custom_translations['en'] = [
"decline2" => "Withdraw to all",
"consentModal" => [
"title" => "Customise Ad Choices",
"tab1_title" => "Ad Choices",
"tab2_title" => "Cookie Preferences"
],
"tab2" => [
"description" => "You can manage your cookie settings for our website. We use different types of cookies to enhance your browsing experience, analyze site traffic, and personalize content and ads. While necessary cookies are always active, you have control over the other categories. Please note that changing these settings may affect your experience on our site.",
"necessaryCookies" => "Necessary Cookies",
"necessaryCookiesDesc" => "These are crucial for the basic operations of our website. They enable core functionalities such as security, network management, and accessibility. As they are essential for the website to work correctly, they cannot be turned off.",
"functionalCookies" => "Functional Cookies",
"functionalCookiesDesc" => "These cookies enable additional features on our website for a more personalized experience. They remember your preferences and settings, like language or location, making your experience more convenient and tailored.",
"analyticsCookies" => "Analytics Cookies",
"analyticsCookiesDesc" => "These cookies help us understand how visitors interact with our website. They collect information about your use of the site, which pages you visit, and how you navigate the site. This data is used to improve the website's functionality and user experience.",
"advertisingCookies" => "Advertising Cookies",
"advertisingCookiesDesc" => "These cookies are used to display relevant advertisements to you. They track your online activity to tailor advertising to your interests. By not allowing these cookies, the ads you see may be less relevant to you."
],
"purposes" => [
"purposes" => "Purposes",
"special_purposes" => "Special Purposes",
"features" => "Features",
"special_features" => "Special Features",
"partners" => "Partners",
"li_partners" => "Partners (Legitimate Interest)",
"cookies" => "Cookie Preferences"
],
"purposeItem" => [
"service" => "service",
"services" => "services",
"details" => "details"
],
"serviceItem" => [
"privacyPolicy" => "Privacy policy",
"legitimateInterestClaim" => "Legitimate Interest claim",
"purposesConsent" => "Purposes (Consent)",
"purposesLegitimateInterest" => "Purposes (Legitimate Interest)",
"specialPurposes" => "Special Purposes",
"features" => "Features",
"dataDeclaration" => "Data Declaration",
"maximumCookieLifetime" => "Maximum cookie lifetime",
"cookieExpiryRefreshed" => "Cookie expiry may be refreshed during the lifetime.",
"trackingMethodCookies" => "Tracking method: Cookies",
"trackingMethodOthers" => "Tracking method: Others",
"andOthers" => "and others",
"deviceStorage" => "Device storage",
"standardRetention" => "Standard retention",
"purposes" => "Purposes",
"dataRetention" => "Data retention",
"examples" => "Examples",
"partners" => "Partners"
],
'acceptAll' => 'Accept all',
'acceptSelected' => 'Accept selected',
'close' => 'Close',
'consentNotice' => [
'changeDescription' => 'There were changes since your last visit, please renew your consent.',
'title' => 'Cookie Consent',
'description' => 'Hi! Could we please enable some additional services for {purposes}? You can always change or withdraw your consent later.',
'learnMore' => 'Let me choose',
'testing' => 'Testing mode!',
],
'contextualConsent' => [
'acceptAlways' => 'Always',
'acceptOnce' => 'Yes',
'description' => 'Do you want to load external content supplied by {title}?',
],
'decline' => 'I decline',
'ok' => 'That\'s ok',
'poweredBy' => 'Realized with Klaro!',
'privacyPolicy' => [
'name' => 'privacy policy',
'text' => 'To learn more, please read our {privacyPolicy}.',
],
'save' => 'Save',
'service' => [
'disableAll' => [
'description' => 'Use this switch to enable or disable all services.',
'title' => 'Enable or disable all services',
],
'optOut' => [
'description' => 'This services is loaded by default (but you can opt out)',
'title' => '(opt-out)',
],
'purpose' => 'purpose',
'purposes' => 'purposes',
'required' => [
'description' => 'This services is always required',
'title' => '(always required)',
],
],
];

/**
* OR just overwrite strings one by one
*/
$my_custom_translations['en']["save"] = 'Save';
$my_custom_translations['en']["service"]['required']['title'] = '(always required)';

return $my_custom_translations;
}
add_filter('ct_ultimate_gdpr_tcf_translations', 'ct_tcf_custom_translations');

Buz i have also sites what use more then one language and to translate it via this is not good.

March 22, 2024 at 9:45 am #15439644

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Hi there,

I'm sorry but I don't understand your messages. Could you elaborate a little more?

March 22, 2024 at 10:34 am #15439835

erkkiM

The code what i shared before is from GDPR and i need to add it to function.php but this dont resolve my problem.

Did you get my test site info?

March 22, 2024 at 10:43 am #15439855

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

I understand that you need to translate the code in this message: https://wpml.org/forums/topic/translate-strings-from-ultimate-gdpr-ccpa/#post-15438870

If the above is correct then you will need to add the Gettext functions to make the strings available for translation: https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/

If what I understood is incorrect, then I kindly ask you to walk me through it so I can understanding it correctly 🙂

March 23, 2024 at 9:43 am #15442992

erkkiM

But by any chance i cant translate it as i do other translations? via strings?

March 25, 2024 at 10:32 am #15445766

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Yes, you will be able to translate these strings via String Translation once you use the Gettext functions as described in the links I shared on my previous message.