Move resources/lang
folder
This commit is contained in:
@@ -80,7 +80,7 @@ class LanguageController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function getLanguages()
|
public function getLanguages()
|
||||||
{
|
{
|
||||||
$path = base_path('resources/lang');
|
$path = base_path('lang');
|
||||||
$values = scandir($path); //Extracts names of directories present in lang directory
|
$values = scandir($path); //Extracts names of directories present in lang directory
|
||||||
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
|
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
|
||||||
$sysLanguage = \Cache::get('language');
|
$sysLanguage = \Cache::get('language');
|
||||||
@@ -154,7 +154,7 @@ class LanguageController extends Controller
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
//Checking if package already exists or not in lang folder
|
//Checking if package already exists or not in lang folder
|
||||||
$path = base_path('resources/lang');
|
$path = base_path('lang');
|
||||||
if (in_array(strtolower(Request::get('iso-code')), scandir($path))) {
|
if (in_array(strtolower(Request::get('iso-code')), scandir($path))) {
|
||||||
|
|
||||||
//sending back with error message
|
//sending back with error message
|
||||||
@@ -173,7 +173,7 @@ class LanguageController extends Controller
|
|||||||
if (Request::file('File')->isValid()) {
|
if (Request::file('File')->isValid()) {
|
||||||
$name = Request::file('File')->getClientOriginalName(); //uploaded file's original name
|
$name = Request::file('File')->getClientOriginalName(); //uploaded file's original name
|
||||||
$destinationPath = base_path('public/uploads/'); // defining uploading path
|
$destinationPath = base_path('public/uploads/'); // defining uploading path
|
||||||
$extractpath = base_path('resources/lang').'/'.strtolower(Request::get('iso-code')); //defining extracting path
|
$extractpath = base_path('lang').'/'.strtolower(Request::get('iso-code')); //defining extracting path
|
||||||
mkdir($extractpath); //creating directroy for extracting uploadd file
|
mkdir($extractpath); //creating directroy for extracting uploadd file
|
||||||
//mkdir($destinationPath);
|
//mkdir($destinationPath);
|
||||||
Request::file('File')->move($destinationPath, $name); // uploading file to given path
|
Request::file('File')->move($destinationPath, $name); // uploading file to given path
|
||||||
@@ -235,7 +235,7 @@ class LanguageController extends Controller
|
|||||||
{
|
{
|
||||||
if ($lang !== App::getLocale()) {
|
if ($lang !== App::getLocale()) {
|
||||||
if ($lang !== Config::get('app.fallback_locale')) {
|
if ($lang !== Config::get('app.fallback_locale')) {
|
||||||
$deletePath = base_path('resources/lang').'/'.$lang; //define file path to delete
|
$deletePath = base_path('lang').'/'.$lang; //define file path to delete
|
||||||
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
||||||
if ($success) {
|
if ($success) {
|
||||||
//sending back with success message
|
//sending back with success message
|
||||||
|
@@ -332,7 +332,7 @@ class UnAuthController extends Controller
|
|||||||
// return Cache::get('language');
|
// return Cache::get('language');
|
||||||
//} else return 'false';
|
//} else return 'false';
|
||||||
// Cache::put('language',$)
|
// Cache::put('language',$)
|
||||||
$path = base_path('resources/lang'); // Path to check available language packages
|
$path = base_path('lang'); // Path to check available language packages
|
||||||
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
|
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
|
||||||
// dd(array_key_exists($lang, Config::get('languages')));
|
// dd(array_key_exists($lang, Config::get('languages')));
|
||||||
// app()->setLocale($lang);
|
// app()->setLocale($lang);
|
||||||
@@ -426,7 +426,7 @@ class UnAuthController extends Controller
|
|||||||
*/
|
*/
|
||||||
public static function changeUserLanguage($lang)
|
public static function changeUserLanguage($lang)
|
||||||
{
|
{
|
||||||
$path = base_path('resources/lang'); // Path to check available language packages
|
$path = base_path('lang'); // Path to check available language packages
|
||||||
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
|
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
|
||||||
if (\Auth::check()) {
|
if (\Auth::check()) {
|
||||||
$id = \Auth::user()->id;
|
$id = \Auth::user()->id;
|
||||||
|
@@ -256,7 +256,7 @@ class InstallController extends Controller
|
|||||||
return redirect()->back()->with('fails', 'invalid date-time format');
|
return redirect()->back()->with('fails', 'invalid date-time format');
|
||||||
}
|
}
|
||||||
|
|
||||||
$lang_path = base_path('resources/lang');
|
$lang_path = base_path('lang');
|
||||||
|
|
||||||
//check user input language package is available or not in the system
|
//check user input language package is available or not in the system
|
||||||
if (array_key_exists($language, \Config::get('languages')) && in_array($language, scandir($lang_path))) {
|
if (array_key_exists($language, \Config::get('languages')) && in_array($language, scandir($lang_path))) {
|
||||||
|
Reference in New Issue
Block a user