Translation is not working in checkout fields

[ad_1]

Here i found the solution:

/wc-fields-factory/includes/wcff_checkout_fields.php

/* To render custom checkout field */
    public function wcccf_custom_checkout_fields(){
        
        $checkout_custom_meta = $this->get_fields_meta( 'custom-fields' );
        $checkout_custom_fields = array();
        foreach( $checkout_custom_meta as $name => $val ){
            $checkout_custom_fields[$name] = json_decode( $val[0], true );
        }
        
        foreach ($checkout_custom_fields as $key => $field) {

            $is_enable = isset($field["is_enable"]) ? $field["is_enable"] : true;
            if (is_array($field) && isset($field["key"]) && $this->check_login_user($field) && $is_enable) {
                $wccpf_options = wcff()->option->get_options();
                $multilingual = isset($wccpf_options["enable_multilingual"]) ? $wccpf_options["enable_multilingual"] : "no";
                if ($multilingual == "yes") {
        			/* Localize field */
        			$field = wcff ()->locale->localize_field ( $field );
        		}
                $field["name"] = $field["key"];
                $field["required"] = isset( $field["required"] ) && $field["required"] == "yes" ? true : false;
                $field["cloneable"] = "no";
                $field["for_front_end"] = true;
                echo wcff()->builder->build_user_field( $field, "wcccf", true );
            }

        }
    }

/wc-fields-factory/includes/wcff_locale.php

public function localize_field($_field) {

    	/* Determine the current locale */
    	$locale = $this->detrmine_current_locale();
    	/* Well start the translation */
    	$wcff_options = wcff()->option->get_options();
        $default_locale = isset($wcff_options["default_locale"]) ? $wcff_options["default_locale"] : "en"; 
    	if($locale != $default_locale) {
    		if(isset($_field["locale"]) && isset($_field["locale"][$locale])) {
    			$resources = $_field["locale"][$locale];
    			if($resources) {
    				foreach ($_field as $key => $value) {
    					if($key != "locale") {
    						if(isset($resources[$key]) && $resources[$key] != "") {
    							$_field[$key] = $resources[$key];
    						}
    					}
    				}
    			}
                
    			/* Remove locale property from the $_field argument
    			 * as it is no longer needed */
    			//unset($_field["locale"]);
    		}
    	}    	
    	return $_field;
    }

I hope this code useful to this community and Plugin auther will fix in next release version.

Thanks.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer