تخطي الملاحة

Resolved

Reported for: Gravity Forms Multilingual 1.7.2

Resolved in: Gravity Forms Multilingual 1.8.0

Topic Tags: Compatibility

Overview of the issue

Currently, the Custom Required Indicator feature available in the Form settings of Gravity Forms plugin is not translatable.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open …/wp-content/plugins/gravityforms/forms_model.php file.
  • Look for line 6674.
  • Replace:
    				$indicator       = rgar( $meta, 'customRequiredIndicator' ) ? $meta['customRequiredIndicator'] : esc_html__( '(Required)', 'gravityforms' );
    
  • With:
    				$indicator       = rgar( $meta, 'customRequiredIndicator' ) ? $meta['customRequiredIndicator'] : esc_html__( '(Required)', 'gravityforms' );
    				// WPML Workaround for compsupp-7383
    				if ( class_exists('Sitepress') ) {
    					$string = $indicator;
    					$textdomain = 'WordPress';
    					$string_name = 'WPML Workaround : '.substr($string, 0, 20);
    
    					$wpml_default_lang = apply_filters('wpml_default_language', NULL );
    					$wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
    
    					if ($wpml_default_lang == $wpml_current_lang ) {
    						do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
    					}	
    					// Apply the translation to the string
    					$string = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
    
    					$indicator   = $string;
    				}
    
  • Visit the form in the front-end.
  • Go to WPML > String Translation page and translate the new string.