<commit_before><?php
/**
 * This file is part of Hynage.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Hynage\Test\I18n;
use Hynage\I18n\Translator;

class TranslatorTest extends \PHPUnit_Framework_TestCase
{
    public function testReplacement()
    {
        $translator = new Translator();

        $this->assertEquals('abc', $translator->translate('abc'));
        $this->assertEquals('abc', $translator->translate('a%sc', 'b'));
        $this->assertEquals('abc1', $translator->translate('a%sc%d', 'b', 1));
    }
}<commit_msg>fixed translator test<commit_after><?php
/**
 * This file is part of Hynage.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Hynage\Test\I18n;
use Hynage\I18n\Translator;

class TranslatorTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var null|Translator
     */
    private $translator = null;
    
    
    public function setUp()
    {
        $translator = Translator::getInstance();
        
        $translator->setTranslation('de', array('hello' => 'hallo'));
        $translator->setTranslation('fr', array('hello' => 'salu'));
        
        $this->translator = $translator;
    }
    
    
    public function testReplacement()
    {
        $this->assertEquals('abc', $this->translator->translate('abc'));
        $this->assertEquals('abc', $this->translator->translate('a%sc', 'b'));
        $this->assertEquals('abc1', $this->translator->translate('a%sc%d', 'b', 1));
    }
    
    
    public function testDefaultLanguage()
    {
        $this->assertEquals('hallo', $this->translator->translate('hello'));
    }
    
    
    public function testSpecificLanguage()
    {
        $this->translator->setCurrentLanguage('fr');
        $this->assertEquals('salu', $this->translator->translate('hello'));
    }
}
{'fraction_non_alphanumeric': 0.16013882002974714, 'fraction_numerical': 0.005949429846306396, 'mean_word_length': 3.1954261954261955, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 37, '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': '4874398', 'n_tokens_mistral': 613, 'n_tokens_neox': 600, 'n_words': 132}