- added function to upgrade language translations

- maintenance gate
This commit is contained in:
Peter Papp
2021-04-06 09:56:11 +02:00
parent b2d133e5a3
commit 13992deb41
9 changed files with 231 additions and 90 deletions

View File

@@ -8,7 +8,6 @@ use App\Models\Share;
use Aws\Exception\MultipartUploadException;
use Aws\S3\MultipartUploader;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
@@ -323,35 +322,4 @@ class HelperService
}
}
}
/**
* @param $license
* @param $locale
*/
function create_default_language_translations($license, $locale)
{
$translations = [
'extended' => collect([
config("language-translations.extended"),
config("language-translations.regular"),
config("custom-language-translations")
])->collapse(),
'regular' => collect([
config("language-translations.regular"),
config("custom-language-translations")
])->collapse(),
];
$translations = $translations[strtolower($license)]
->map(function ($value, $key) use ($locale) {
return [
'lang' => $locale,
'value' => $value,
'key' => $key,
];
})->toArray();
DB::table('language_translations')
->insert($translations);
}
}