function _locale_import_parse_header in Drupal 4
Same name and namespace in other branches
- 5 includes/locale.inc \_locale_import_parse_header()
- 6 includes/locale.inc \_locale_import_parse_header()
- 7 includes/locale.inc \_locale_import_parse_header()
Parses a Gettext Portable Object file header
@author Jacobo Tarrio
Parameters
$header A string containing the complete header:
Return value
An associative array of key-value pairs
1 call to _locale_import_parse_header()
- _locale_import_one_string in includes/
locale.inc - Imports a string into the database
File
- includes/
locale.inc, line 751 - Admin-related functions for locale.module.
Code
function _locale_import_parse_header($header) {
$hdr = array();
$lines = explode("\n", $header);
foreach ($lines as $line) {
$line = trim($line);
if ($line) {
list($tag, $contents) = explode(":", $line, 2);
$hdr[trim($tag)] = trim($contents);
}
}
return $hdr;
}