script/todo.php
private function getTranslations($directory, $language)
    {
        $contentJson = '';

        $directoryJson = ($language == 'en') ? '/en/' : '/../json/';

        $fileJson = $directory.$directoryJson.$language.'.json';

        if (file_exists($fileJson)) {
            $contentJson = json_decode(file_get_contents($fileJson), true);
        }

        return [
            'json'       => $contentJson,
            'auth'       => include($directory.'/'.$language.'/auth.php'),
            'pagination' => include($directory.'/'.$language.'/pagination.php'),
            'passwords'  => include($directory.'/'.$language.'/passwords.php'),
            'validation' => include($directory.'/'.$language.'/validation.php'),
        ];
    }
private function getTranslations($directory, $language)
    {
        $contentJson = '';

        $directoryJson = ($language == 'en') ? '/en/' : '/../json/';

        $fileJson = $directory.$directoryJson.$language.'.json';

        if (file_exists($fileJson)) {
            $contentJson = json_decode(file_get_contents($fileJson), true);
        }

        return [
            'json'       => $contentJson,
            'auth'       => include($directory.'/'.$language.'/auth.php'),
            'pagination' => include($directory.'/'.$language.'/pagination.php'),
            'passwords'  => include($directory.'/'.$language.'/passwords.php'),
            'validation' => include($directory.'/'.$language.'/validation.php'),
        ];
    }
private function getTranslations ( $ directory , $ language ) { $ contentJson = '' ; $ directoryJson = ( $ language == 'en' ) ? '/en/' : '/../json/' ; $ fileJson = $ directory . $ directoryJson . $ language . '.json' ; if ( file_exists ( $ fileJson ) ) { $ contentJson = json_decode ( file_get_contents ( $ fileJson ) , true ) ; } return [ 'json' => $ contentJson , 'auth' => include ( $ directory . '/' . $ language . '/auth.php' ) , 'pagination' => include ( $ directory . '/' . $ language . '/pagination.php' ) , 'passwords' => include ( $ directory . '/' . $ language . '/passwords.php' ) , 'validation' => include ( $ directory . '/' . $ language . '/validation.php' ) , ] ; }
Returns array of translations by language.

@param string $directory directory
@param string $language  language code

@return array
Returns array of translations by language .