2024-07-29 20:25:46 -05:00
|
|
|
@using LANCommander.SDK.Models
|
|
|
|
|
@using Semver
|
2024-07-25 19:21:52 -05:00
|
|
|
@inject UpdateService UpdateService
|
|
|
|
|
@inject ModalService ModalService
|
Add localization support to launcher
Adds localization across the launcher and includes English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Ukranian, and Chinese. These localizations were generated by Claude 3.5 and need to be reviewed by a human for accuracy.
2025-08-18 21:29:38 -05:00
|
|
|
@inject LocalizationService LocalizationService
|
2024-07-25 19:21:52 -05:00
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
UpdateService.OnUpdateAvailable += OnUpdateAvailable;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-29 20:25:46 -05:00
|
|
|
async Task OnUpdateAvailable(CheckForUpdateResponse response)
|
2024-07-25 19:21:52 -05:00
|
|
|
{
|
|
|
|
|
var confirmUpdate = await ModalService.ConfirmAsync(new ConfirmOptions
|
|
|
|
|
{
|
Add localization support to launcher
Adds localization across the launcher and includes English, German, Spanish, French, Italian, Japanese, Korean, Dutch, Portuguese, Ukranian, and Chinese. These localizations were generated by Claude 3.5 and need to be reviewed by a human for accuracy.
2025-08-18 21:29:38 -05:00
|
|
|
OkText = LocalizationService.GetString("UpdateNow"),
|
|
|
|
|
CancelText = LocalizationService.GetString("Later"),
|
|
|
|
|
Title = LocalizationService.GetString("LauncherUpdate"),
|
|
|
|
|
Content = LocalizationService.GetString("UpdateAvailableMessage", response.Version),
|
2024-07-30 01:03:18 -05:00
|
|
|
Centered = true
|
2024-07-25 19:21:52 -05:00
|
|
|
});
|
|
|
|
|
|
2024-07-29 23:51:56 -05:00
|
|
|
if (confirmUpdate && SemVersion.TryParse(response.Version, SemVersionStyles.Any, out var version))
|
2024-07-25 19:21:52 -05:00
|
|
|
{
|
2024-07-29 23:51:56 -05:00
|
|
|
await UpdateService.UpdateAsync(version);
|
2024-07-25 19:21:52 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|