mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-14 20:58:25 +10:00
lang removal refactoring
This commit is contained in:
12
Install.ps1
12
Install.ps1
@@ -1331,21 +1331,11 @@ If (Test-Path $xpui_spa_patch) {
|
||||
# Remove all languages except En and Ru from xpui.spa
|
||||
if ($ru) {
|
||||
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression') | Out-Null
|
||||
|
||||
$files = 'af.json', 'am.json', 'ar.json', 'ar-EG.json', 'ar-SA.json', 'ar-MA.json', 'az.json', 'bg.json', 'bho.json', 'bn.json', `
|
||||
'bs.json', 'cs.json', 'ca.json', 'gl.json', 'da.json', 'de.json', 'en-GB.json', 'el.json', 'es-419.json', 'es-MX.json', 'es-AR.json', 'es.json', 'et.json', 'fa.json', `
|
||||
'fi.json', 'fil.json', 'fr-CA.json', 'fr.json', 'gu.json', 'he.json', 'hi.json', 'eu.json', 'hu.json', `
|
||||
'id.json', 'is.json', 'it.json', 'ja.json', 'kn.json', 'ko.json', 'lt.json', 'lv.json', `
|
||||
'ml.json', 'mr.json', 'ms.json', 'mk.json', 'nb.json', 'ne.json', 'nl.json', 'or.json', 'pa-IN.json', `
|
||||
'pl.json', 'pt-BR.json', 'pt-PT.json', 'ro.json', 'sk.json', 'sl.json', 'sr.json', 'sv.json', `
|
||||
'sw.json' , 'ta.json', 'te.json', 'th.json', 'tr.json', 'uk.json', 'ur.json', 'vi.json', `
|
||||
'zh-CN.json', 'zh-TW.json', 'zh-HK.json', 'zu.json', 'pa-PK.json', 'hr.json'
|
||||
|
||||
$stream = New-Object IO.FileStream($xpui_spa_patch, [IO.FileMode]::Open)
|
||||
$mode = [IO.Compression.ZipArchiveMode]::Update
|
||||
$zip_xpui = New-Object IO.Compression.ZipArchive($stream, $mode)
|
||||
|
||||
($zip_xpui.Entries | Where-Object { $files -contains $_.Name }) | ForEach-Object { $_.Delete() }
|
||||
($zip_xpui.Entries | Where-Object { $_.FullName -match "i18n" -and $_.FullName -inotmatch "(ru|en.json|longest)" }) | ForEach-Object { $_.Delete() }
|
||||
|
||||
$zip_xpui.Dispose()
|
||||
$stream.Close()
|
||||
|
||||
Reference in New Issue
Block a user