components/I18n/I18n.php
public function add_i18n_inputs( $output, $name, $value, $options, $pod, $id ) {

		if ( ! empty( $pod ) || empty( $name ) || ! $this->is_translatable_field( $name ) ) {
			return $output;
		}

		$pod = $this->cur_pod;
		// print_r( $pod );
		if ( empty( $pod ) ) {
			// Setting the $pod var to a non-empty value is mandatory to prevent a loop
			$pod = true;
		}

		$output .= '<br clear="both" />';
		$output .= '<div class="pods-i18n-field">';
		foreach ( $this->languages as $locale => $lang_data ) {

			if ( ! $this->obj_is_language_enabled( $locale, (array) $pod ) ) {
				continue;
			}
			// Our own shiny label with language information
			$lang_code = '<code style="font-size: 1em;">' . $locale . '</code>';
			/*
			$lang_label = $this->create_lang_label( $lang_data );
			if ( ! empty( $lang_label ) ) {
				$lang_label = $lang_code . ' ('. $lang_label .')';
			} else {*/
			$lang_label = $lang_code;
			// }
			$lang_label = '<small>' . $lang_label . '</small>';

			$style = '';

			// Add language data to name for normal strings and array formatted strings
			if ( strpos( $name, ']' ) !== false ) {
				// Hide the i18n options for fields by default if they are empty
				$field_value = pods_v( $name, $pod );

				if ( strpos( $name, 'field_data' ) !== false && empty( $field_value ) ) {
					$style = ' style="display: none;"';
				}

				$field_name  = rtrim( $name, ']' );
				$field_name .= '_' . $locale . ']';
			} else {
				$field_name = $name . '_' . $locale;
			}

			// Add the translation fields
			$output .= '<div class="pods-i18n-input pods-i18n-input-' . $locale . '" data-locale="' . $locale . '" ' . $style . '>';
			$output .= PodsForm::label( $field_name, $lang_label );
			$output .= PodsForm::field( $field_name, pods_v( $field_name, $pod ), 'text', null, $pod );
			$output .= '</div>';
		}//end foreach
		$output .= '</div>';

		return $output;
	}
public function add_i18n_inputs( $output, $name, $value, $options, $pod, $id ) {

		if ( ! empty( $pod ) || empty( $name ) || ! $this->is_translatable_field( $name ) ) {
			return $output;
		}

		$pod = $this->cur_pod;
		// print_r( $pod );
		if ( empty( $pod ) ) {
			// Setting the $pod var to a non-empty value is mandatory to prevent a loop
			$pod = true;
		}

		$output .= '<br clear="both" />';
		$output .= '<div class="pods-i18n-field">';
		foreach ( $this->languages as $locale => $lang_data ) {

			if ( ! $this->obj_is_language_enabled( $locale, (array) $pod ) ) {
				continue;
			}
			// Our own shiny label with language information
			$lang_code = '<code style="font-size: 1em;">' . $locale . '</code>';
			/*
			$lang_label = $this->create_lang_label( $lang_data );
			if ( ! empty( $lang_label ) ) {
				$lang_label = $lang_code . ' ('. $lang_label .')';
			} else {*/
			$lang_label = $lang_code;
			// }
			$lang_label = '<small>' . $lang_label . '</small>';

			$style = '';

			// Add language data to name for normal strings and array formatted strings
			if ( strpos( $name, ']' ) !== false ) {
				// Hide the i18n options for fields by default if they are empty
				$field_value = pods_v( $name, $pod );

				if ( strpos( $name, 'field_data' ) !== false && empty( $field_value ) ) {
					$style = ' style="display: none;"';
				}

				$field_name  = rtrim( $name, ']' );
				$field_name .= '_' . $locale . ']';
			} else {
				$field_name = $name . '_' . $locale;
			}

			// Add the translation fields
			$output .= '<div class="pods-i18n-input pods-i18n-input-' . $locale . '" data-locale="' . $locale . '" ' . $style . '>';
			$output .= PodsForm::label( $field_name, $lang_label );
			$output .= PodsForm::field( $field_name, pods_v( $field_name, $pod ), 'text', null, $pod );
			$output .= '</div>';
		}//end foreach
		$output .= '</div>';

		return $output;
	}
public function add_i18n_inputs ( $ output , $ name , $ value , $ options , $ pod , $ id ) { if ( ! empty ( $ pod ) || empty ( $ name ) || ! $ this -> is_translatable_field ( $ name ) ) { return $ output ; } $ pod = $ this -> cur_pod ; // print_r( $pod ); if ( empty ( $ pod ) ) { // Setting the $pod var to a non-empty value is mandatory to prevent a loop $ pod = true ; } $ output .= '<br clear="both" />' ; $ output .= '<div class="pods-i18n-field">' ; foreach ( $ this -> languages as $ locale => $ lang_data ) { if ( ! $ this -> obj_is_language_enabled ( $ locale , ( array ) $ pod ) ) { continue ; } // Our own shiny label with language information $ lang_code = '<code style="font-size: 1em;">' . $ locale . '</code>' ; /*
			$lang_label = $this->create_lang_label( $lang_data );
			if ( ! empty( $lang_label ) ) {
				$lang_label = $lang_code . ' ('. $lang_label .')';
			} else {*/ $ lang_label = $ lang_code ; // } $ lang_label = '<small>' . $ lang_label . '</small>' ; $ style = '' ; // Add language data to name for normal strings and array formatted strings if ( strpos ( $ name , ']' ) !== false ) { // Hide the i18n options for fields by default if they are empty $ field_value = pods_v ( $ name , $ pod ) ; if ( strpos ( $ name , 'field_data' ) !== false && empty ( $ field_value ) ) { $ style = ' style="display: none;"' ; } $ field_name = rtrim ( $ name , ']' ) ; $ field_name .= '_' . $ locale . ']' ; } else { $ field_name = $ name . '_' . $ locale ; } // Add the translation fields $ output .= '<div class="pods-i18n-input pods-i18n-input-' . $ locale . '" data-locale="' . $ locale . '" ' . $ style . '>' ; $ output .= PodsForm :: label ( $ field_name , $ lang_label ) ; $ output .= PodsForm :: field ( $ field_name , pods_v ( $ field_name , $ pod ) , 'text' , null , $ pod ) ; $ output .= '</div>' ; } //end foreach $ output .= '</div>' ; return $ output ; }
Adds translation inputs to fields

@since 0.1.0
@see    PodsForm.php >> 'pods_form_ui_field_' . $type (filter)

@param  string $output  The default output of the field
@param  string $name    The field name
@param  string $value   The field value
@param  array  $options The field options
@param  array  $pod     The Pod
@param  int    $id      The field ID

@return string
Adds translation inputs to fields