Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > 7d0d48e7990cef72b180bd549a3aa9dc > files > 17

WebCalendar-1.2.1-1.fc13.src.rpm

<?php

//	Script to tag translation files with the corresponding %lang().

include("includes/translate.php");
define_languages();
$matches = array();
$line = rtrim(fgets(STDIN));

while (!feof(STDIN)) {
	if (preg_match('#/translations/(.*)\.txt$#', $line, $matches)) {
		$abbrev = languageToAbbrev($matches[1]);

		if ($abbrev === FALSE) {
			$lang = array_search($matches[1], $languages);

			if ($lang !== FALSE) {
				$lang = explode(' ', $lang);
				$abbrev = languageToAbbrev($lang[0]);
				}
			}

		if ($abbrev !== FALSE)
			$line = "%lang($abbrev) $line";
		}

	echo "$line\n";
	$line = rtrim(fgets(STDIN));
	}

exit(0);
?>