示例#1
0
		$default = str_replace('"', '\\"', $keyData['results']['FALLBACK']);
		$output .= implode("\n;", explode("\n", $default)) . "\";\n";
		if($keyData['found']){
			$output .= $keyData['key'] . " = \"" . str_replace('"', '\\"', $keyData['match_str']) . "\";\n";
		}
		else{
			$output .= $keyData['key'] . " = \"\";\n";
		}
		$output .= "\n";
	}
	
	// Now generate any dialect-specific keys.
	foreach($baseData['dialects'] as $dialect){
		$output .= "; Dialect-specific overrides for " . $dialect . "\n[" . $dialect . "]\n";
		foreach($matches as $m){
			$keyData = \Core\i18n\I18NLoader::Get($m, $dialect);
			if($keyData['found'] && $keyData['match_key'] == $dialect){
				// This specific dialect has an override.
				$output .= $keyData['key'] . " = \"" . str_replace('"', '\\"', $keyData['match_str']) . "\";\n";
			}
		}
		$output .= "\n";
	}

	if($arguments->getArgumentValue('dry-run')){
		echo $output;
	}
	else{
		// Write this output to the requested ini file!
		$file = \Core\Filestore\Factory::File($dir . '/i18n/' . $lang . '.ini');
		$file->putContents($output);