<commit_before><?php defined('SYSPATH') or die('No direct script access.');
/**
 * Internationalization (i18n) class.
 *
 * @package    Kohana
 * @author     <NAME>
 * @copyright  (c) 2008-2009 Kohana Team
 * @license    http://kohanaphp.com/license.html
 */
class i18n_Core {

	// The default language of all messages
	public static $default_lang = 'en_US';

	// The current language
	public static $lang = 'en_US';

	// Cache of loaded languages
	protected static $_cache = array();

	/**
	 * Returns translation of a string. If no translation exists, the original
	 * string will be returned.
	 *
	 * @param   string   text to translate
	 * @return  string
	 */
	public static function get($string)
	{
		// Load the translation table
		$table = i18n::load(i18n::$lang);

		// Return the translated string if it exists
		return isset($table[$string]) ? $table[$string] : $string;
	}

	/**
	 * Loads the translation table for a given language.
	 * 
	 * @param   string   language to load
	 * @return  array
	 */
	protected static function load($lang)
	{
		if ( ! isset(i18n::$_cache[$lang]))
		{
			// Separate the language and locale
			list ($language, $locale) = explode('_', strtolower($lang));

			// Start a new translation table
			$table = array();

			if ($files = Kohana::find_file('i18n', $language))
			{
				foreach ($files as $file)
				{
					// Load the strings that are in this file
					$strings = Kohana::load($file);

					// Merge the language strings into the translation table
					$table = array_merge($table, $strings);
				}
			}

			if ($files = Kohana::find_file('i18n', $language.'/'.$locale))
			{
				foreach ($files as $file)
				{
					// Load the strings that are in this file
					$strings = Kohana::load($file);

					// Merge the locale strings into the translation table
					$table = array_merge($table, $strings);
				}
			}
<commit_msg>Changed i18n to use en-US instead of en_US, as hyphens are more technically accurate<commit_after><?php defined('SYSPATH') or die('No direct script access.');
/**
 * Internationalization (i18n) class.
 *
 * @package    Kohana
 * @author     Kohana Team
 * @copyright  (c) 2008-2009 Kohana Team
 * @license    http://kohanaphp.com/license.html
 */
class i18n_Core {

	// The default language of all messages
	public static $default_lang = 'en-US';

	// The current language
	public static $lang = 'en-US';

	// Cache of loaded languages
	protected static $_cache = array();

	/**
	 * Returns translation of a string. If no translation exists, the original
	 * string will be returned.
	 *
	 * @param   string   text to translate
	 * @return  string
	 */
	public static function get($string)
	{
		// Load the translation table
		$table = i18n::load(i18n::$lang);

		// Return the translated string if it exists
		return isset($table[$string]) ? $table[$string] : $string;
	}

	/**
	 * Loads the translation table for a given language.
	 * 
	 * @param   string   language to load
	 * @return  array
	 */
	protected static function load($lang)
	{
		if ( ! isset(i18n::$_cache[$lang]))
		{
			// Separate the language and locale
			list ($language, $locale) = explode('-', strtolower($lang), 2);

			// Start a new translation table
			$table = array();

			if ($files = Kohana::find_file('i18n', $language))
			{
				foreach ($files as $file)
				{
					// Load the strings that are in this file
					$strings = Kohana::load($file);

					// Merge the language strings into the translation table
					$table = array_merge($table, $strings);
				}
			}

			if ($files = Kohana::find_file('i18n', $language.'/'.$locale))
			{
				foreach ($files as $file)
				{
					// Load the strings that are in this file
					$strings = Kohana::load($file);

					// Merge the locale strings into the translation table
					$table = array_merge($table, $strings);
				}
			}

{'fraction_non_alphanumeric': 0.13246414602346807, 'fraction_numerical': 0.01225554106910039, 'mean_word_length': 2.9875259875259874, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3184653', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1156, 'n_words': 389}