Skip Navigation

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.

WordPress 6.7 has introduced a new issue that impact translations, please update WooCommerce and WPML to the latest versions before you report issues. More about this here - https://wpml.org/errata/php-error-wp-6-7-notice-function-_load_textdomain_just_in_time-was-called/
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Madrid (GMT+01:00)

Tagged: 

This topic contains 7 replies, has 1 voice.

Last updated by Marcel 4 days, 11 hours ago.

Assisted by: Marcel.

Author Posts
November 18, 2024 at 2:24 pm #16415260

maarten

Background of the issue:
I want to translate the entire site at hidden link except for specific fields: product title, product short description, and product lang description. These values will be imported via the API with the help of an external CRM.

Symptoms:
I need to ensure certain fields are 'ready' but not automatically translated.

Questions:
How can I make sure these fields are 'ready' but not automatically translated?

November 18, 2024 at 5:21 pm #16416141

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi,

Currently, we don't have functionality to exclude specific fields from translation; our system always translates everything by default.

However, you can customize this by adding a script to your functions.php file. Here's a helpful example to get you started: Exclude Specific Fields from Automatic Translation. You can adapt it as needed for your specific use case.

Best regards,
Marcel

November 25, 2024 at 10:49 am #16439223

maarten

Can you help me with this please?
during the creation of a translated product, are there some values that need to be automatic translated before its visible?

the product title for example?

How can i make sure the "description" and "short description" and the "title" don't get overwritten during automatic translation.

November 25, 2024 at 10:54 am #16439234

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi,

The example code I provided ensures these fields are excluded from translation. There’s no overwriting involved, as they are not included in the translation job.

Best regards,
Marcel

November 25, 2024 at 10:58 am #16439250

maarten

but the products are still automatic created if i'm correct?

so this should solve the issue:

add_filter('wpml_tm_job_field_is_translatable', 'testfield', 10, 2);
function testfield($is_translatable, $job_translate) {
global $wpdb;

// Haal de originele post-ID op gekoppeld aan de vertaaltaak
$postid = $wpdb->get_var($wpdb->prepare(
"SELECT `field_data` FROM `wp_icl_translate` WHERE `field_type` = 'original_id' AND `job_id` = %d",
$job_translate["job_id"]
));

// Haal het posttype op van de originele post
$posttype = get_post_type($postid);

// Controleer of het veld niet vertaald mag worden
if (
$posttype == "product" &&
in_array($job_translate["field_type"], ["title", "description", "short_description"])
) {
return false; // Niet vertaalbaar maken
} else {
return true; // Standaard gedrag behouden
}
}

November 25, 2024 at 5:10 pm #16441424

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Yes, the translation process still starts, but some fields are excluded beforehand. The modifications you made to the snippet appear to be correct. However, please note that we cannot provide more in-depth debugging support regarding custom code.

Best regards,
Marcel

November 29, 2024 at 11:35 am #16459132

maarten

hello, this snippet failed massivly.

I have started automatic translation and the descrption and short description are also translated wich costs me +700 euro's.

Since you are the plugin developer, you should be able to help me with this issue. not?

Scherm­afbeelding 2024-11-29 om 12.34.41.png
November 29, 2024 at 11:47 am #16459206

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi,

Since you are the plugin developer, you should be able to help me with this issue. not?

I shared an example to help you get started, which can be adapted to your specific use case. It’s always a good practice to test changes like this in a development environment with a small number of products first, ensuring everything works as expected before applying them more broadly.

Our plugin is designed to provide predefined solutions. If these don't meet your needs and adjustments are required, custom coding becomes necessary. While we're happy to provide guidance, creating a fully functional custom solution falls outside our support policy.

As noted, this specific functionality isn’t currently available, and there are no immediate plans to integrate it. For customizations like this, we recommend reaching out to a certified WPML contractor, who can assist in tailoring a solution for you. You can find a list of contractors here: https://wpml.org/contractors/.

That said, if this feature gains more interest from our user community, we may consider it for future updates. Thank you for your understanding! If you have any other questions, feel free to reach out.

Best regards,
Marcel