<commit_before><?php

namespace Nelliel\Language;

if (!defined('NELLIEL_VERSION'))
{
    die("NOPE.AVI");
}

class Language
{
    private $authorization;

    function __construct($authorization)
    {
        $this->authorization = $authorization;
    }

    public function loadLanguage($file = null)
    {
        $gettext = new \SmallPHPGettext\SmallPHPGettext();

        if (empty($file))
        {
            $file = LOCALE_PATH . DEFAULT_LOCALE . '/LC_MESSAGES/nelliel.po';
        }

        $language_array = array();
        $loaded = false;
        $file_id = $hash = md5_file($file);
        $cache_handler = new \Nelliel\CacheHandler();

        if ($cache_handler->checkHash($file, $hash) && USE_INTERNAL_CACHE)
        {
            if (file_exists(CACHE_PATH . 'language/' . DEFAULT_LOCALE . '/LC_MESSAGES/nelliel_po.php'))
            {
                include CACHE_PATH . 'language/' . DEFAULT_LOCALE . '/LC_MESSAGES/nelliel_po.php';
                $loaded = true;
            }
        }

        if (!$loaded)
        {
            $po_parser = new \SmallPHPGettext\ParsePo();
            $language_array = $po_parser->parseFile($file);
<commit_msg>Check if language file exists and change to default if it does not<commit_after><?php

namespace Nelliel\Language;

if (!defined('NELLIEL_VERSION'))
{
    die("NOPE.AVI");
}

class Language
{
    private $authorization;

    function __construct($authorization)
    {
        $this->authorization = $authorization;
    }

    public function loadLanguage($file = null)
    {
        $gettext = new \SmallPHPGettext\SmallPHPGettext();

        if (empty($file))
        {
            $file = LOCALE_PATH . DEFAULT_LOCALE . '/LC_MESSAGES/nelliel.po';
        }

        if (!file_exists($file))
        {
            include CACHE_PATH . 'language/en_US/LC_MESSAGES/nelliel_po.php';
        }

        $language_array = array();
        $loaded = false;
        $file_id = $hash = md5_file($file);
        $cache_handler = new \Nelliel\CacheHandler();

        if ($cache_handler->checkHash($file, $hash) && USE_INTERNAL_CACHE)
        {
            if (file_exists(CACHE_PATH . 'language/' . DEFAULT_LOCALE . '/LC_MESSAGES/nelliel_po.php'))
            {
                include CACHE_PATH . 'language/' . DEFAULT_LOCALE . '/LC_MESSAGES/nelliel_po.php';
                $loaded = true;
            }
        }

        if (!$loaded)
        {
            $po_parser = new \SmallPHPGettext\ParsePo();
            $language_array = $po_parser->parseFile($file);

{'fraction_non_alphanumeric': 0.12870114488748519, 'fraction_numerical': 0.0007895775759968417, 'mean_word_length': 2.1015911872705018, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6189490', 'n_tokens_mistral': 794, 'n_tokens_neox': 771, 'n_words': 137}