WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin

Loader::build_and_save_translations() public WC 1.0

Combine and save translations for a specific locale.

Note that this assumes \WP_Filesystem is already initialized with write access.

{} It's a method of the class: Loader{}

No Hooks.

Return

null. Nothing.

Usage

$result = Loader::build_and_save_translations( $language_dir, $plugin_domain, $locale );
$language_dir(string) (required)
Path to language files.
$plugin_domain(string) (required)
Text domain.
$locale(string) (required)
Locale being retrieved.

Code of Loader::build_and_save_translations() WC 5.8.0

public static function build_and_save_translations( $language_dir, $plugin_domain, $locale ) {
	global $wp_filesystem;
	$translations_from_chunks = self::get_translation_chunk_data( $language_dir, $plugin_domain, $locale );

	if ( empty( $translations_from_chunks ) ) {
		return;
	}

	$cache_filename          = self::get_combined_translation_filename( $plugin_domain, $locale );
	$chunk_translations_json = wp_json_encode( $translations_from_chunks );

	// Cache combined translations strings to a file.
	$wp_filesystem->put_contents( $language_dir . $cache_filename, $chunk_translations_json );
}