Gettext_Translations::make_headers()

最后更新于:2021-11-25 19:51:46

Gettext_Translations::make_headers( string$translation)

参数

$translation

(string) (Required)

响应

(array)

源文件

文件: gc-includes/pomo/translations.php

		function make_headers( $translation ) {
			$headers = array();
			// Sometimes n's are used instead of real new lines.
			$translation = str_replace( 'n', "n", $translation );
			$lines       = explode( "n", $translation );
			foreach ( $lines as $line ) {
				$parts = explode( ':', $line, 2 );
				if ( ! isset( $parts[1] ) ) {
					continue;
				}
				$headers[ trim( $parts[0] ) ] = trim( $parts[1] );
			}
			return $headers;
		}