WPML
상태
해결됨
보고된 제품
Ninja Forms Multilingual 0.3.0
해결된 버전
Ninja Forms Multilingual 0.3.1
관련 플러그인/테마
Ninja Forms
주제 태그
Compatibility

문제 개요

Ninja Forms와 해당 Repeatable Fields 기능을 사용할 때 번역에 문제가 발생할 수 있습니다. WPML 문자열 번역을 사용하여 필드를 번역할 수 있지만, 상위 리피터 필드 레이블을 번역할 때 하위 필드의 번역이 덮어쓰입니다.

임시 해결 방법

진행하기 전에 사이트의 전체 백업을 반드시 수행하세요.


  1. …/wp-content/plugins/wpml-ninja-forms/classes/Hooks/NinjaForms/Strings.php 파일을 여세요.

  2. 62번째 줄을 찾으세요.

  3. 다음 코드를:
    if (
    	$this->getFormId() && $this->notEmpty( 'settings', $field )
    	&& $this->notEmpty( 'type', $field['settings'] )
    	&& $this->isTranslatableFieldType( $field['settings']['type'] )
    ) {
    	$field['settings'] = $this->getPackage()->translateField( $field['settings'], $this->getId( $field ) );
    }
    다음으로 교체하세요:
    if (
    	$this->getFormId() && $this->notEmpty( 'settings', $field )
    	&& $this->notEmpty( 'type', $field['settings'] )
    	&& $this->isTranslatableFieldType( $field['settings']['type'] )
    ) {
    	if (! array_key_exists('repeaterField', $field['settings'] ) && $field['settings']['repeaterField'] != true ) {
    		$field['settings'] = $this->getPackage()->translateField( $field['settings'], $this->getId( $field ) );
    	}
    }

알려진 모든 문제 →