<commit_before><?php

/**
 * @file
 * Default Site internationalisation engine.
 * 
 * 
 * @package i18n
 * @copyright <NAME> 2013
 * @license The MIT License (see LICENCE.txt), other licenses available.
 * @author <NAME> <<EMAIL>>
 * @link http://www.marcus-povey.co.uk
 */

namespace home_api\i18n {

    /**
     * Default translation tool
     */
    class Basic extends i18n {

        private $basepath;
        private static $languages;
        private $current_language;

        public function __construct($path, $language = 'en') {
            include_once($path . $language . '.i18n.php');
            $this->current_language = $language;
            $this->basepath = $path;
        }
        
        public static function register(array $translations, $language = 'en') {
            if ((!$translations) || (count($translations) == 0))
                return false;
<commit_msg>Plugin specific translations<commit_after><?php

/**
 * @file
 * Default Site internationalisation engine.
 * 
 * 
 * @package i18n
 * @copyright Marcus Povey 2013
 * @license The MIT License (see LICENCE.txt), other licenses available.
 * @author <NAME> <<EMAIL>>
 * @link http://www.marcus-povey.co.uk
 */

namespace home_api\i18n {

    use home_api\core\Events as Events;
    
    /**
     * Default translation tool
     */
    class Basic extends i18n {

        private $basepath;
        private static $languages;
        private $current_language;

        public function __construct($path, $language = 'en') {
            include_once($path . $language . '.i18n.php');
            $this->current_language = $language;
            $this->basepath = $path;
            
            // Plugin boot, register new translations
            Events::register('plugin', 'registered', array($this, '__pluginRegistered'));
        }
        
        /**
         * Load up a plugin's translations when registered.
         * @param type $namespace
         * @param type $event
         * @param type $parameters
         */
        public function __pluginRegistered($namespace, $event, $parameters) { 
            include_once($parameters['file_base'] . 'i18n/' . $this->current_language . '.i18n.php');
        }
        
        public static function register(array $translations, $language = 'en') {
            if ((!$translations) || (count($translations) == 0))
                return false;

{'fraction_non_alphanumeric': 0.12760633861551293, 'fraction_numerical': 0.012510425354462052, 'mean_word_length': 2.2288021534320324, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3944325', 'n_tokens_mistral': 698, 'n_tokens_neox': 660, 'n_words': 173}