src/i18n-v3.php
private function retrieve_translation_details() {
		$api_url = $this->get_api_url();

		$resp = wp_remote_get( $api_url );
		if ( is_wp_error( $resp ) || wp_remote_retrieve_response_code( $resp ) !== 200 ) {
			return null;
		}
		$body = wp_remote_retrieve_body( $resp );
		unset( $resp );

		if ( $body ) {
			$body = json_decode( $body );
			if ( empty( $body->translation_sets ) ) {
				return null;
			}
			foreach ( $body->translation_sets as $set ) {
				if ( ! property_exists( $set, 'wp_locale' ) ) {
					continue;
				}

				// For informal and formal locales, we have to complete the locale code by concatenating the slug ('formal' or 'informal') to the xx_XX part.
				if ( $set->slug !== 'default' && strtolower( $this->locale ) === strtolower( $set->wp_locale . '_' . $set->slug ) ) {
					return $set;
				}

				if ( $this->locale === $set->wp_locale ) {
					return $set;
				}
			}
		}

		return null;
	}
private function retrieve_translation_details() {
		$api_url = $this->get_api_url();

		$resp = wp_remote_get( $api_url );
		if ( is_wp_error( $resp ) || wp_remote_retrieve_response_code( $resp ) !== 200 ) {
			return null;
		}
		$body = wp_remote_retrieve_body( $resp );
		unset( $resp );

		if ( $body ) {
			$body = json_decode( $body );
			if ( empty( $body->translation_sets ) ) {
				return null;
			}
			foreach ( $body->translation_sets as $set ) {
				if ( ! property_exists( $set, 'wp_locale' ) ) {
					continue;
				}

				// For informal and formal locales, we have to complete the locale code by concatenating the slug ('formal' or 'informal') to the xx_XX part.
				if ( $set->slug !== 'default' && strtolower( $this->locale ) === strtolower( $set->wp_locale . '_' . $set->slug ) ) {
					return $set;
				}

				if ( $this->locale === $set->wp_locale ) {
					return $set;
				}
			}
		}

		return null;
	}
private function retrieve_translation_details ( ) { $ api_url = $ this -> get_api_url ( ) ; $ resp = wp_remote_get ( $ api_url ) ; if ( is_wp_error ( $ resp ) || wp_remote_retrieve_response_code ( $ resp ) !== 200 ) { return null ; } $ body = wp_remote_retrieve_body ( $ resp ) ; unset ( $ resp ) ; if ( $ body ) { $ body = json_decode ( $ body ) ; if ( empty ( $ body -> translation_sets ) ) { return null ; } foreach ( $ body -> translation_sets as $ set ) { if ( ! property_exists ( $ set , 'wp_locale' ) ) { continue ; } // For informal and formal locales, we have to complete the locale code by concatenating the slug ('formal' or 'informal') to the xx_XX part. if ( $ set -> slug !== 'default' && strtolower ( $ this -> locale ) === strtolower ( $ set -> wp_locale . '_' . $ set -> slug ) ) { return $ set ; } if ( $ this -> locale === $ set -> wp_locale ) { return $ set ; } } } return null ; }
Retrieve the translation details from Yoast Translate.

@access private

@return object|null
Retrieve the translation details from Yoast Translate .