WPML
Trạng thái
Đã giải quyết
Được báo cáo cho
Gravity Forms Multilingual 1.7.2
Đã giải quyết trong
Gravity Forms Multilingual 1.8.0
Plugin/giao diện liên quan
Gravity Forms
Thẻ chủ đề
Compatibility

Tổng quan về lỗi

Hiện tại, tính năng Chỉ báo bắt buộc tùy chỉnh có sẵn trong phần Cài đặt biểu mẫu của plugin Gravity Forms không thể dịch được.

Giải pháp tạm thời

Vui lòng đảm bảo sao lưu toàn bộ trang web trước khi tiếp tục.


  • Mở tệp …/wp-content/plugins/gravityforms/forms_model.php.

  • Tìm dòng 6674.

  • Thay thế:
    				$indicator       = rgar( $meta, 'customRequiredIndicator' ) ? $meta['customRequiredIndicator'] : esc_html__( '(Required)', 'gravityforms' );

  • Bằng:
    				$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;
    				}
  • Truy cập biểu mẫu trên giao diện người dùng.
  • Đi tới trang WPML > Dịch chuỗi và dịch chuỗi văn bản mới.

Tất cả các lỗi đã ghi nhận →