<commit_before><?php

class TestLocale extends PHPUnit_Framework_TestCase {

	/** @var string */
	private static $i18ndir;

	public static function setUpBeforeClass() {
		self::setupGettext();
	}

	/**
	 * @dataProvider testData_en_US
	 * @test
	 */
	public function localeTestMissingValues($exp, $input, $params) {
		$language = "en_US";
		putenv("LANG=" . $language);
		setlocale(LC_ALL, $language);
		$this->locale(array('path' => self::$i18ndir, 'domain' => 'messages'));
		$res = $this->t($input, $params);
		$this->assertEquals($exp, $res);
	}

	/**
	 * @dataProvider testData_pl_PL
	 * @test
	 */
	public function localeTest($exp, $input, $params) {
		$language = "pl_PL";
		putenv("LANG=" . $language);
		setlocale(LC_ALL, $language);
		$this->locale(array('path' => self::$i18ndir, 'domain' => 'messages'));
		$res = $this->t($input, $params);
		$this->assertEquals($exp, $res);
	}

	/**
	 * @test
	 */
	public function localeTestPreservingEnvironment() {
		$language = "pl_PL";
		putenv("LANG=" . $language);
		setlocale(LC_ALL, $language);<commit_msg>use utf8 locale, travis does not have latin1 locales<commit_after><?php

class TestLocale extends PHPUnit_Framework_TestCase {

	/** @var string */
	private static $i18ndir;

	public static function setUpBeforeClass() {
		self::setupGettext();
	}

	/**
	 * @dataProvider testData_en_US
	 * @test
	 */
	public function localeTestMissingValues($exp, $input, $params) {
		$language = "en_US.UTF-8";
		putenv("LANG=" . $language);
		setlocale(LC_ALL, $language);
		$this->locale(array('path' => self::$i18ndir, 'domain' => 'messages'));
		$res = $this->t($input, $params);
		$this->assertEquals($exp, $res);
	}

	/**
	 * @dataProvider testData_pl_PL
	 * @test
	 */
	public function localeTest($exp, $input, $params) {
		$language = "pl_PL.UTF-8";
		putenv("LANG=" . $language);
		setlocale(LC_ALL, $language);
		$this->locale(array('path' => self::$i18ndir, 'domain' => 'messages'));
		$res = $this->t($input, $params);
		$this->assertEquals($exp, $res);
	}

	/**
	 * @test
	 */
	public function localeTestPreservingEnvironment() {
		$language = "pl_PL.UTF-8";
		putenv("LANG=" . $language);
		setlocale(LC_ALL, $language);
{'fraction_non_alphanumeric': 0.19303071985327833, 'fraction_numerical': 0.007794589637780834, 'mean_word_length': 4.638242894056847, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '3908653', 'n_tokens_mistral': 825, 'n_tokens_neox': 764, 'n_words': 149}