Skip to content

Commit 1a3dd03

Browse files
committed
Fallback
1 parent 9b9c2f5 commit 1a3dd03

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Initialize/xaml.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,19 @@ try {
151151

152152
$appsUrl = "https://raw.githubusercontent.com/emadadeldev/ittea/refs/heads/main/static/Database/Applications.json"
153153
$tweaksUrl = "https://raw.githubusercontent.com/emadadeldev/ittea/refs/heads/main/static/Database/Tweaks.json"
154-
$localsUrl = "https://raw.githubusercontent.com/emadadeldev/ittea/refs/heads/main/static/Database/locales.json"
154+
#$localsUrl = "https://raw.githubusercontent.com/emadadeldev/ittea/refs/heads/main/static/Database/locales.json"
155155

156156
while ($true) {
157157
try {
158-
$aTask, $tTask, $lTask = $c.GetStringAsync($appsUrl), $c.GetStringAsync($tweaksUrl), $c.GetStringAsync($localsUrl)
159-
[Threading.Tasks.Task]::WaitAll($aTask, $tTask, $lTask)
158+
$aTask, $tTask = $c.GetStringAsync($appsUrl), $c.GetStringAsync($tweaksUrl)
159+
[Threading.Tasks.Task]::WaitAll($aTask, $tTask)
160160

161161
# $splash.FindName("status").Text = "Getting Apps"
162162
# [System.Windows.Threading.Dispatcher]::CurrentDispatcher.Invoke([Action]{}, [System.Windows.Threading.DispatcherPriority]::Render)
163163

164164
$appsData = $aTask.Result | ConvertFrom-Json
165165
$tweaksData = $tTask.Result | ConvertFrom-Json
166-
$localsUrl = $lTask.Result | ConvertFrom-Json
166+
# $localsUrl = $lTask.Result | ConvertFrom-Json
167167

168168
if ($appsData -and $tweaksData) {
169169
$itt.AppsListView.ItemsSource = $appsData
@@ -198,12 +198,12 @@ try {
198198
#{LangagesSwitch}
199199
default { "en" }
200200
}
201-
$itt["window"].DataContext = $localsUrl.Controls.$Locales
201+
$itt["window"].DataContext = $itt.database.locales.Controls.$Locales
202202
$itt.Language = $Locales
203203
}
204204
catch {
205205
# fallbak to en lang
206-
$itt["window"].DataContext = $localsUrl.Controls.en
206+
$itt["window"].DataContext = $itt.database.locales.Controls.en
207207
}
208208
#===========================================================================
209209
#endregion Set Language based on culture

scripts/UI/Message.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ function Message {
1616
$actionMap = @{ YesNo = "YesNo"; OK = "OK"; default = "OK" }
1717
$icon = if ($iconMap.ContainsKey($icon.ToLower())) { $iconMap[$icon.ToLower()] } else { $iconMap.default }
1818
$action = if ($actionMap.ContainsKey($action.ToLower())) { $actionMap[$action.ToLower()] } else { $actionMap.default }
19-
$msg = if ([string]::IsNullOrWhiteSpace($key)) { $NoneKey } else { $localsUrl.Controls.$($itt.Language).$key }
19+
$msg = if ([string]::IsNullOrWhiteSpace($key)) { $NoneKey } else { $itt.database.locales.Controls.$($itt.Language).$key }
2020
[System.Windows.MessageBox]::Show($msg, $title, [System.Windows.MessageBoxButton]::$action, [System.Windows.MessageBoxImage]::$icon)
2121
}

scripts/UI/Set-Langusege.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ function System-Default {
22

33
try {
44

5-
$dc = $localsUrl.Controls.$shortCulture
5+
$dc = $itt.database.locales.Controls.$shortCulture
66

77
if (-not $dc -or [string]::IsNullOrWhiteSpace($dc)) {
88
Set-Statusbar -Text "Your default system language is not supported yet, fallback to English"
9-
$dc = $localsUrl.Controls.en
9+
$dc = $itt.database.locales.Controls.en
1010
}
1111

1212
$itt["window"].DataContext = $dc
@@ -23,7 +23,7 @@ function Set-Language {
2323
if ($lang -eq "default") { System-Default }
2424
else {
2525
$itt.Language = $lang
26-
$itt["window"].DataContext = $localsUrl.Controls.$($itt.Language)
26+
$itt["window"].DataContext = $itt.database.locales.Controls.$($itt.Language)
2727
Set-ItemProperty -Path $itt.registryPath -Name "locales" -Value $lang -Force
2828
}
2929
}

0 commit comments

Comments
 (0)