Sophie

Sophie

distrib > Fedora > 16 > x86_64 > media > updates-src > by-pkgid > ee2927ff48c715dc775218a2cc113594 > files > 23

WebCalendar-1.2.4-3.fc16.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);
?>