Resolved by author
Overview of the issue
The cookie consent popup displays untranslated CCPA text on the front-end, even though the text is correctly translated via WPML → String Translation.
This happens because the text is loaded before WPML is initialized. We’ve reached out to the authors to resolve the issue permanently.
Workaround
Please back up your website’s files and database completely before attempting any code changes or workarounds posted on our website.
Modify cookie-law-info/admin/modules/ccpa/ccpa.php LINES 116 – 134
From
public function wt_cli_ccpa_optout_callback() { $ccpa_data = ''; $ccpa_enabled = $this->ccpa_enabled; $ccpa_as_link = $this->ccpa_as_link; $ccpa_text = $this->ccpa_text; $ccpa_colour = $this->ccpa_link_colour; if( $ccpa_enabled === false ) { return ''; } if( $ccpa_as_link === false ) { $ccpa_data = '<span class="wt-cli-form-group wt-cli-custom-checkbox wt-cli-ccpa-checkbox"><input type="checkbox" id="wt-cli-ccpa-opt-out" class="wt-cli-ccpa-opt-out wt-cli-ccpa-opt-out-checkbox" ><label for="wt-cli-ccpa-opt-out" style="color:'.$ccpa_colour.';" >'.$ccpa_text.'</label></span>'; } else { $ccpa_data = '<a href="javascript:void(0)" style="color:'.$ccpa_colour.';" class="wt-cli-ccpa-opt-out">'.$ccpa_text.'</a>'; } return $ccpa_data; }
To:
public function wt_cli_ccpa_optout_callback() { $cookie_options = Cookie_Law_Info::get_settings(); $this->ccpa_enabled = Cookie_Law_Info::sanitise_settings('ccpa_enabled', ( isset( $cookie_options['ccpa_enabled'] ) ? $cookie_options['ccpa_enabled'] : false ) ); $this->ccpa_as_link = Cookie_Law_Info::sanitise_settings('button_6_as_link', ( isset( $cookie_options['button_6_as_link'] ) ? $cookie_options['button_6_as_link'] : true ) ); $this->ccpa_text = Cookie_Law_Info::sanitise_settings('button_6_text', ( isset( $cookie_options['button_6_text'] ) ? $cookie_options['button_6_text'] : 'Do not sell my personal information' ) ); $this->ccpa_link_colour = Cookie_Law_Info::sanitise_settings('button_6_link_colour', ( isset( $cookie_options['button_6_link_colour'] ) ? $cookie_options['button_6_link_colour'] : '#333333' ) ); $ccpa_data = ''; $ccpa_enabled = $this->ccpa_enabled; $ccpa_as_link = $this->ccpa_as_link; $ccpa_text = $this->ccpa_text; $ccpa_colour = $this->ccpa_link_colour; if( $ccpa_enabled === false ) { return ''; } if( $ccpa_as_link === false ) { $ccpa_data = '<span class="wt-cli-form-group wt-cli-custom-checkbox wt-cli-ccpa-checkbox"><input type="checkbox" id="wt-cli-ccpa-opt-out" class="wt-cli-ccpa-opt-out wt-cli-ccpa-opt-out-checkbox" ><label for="wt-cli-ccpa-opt-out" style="color:'.$ccpa_colour.';" >'.$ccpa_text.'</label></span>'; } else { $ccpa_data = '<a href="javascript:void(0)" style="color:'.$ccpa_colour.';" class="wt-cli-ccpa-opt-out">'.$ccpa_text.'</a>'; } return $ccpa_data; }
HI, In the newer Verion of Cookie Yes I can set variable languages. ut i can not define the language of the Cookie to the WPML language.
Hey Raph,
This issue should be solved by the author a few time ago. If you are experiencing a new issue, don’t hesitate to open a ticket in our support forum so we can investigate better.
Regards