src/Modules/Translate.php
private function get_translations( $product ) {
		$cache_key    = $product->get_key() . '_all_languages';
		$translations = get_transient( $cache_key );

		if ( false === $translations ) {
			require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
			$translations = translations_api(
				$product->get_type() . 's',
				array(
					'slug'    => $product->get_slug(),
					'version' => $product->get_version(),
				)
			);
			set_transient( $cache_key, $translations, WEEK_IN_SECONDS );
		}

		return $translations;

	}
private function get_translations( $product ) {
		$cache_key    = $product->get_key() . '_all_languages';
		$translations = get_transient( $cache_key );

		if ( false === $translations ) {
			require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
			$translations = translations_api(
				$product->get_type() . 's',
				array(
					'slug'    => $product->get_slug(),
					'version' => $product->get_version(),
				)
			);
			set_transient( $cache_key, $translations, WEEK_IN_SECONDS );
		}

		return $translations;

	}
private function get_translations ( $ product ) { $ cache_key = $ product -> get_key ( ) . '_all_languages' ; $ translations = get_transient ( $ cache_key ) ; if ( false === $ translations ) { require_once ( ABSPATH . 'wp-admin/includes/translation-install.php' ) ; $ translations = translations_api ( $ product -> get_type ( ) . 's' , array ( 'slug' => $ product -> get_slug ( ) , 'version' => $ product -> get_version ( ) , ) ) ; set_transient ( $ cache_key , $ translations , WEEK_IN_SECONDS ) ; } return $ translations ; }
Fetch translations from api.

@param Product $product Product to check.

@return mixed Translation array.
Fetch translations from api .