mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-06-19 22:00:04 +10:00
Merge pull request #67 from dembeck/Language-Function
Added a function to assign language strings.
This commit is contained in:
+313
-191
@@ -1,204 +1,326 @@
|
|||||||
param (
|
param
|
||||||
[Parameter()]
|
(
|
||||||
[switch]
|
[Parameter(HelpMessage = 'Remove podcasts from homepage.')]
|
||||||
$podcasts_off = $false,
|
[switch]$podcasts_off,
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$podcasts_on = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$block_update_on = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$block_update_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$cache_on = $false,
|
|
||||||
[int] $number_days = 7,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$cache_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$confirm_uninstall_ms_spoti = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$confirm_spoti_recomended_over = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$confirm_spoti_recomended_unistall = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$premium = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$start_spoti = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$exp_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$hide_col_icon_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$made_for_you_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$new_search_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$enhance_playlist_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$enhance_like_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$new_artist_pages_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$new_lyrics_off = $false,
|
|
||||||
[Parameter()]
|
|
||||||
[switch]
|
|
||||||
$ignore_in_recommendations_off = $false
|
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not remove podcasts from homepage.')]
|
||||||
|
[switch]$podcasts_on,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Block Spotify automatic updates.')]
|
||||||
|
[switch]$block_update_on,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not block Spotify automatic updates.')]
|
||||||
|
[switch]$block_update_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Enable clear cache.')]
|
||||||
|
[switch]$cache_on,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Specify the number of days. Default is 7 days.')]
|
||||||
|
[int16]$number_days = 7,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable cache clearing.')]
|
||||||
|
[switch]$cache_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Automatic uninstallation of Spotify MS if it was found.')]
|
||||||
|
[switch]$confirm_uninstall_ms_spoti,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Overwrite outdated or unsupported version of Spotify with the recommended version.')]
|
||||||
|
[switch]$confirm_spoti_recomended_over,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Uninstall outdated or unsupported version of Spotify and install the recommended version.')]
|
||||||
|
[switch]$confirm_spoti_recomended_unistall,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Installation without ad blocking for premium accounts.')]
|
||||||
|
[switch]$premium,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Automatic launch of Spotify after installation is complete.')]
|
||||||
|
[switch]$start_spoti,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Disable all experimental features.')]
|
||||||
|
[switch]$exp_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not hide the icon of collaborations in playlists.')]
|
||||||
|
[switch]$hide_col_icon_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable the made for you button on the left sidebar.')]
|
||||||
|
[switch]$made_for_you_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable new search.')]
|
||||||
|
[switch]$new_search_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable enhance playlist.')]
|
||||||
|
[switch]$enhance_playlist_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable enhance liked songs.')]
|
||||||
|
[switch]$enhance_like_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable new discography on artist.')]
|
||||||
|
[switch]$new_artist_pages_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable new lyrics.')]
|
||||||
|
[switch]$new_lyrics_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Do not enable exception playlists from recommendations.')]
|
||||||
|
[switch]$ignore_in_recommendations_off,
|
||||||
|
|
||||||
|
[Parameter(HelpMessage = 'Select the desired language to use for installation. Default is the detected system language.')]
|
||||||
|
[ValidateScript({ $_ -match '^(en|py|ru)' })]
|
||||||
|
[Alias('l')]
|
||||||
|
[string]$Language
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ignore errors from `Stop-Process`
|
# Ignore errors from `Stop-Process`
|
||||||
$PSDefaultParameterValues['Stop-Process:ErrorAction'] = [System.Management.Automation.ActionPreference]::SilentlyContinue
|
$PSDefaultParameterValues['Stop-Process:ErrorAction'] = [System.Management.Automation.ActionPreference]::SilentlyContinue
|
||||||
|
|
||||||
|
function Format-LanguageCode
|
||||||
function langRu() {
|
{
|
||||||
|
<#
|
||||||
ConvertFrom-StringData -StringData @'
|
.SYNOPSIS
|
||||||
Author = Автор:
|
Normalizes and confirms support of the selected language.
|
||||||
Incorrect = Ой, некорректное значение,
|
|
||||||
Incorrect2 = повторите ввод через
|
.DESCRIPTION
|
||||||
CuttError = Ошибка запроса в cutt
|
Normalizes the language code to the two letter form and verifies that the language is supported by the script. If the language is unsupported by the script, it defaults to English.
|
||||||
Download = Ошибка загрузки
|
|
||||||
Download2 = Повторный запрос через 5 секунд...
|
.PARAMETER LanguageCode
|
||||||
Download3 = Опять ошибка
|
Enter the desired language, language code, or culture code.
|
||||||
Download4 = Попробуйте проверить подключение к интернету и снова запустить установку
|
#>
|
||||||
Download5 = Загрузка Spotify
|
|
||||||
StopScrpit = Cкрипт остановлен
|
[CmdletBinding()]
|
||||||
MsSpoti = Обнаружена версия Spotify из Microsoft Store, которая не поддерживается
|
[OutputType([string])]
|
||||||
MsSpoti2 = Хотите удалить Spotify Microsoft Store ? [Y/N]
|
param
|
||||||
MsSpoti3 = Автоматическое удаление Spotify MS...
|
(
|
||||||
MsSpoti4 = Удаление Spotify MS...
|
[string]$LanguageCode
|
||||||
Prem = Модификация для премиум аккаунта...
|
)
|
||||||
DownBts = Загружаю последний патч BTS...
|
|
||||||
OldV = Найдена устаревшая версия Spotify
|
begin
|
||||||
OldV2 = Ваша версия Spotify {0} устарела, рекомендуется обновиться до {1}
|
{
|
||||||
OldV3 = Обновить ? [Y/N]
|
$supportLanguages = @(
|
||||||
AutoUpd = Автоматическое обновление до рекомендуемой версии
|
'en',
|
||||||
DelOrOver = Вы хотите удалить текущую версию {0} или установить поверх нее? Y [Удалить] / N [Поверх]
|
'ru'
|
||||||
DelOld = Удаление устаревшего Spotify...
|
)
|
||||||
NewV = Найдена неподдерживаемая версия Spotify
|
}
|
||||||
NewV2 = Ваша версия Spotify {0} еще не тестировалась, стабильная версия сейчас {1}
|
|
||||||
NewV3 = Хотите продолжить с {0} (возможны ошибки) ? [Y/N]
|
process
|
||||||
Recom = Хотите установить рекомендуемую {0} версию ? [Y/N]
|
{
|
||||||
DelNew = Удаление неподдерживаемого Spotify...
|
# Trim the language code down to two letter code.
|
||||||
DownSpoti = Загружаю и устанавливаю Spotify
|
switch -Regex ($LanguageCode)
|
||||||
DownSpoti2 = Пожалуйста подождите...
|
{
|
||||||
PodcatsOff = Подкасты отключены
|
'^en'
|
||||||
PodcastsOn = Подкасты не отключены
|
{
|
||||||
PodcatsSelect = Хотите отключить подкасты ? [Y/N]
|
$returnCode = 'en'
|
||||||
DowngradeNote = Рекомендуется заблокировать т.к. было понижение версии Spotify
|
break
|
||||||
UpdBlock = Обновления заблокированы
|
}
|
||||||
UpdUnblock = Обновления не заблокированы
|
'^(ru|py)'
|
||||||
UpdSelect = Хотите заблокировать обновления ? [Y/N]
|
{
|
||||||
CacheOn = Очистка кеша включена ({0})
|
$returnCode = 'ru'
|
||||||
CacheOff = Очистка кеша не включена
|
break
|
||||||
CacheSelect = Хотите установить автоматическую очистку кеша ? [Y/N]
|
}
|
||||||
CacheDays = Кэш старше: XX дней будет очищен
|
Default
|
||||||
CacheDays2 = Пожалуйста, введите количество дней от 1 до 100
|
{
|
||||||
NoVariable = Не нашел переменную
|
$returnCode = $PSUICulture.Remove(2)
|
||||||
NoVariable2 = в xpui.js
|
break
|
||||||
NoVariable3 = в licenses.html
|
}
|
||||||
NoVariable4 = в html
|
}
|
||||||
NoVariable5 = в ru.json
|
|
||||||
ModSpoti = Модифицирую Spotify...
|
# Confirm that the language code is supported by this script.
|
||||||
Error = Ошибка
|
if ($returnCode -NotIn $supportLanguages)
|
||||||
FileLocBroken = Расположение файлов Spotify нарушено, удалите клиент и снова запустите скрипт
|
{
|
||||||
Spicetify = Обнаружен Spicetify
|
# If the language code is not supported default to English.
|
||||||
NoRestore = SpotX уже был установлен, но файлы для восстановления xpui.js.bak и xpui.css.bak не найдены. `nУдалите клиент Spotify и снова запустите Install.bat
|
$returnCode = 'en'
|
||||||
ExpOff = Экспереметальные функции отключены
|
}
|
||||||
NoRestore2 = SpotX уже был установлен, но файл для восстановления xpui.bak не найден. `nУдалите клиент Spotify и снова запустите Install.bat
|
}
|
||||||
UpdateBlocked = Обновления Spotify уже заблокированы
|
|
||||||
UpdateError = Не удалось заблокировать обновления
|
end
|
||||||
NoSpotifyExe = Spotify.exe не найден
|
{
|
||||||
InstallComplete = Установка завершена
|
return $returnCode
|
||||||
'@
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Set-ScriptLanguageStrings
|
||||||
function langEn() {
|
{
|
||||||
|
<#
|
||||||
ConvertFrom-StringData -StringData @'
|
.SYNOPSIS
|
||||||
Author = Author:
|
Sets the language strings to be used.
|
||||||
Incorrect = Oops, an incorrect value,
|
|
||||||
Incorrect2 = enter again through
|
.DESCRIPTION
|
||||||
CuttError = Request error in cutt
|
Returns an object with language strings. Use the 'LanguageCode' switch to specify a language.
|
||||||
Download = Error downloading
|
|
||||||
Download2 = Will re-request in 5 seconds...
|
.PARAMETER LanguageCode
|
||||||
Download3 = Error again
|
Specify the language to be used. Two letter language codes (ex: 'en' or 'ru').
|
||||||
Download4 = Try to check your internet connection and run the installation again
|
|
||||||
Download5 = Downloading Spotify
|
.EXAMPLE
|
||||||
StopScrpit = Script is stopped
|
PS C:\> Set-ScriptLanguage -LanguageCode 'en'
|
||||||
MsSpoti = The Microsoft Store version of Spotify has been detected which is not supported
|
#>
|
||||||
MsSpoti2 = Uninstall Spotify Windows Store edition [Y/N]
|
|
||||||
MsSpoti3 = Automatic uninstalling Spotify MS...
|
[CmdletBinding()]
|
||||||
MsSpoti4 = Uninstalling Spotify MS...
|
[OutputType([object])]
|
||||||
Prem = Modification for premium account...
|
param
|
||||||
DownBts = Downloading latest patch BTS...
|
(
|
||||||
OldV = Found outdated version of Spotify
|
[Parameter(Mandatory = $true,
|
||||||
OldV2 = Your Spotify {0} version is outdated, it is recommended to upgrade to {1}
|
HelpMessage = 'Two letter language code.')]
|
||||||
OldV3 = Want to update ? [Y/N]
|
[string]$LanguageCode
|
||||||
AutoUpd = Automatic update to the recommended version
|
)
|
||||||
DelOrOver = Do you want to uninstall the current version of {0} or install over it? Y [Uninstall] / N [Install Over]
|
|
||||||
DelOld = Uninstalling old Spotify...
|
begin
|
||||||
NewV = Unsupported version of Spotify found
|
{
|
||||||
NewV2 = Your Spotify {0} version hasn't been tested yet, currently it's a stable {1} version
|
# Define language strings.
|
||||||
NewV3 = Do you want to continue with {0} version (errors possible) ? [Y/N]
|
$langStringsEN = [PSCustomObject]@{
|
||||||
Recom = Do you want to install the recommended {0} version ? [Y/N]
|
Author = "Author:"
|
||||||
DelNew = Uninstalling an untested Spotify...
|
Incorrect = "Oops, an incorrect value,"
|
||||||
DownSpoti = Downloading and installing Spotify
|
Incorrect2 = "enter again through "
|
||||||
DownSpoti2 = Please wait...
|
CuttError = "Request error in cutt"
|
||||||
PodcatsOff = Off Podcasts
|
Download = "Error downloading"
|
||||||
PodcastsOn = On Podcasts
|
Download2 = "Will re-request in 5 seconds..."
|
||||||
PodcatsSelect = Want to turn off podcasts ? [Y/N]
|
Download3 = "Error again"
|
||||||
DowngradeNote = It is recommended to block because there was a downgrade of Spotify
|
Download4 = "Try to check your internet connection and run the installation again"
|
||||||
UpdBlock = Updates blocked
|
Download5 = "Downloading Spotify"
|
||||||
UpdUnblock = Updates are not blocked
|
StopScrpit = "Script is stopped"
|
||||||
UpdSelect = Want to block updates ? [Y/N]
|
MsSpoti = "The Microsoft Store version of Spotify has been detected which is not supported"
|
||||||
CacheOn = Clear cache enabled ({0})
|
MsSpoti2 = "Uninstall Spotify Windows Store edition [Y/N]"
|
||||||
CacheOff = Clearing the cache is not enabled
|
MsSpoti3 = "Automatic uninstalling Spotify MS..."
|
||||||
CacheSelect = Want to set up automatic cache cleanup? [Y/N]
|
MsSpoti4 = "Uninstalling Spotify MS..."
|
||||||
CacheDays = Cache older: XX days to be cleared
|
Prem = "Modification for premium account..."
|
||||||
CacheDays2 = Enter the number of days from 1 to 100
|
DownBts = "Downloading latest patch BTS..."
|
||||||
NoVariable = Didn't find variable
|
OldV = "Found outdated version of Spotify"
|
||||||
NoVariable2 = in xpui.js
|
OldV2 = "Your Spotify {0} version is outdated, it is recommended to upgrade to {1}"
|
||||||
NoVariable3 = in licenses.html
|
OldV3 = "Want to update ? [Y/N]"
|
||||||
NoVariable4 = in html
|
AutoUpd = "Automatic update to the recommended version"
|
||||||
ModSpoti = Patching Spotify...
|
DelOrOver = "Do you want to uninstall the current version of {0} or install over it? Y [Uninstall] / N [Install Over]"
|
||||||
Error = Error
|
DelOld = "Uninstalling old Spotify..."
|
||||||
FileLocBroken = Location of Spotify files is broken, uninstall the client and run the script again
|
NewV = "Unsupported version of Spotify found"
|
||||||
Spicetify = Spicetify detected
|
NewV2 = "Your Spotify {0} version hasn't been tested yet, currently it's a stable {1} version"
|
||||||
NoRestore = SpotX has already been installed, xpui.js and xpui.css not found. `nPlease uninstall Spotify client and run Install.bat again
|
NewV3 = "Do you want to continue with {0} version (errors possible) ? [Y/N]"
|
||||||
ExpOff = Experimental features disabled
|
Recom = "Do you want to install the recommended {0} version ? [Y/N]"
|
||||||
NoRestore2 = SpotX has already been installed, xpui.bak not found. `nPlease uninstall Spotify client and run Install.bat again
|
DelNew = "Uninstalling an untested Spotify..."
|
||||||
UpdateBlocked = Spotify updates are already blocked
|
DownSpoti = "Downloading and installing Spotify"
|
||||||
UpdateError = Failed to block updates
|
DownSpoti2 = "Please wait..."
|
||||||
NoSpotifyExe = Could not find Spotify.exe
|
PodcatsOff = "Off Podcasts"
|
||||||
InstallComplete = installation completed
|
PodcastsOn = "On Podcasts"
|
||||||
'@
|
PodcatsSelect = "Want to turn off podcasts ? [Y/N]"
|
||||||
|
DowngradeNote = "It is recommended to block because there was a downgrade of Spotify"
|
||||||
|
UpdBlock = "Updates blocked"
|
||||||
|
UpdUnblock = "Updates are not blocked"
|
||||||
|
UpdSelect = "Want to block updates ? [Y/N]"
|
||||||
|
CacheOn = "Clear cache enabled ({0})"
|
||||||
|
CacheOff = "Clearing the cache is not enabled"
|
||||||
|
CacheSelect = "Want to set up automatic cache cleanup? [Y/N]"
|
||||||
|
CacheDays = "Cache older: XX days to be cleared "
|
||||||
|
CacheDays2 = "Enter the number of days from 1 to 100"
|
||||||
|
NoVariable = "Didn't find variable"
|
||||||
|
NoVariable2 = "in xpui.js"
|
||||||
|
NoVariable3 = "in licenses.html"
|
||||||
|
NoVariable4 = "in html"
|
||||||
|
ModSpoti = "Patching Spotify..."
|
||||||
|
Error = "Error"
|
||||||
|
FileLocBroken = "Location of Spotify files is broken, uninstall the client and run the script again"
|
||||||
|
Spicetify = "Spicetify detected"
|
||||||
|
NoRestore = "SpotX has already been installed, xpui.js and xpui.css not found. `nPlease uninstall Spotify client and run Install.bat again"
|
||||||
|
ExpOff = "Experimental features disabled"
|
||||||
|
NoRestore2 = "SpotX has already been installed, xpui.bak not found. `nPlease uninstall Spotify client and run Install.bat again"
|
||||||
|
UpdateBlocked = "Spotify updates are already blocked"
|
||||||
|
UpdateError = "Failed to block updates"
|
||||||
|
NoSpotifyExe = "Could not find Spotify.exe"
|
||||||
|
InstallComplete = "installation completed"
|
||||||
|
}
|
||||||
|
|
||||||
|
$langStringsRU = [PSCustomObject]@{
|
||||||
|
Author = "Автор:"
|
||||||
|
Incorrect = "Ой, некорректное значение,"
|
||||||
|
Incorrect2 = "повторите ввод через"
|
||||||
|
CuttError = "Ошибка запроса в cutt"
|
||||||
|
Download = "Ошибка загрузки"
|
||||||
|
Download2 = "Повторный запрос через 5 секунд..."
|
||||||
|
Download3 = "Опять ошибка"
|
||||||
|
Download4 = "Попробуйте проверить подключение к интернету и снова запустить установку"
|
||||||
|
Download5 = "Загрузка Spotify"
|
||||||
|
StopScrpit = "Cкрипт остановлен"
|
||||||
|
MsSpoti = "Обнаружена версия Spotify из Microsoft Store, которая не поддерживается"
|
||||||
|
MsSpoti2 = "Хотите удалить Spotify Microsoft Store ? [Y/N]"
|
||||||
|
MsSpoti3 = "Автоматическое удаление Spotify MS..."
|
||||||
|
MsSpoti4 = "Удаление Spotify MS..."
|
||||||
|
Prem = "Модификация для премиум аккаунта..."
|
||||||
|
DownBts = "Загружаю последний патч BTS..."
|
||||||
|
OldV = "Найдена устаревшая версия Spotify"
|
||||||
|
OldV2 = "Ваша версия Spotify {0} устарела, рекомендуется обновиться до {1}"
|
||||||
|
OldV3 = "Обновить ? [Y/N]"
|
||||||
|
AutoUpd = "Автоматическое обновление до рекомендуемой версии"
|
||||||
|
DelOrOver = "Вы хотите удалить текущую версию {0} или установить поверх нее? Y [Удалить] / N [Поверх]"
|
||||||
|
DelOld = "Удаление устаревшего Spotify..."
|
||||||
|
NewV = "Найдена неподдерживаемая версия Spotify"
|
||||||
|
NewV2 = "Ваша версия Spotify {0} еще не тестировалась, стабильная версия сейчас {1}"
|
||||||
|
NewV3 = "Хотите продолжить с {0} (возможны ошибки) ? [Y/N]"
|
||||||
|
Recom = "Хотите установить рекомендуемую {0} версию ? [Y/N]"
|
||||||
|
DelNew = "Удаление неподдерживаемого Spotify..."
|
||||||
|
DownSpoti = "Загружаю и устанавливаю Spotify"
|
||||||
|
DownSpoti2 = "Пожалуйста подождите..."
|
||||||
|
PodcatsOff = "Подкасты отключены"
|
||||||
|
PodcastsOn = "Подкасты не отключены"
|
||||||
|
PodcatsSelect = "Хотите отключить подкасты ? [Y/N]"
|
||||||
|
DowngradeNote = "Рекомендуется заблокировать т.к. было понижение версии Spotify"
|
||||||
|
UpdBlock = "Обновления заблокированы"
|
||||||
|
UpdUnblock = "Обновления не заблокированы"
|
||||||
|
UpdSelect = "Хотите заблокировать обновления ? [Y/N]"
|
||||||
|
CacheOn = "Очистка кеша включена ({0})"
|
||||||
|
CacheOff = "Очистка кеша не включена"
|
||||||
|
CacheSelect = "Хотите установить автоматическую очистку кеша ? [Y/N]"
|
||||||
|
CacheDays = "Кэш старше: XX дней будет очищен"
|
||||||
|
CacheDays2 = "Пожалуйста, введите количество дней от 1 до 100"
|
||||||
|
NoVariable = "Не нашел переменную"
|
||||||
|
NoVariable2 = "в xpui.js"
|
||||||
|
NoVariable3 = "в licenses.html"
|
||||||
|
NoVariable4 = "в html"
|
||||||
|
NoVariable5 = "в ru.json"
|
||||||
|
ModSpoti = "Модифицирую Spotify..."
|
||||||
|
Error = "Ошибка"
|
||||||
|
FileLocBroken = "Расположение файлов Spotify нарушено, удалите клиент и снова запустите скрипт"
|
||||||
|
Spicetify = "Обнаружен Spicetify"
|
||||||
|
NoRestore = "SpotX уже был установлен, но файлы для восстановления xpui.js.bak и xpui.css.bak не найдены. `nУдалите клиент Spotify и снова запустите Install.bat"
|
||||||
|
ExpOff = "Экспереметальные функции отключены"
|
||||||
|
NoRestore2 = "SpotX уже был установлен, но файл для восстановления xpui.bak не найден. `nУдалите клиент Spotify и снова запустите Install.bat"
|
||||||
|
UpdateBlocked = "Обновления Spotify уже заблокированы"
|
||||||
|
UpdateError = "Не удалось заблокировать обновления"
|
||||||
|
NoSpotifyExe = "Spotify.exe не найден"
|
||||||
|
InstallComplete = "Установка завершена"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
process
|
||||||
|
{
|
||||||
|
# Assign language strings.
|
||||||
|
switch ($LangCode)
|
||||||
|
{
|
||||||
|
'en'
|
||||||
|
{
|
||||||
|
$langStrings = $langStringsEN
|
||||||
|
break
|
||||||
|
}
|
||||||
|
'ru'
|
||||||
|
{
|
||||||
|
$langStrings = $langStringsRU
|
||||||
|
break
|
||||||
|
}
|
||||||
|
Default
|
||||||
|
{
|
||||||
|
# Default to English if unable to find a match.
|
||||||
|
$langStrings = $langStringsEN
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
{
|
||||||
|
return $langStrings
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Checking the system language
|
# Set language code for script.
|
||||||
$langTest = [CultureInfo]::InstalleduICulture
|
$langCode = Format-LanguageCode -LanguageCode $Language
|
||||||
|
|
||||||
if ($langTest -eq 'ru-Ru') { $lang = langRu; $ru = $true }
|
# Set script language strings.
|
||||||
else { $lang = langEn }
|
$lang = Set-ScriptLanguageStrings -LanguageCode $langCode
|
||||||
|
|
||||||
|
# Set variable 'ru'.
|
||||||
|
if ($langCode -eq 'ru') { $ru = $true }
|
||||||
|
|
||||||
|
|
||||||
Write-Host "*****************"
|
Write-Host "*****************"
|
||||||
@@ -1420,4 +1542,4 @@ if ($cache_install) {
|
|||||||
if ($start_spoti) { Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable }
|
if ($start_spoti) { Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable }
|
||||||
|
|
||||||
Write-Host ($lang).InstallComplete`n -ForegroundColor Green
|
Write-Host ($lang).InstallComplete`n -ForegroundColor Green
|
||||||
exit
|
exit
|
||||||
|
|||||||
Reference in New Issue
Block a user