This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was experiencing issues with translating the product field description in the order summary of a Gravity Forms form on a multisite installation. The provided custom snippet did not translate the description text from German to English.
Solution:
We recommended replacing the existing snippet with a new one that includes steps to register and translate strings using WPML. Here is the revised snippet:
add_filter( 'gform_product_info', function ( $product_info, $form, $entry ) {
foreach ( $product_info['products'] as $key => &$product ) {
$field = GFFormsModel::get_field( $form, $key );
if ( is_object( $field ) && ! empty( $field->description ) ) {
$context = 'gravity_form-' . rgar( $form, 'id' );
$name = 'field-' . $field->id . '-description';
do_action( 'wpml_register_single_string', $context, $name, $field->description );
$description = apply_filters( 'wpml_translate_single_string', $field->description, $context, $name );
$product['name'] .= sprintf(
'<span style="font-size:0.8em;color:#000000;font-weight:normal">%s</span>',
esc_html( $description )
);
}
}
return $product_info;
}, 10, 3 );After implementing the new snippet, the client should:
1. Navigate to WPML → String Translation.
2. Filter by Domain/Context using the format 'gravity_form-{FORM_ID}', where {FORM_ID} is the ID of the form.
3. Look for strings named like 'field-{FIELD_ID}-description', add translations, and save.
If the strings are not visible, the client should submit the form once or load any page that renders the product info to trigger the registration.
If this solution does not resolve the issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
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 1 voice.
Last updated by 1 month, 4 weeks ago.
Assisted by: Bobby.

