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.
96 lines
3 KiB
Text
96 lines
3 KiB
Text
@using LANCommander.SDK.Models
|
|
@inherits FeedbackComponent<Data.Models.Game>
|
|
@inject SaveService SaveService
|
|
@inject IMessageService MessageService
|
|
@inject LocalizationService LocalizationService
|
|
|
|
<Table DataSource="Saves" Size="TableSize.Small" PageIndex="@CurrentPage" PageSize="@PageSize" PaginationPosition="none">
|
|
<PropertyColumn Property="s => s.CreatedOn" Title="@LocalizationService.GetString("CreatedOn")" />
|
|
<PropertyColumn Property="s => s.Size">
|
|
<ByteSize Value="context.Size" />
|
|
</PropertyColumn>
|
|
<ActionColumn>
|
|
<Flex Justify="FlexJustify.End">
|
|
<Popconfirm Title="@LocalizationService.GetString("AreYouSureReplaceLocalSaves")" OnConfirm="() => Download(context)">
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" />
|
|
</Popconfirm>
|
|
|
|
<Popconfirm Title="@LocalizationService.GetString("AreYouSureDeleteSave")" OnConfirm="() => Delete(context)">
|
|
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Close" Danger />
|
|
</Popconfirm>
|
|
</Flex>
|
|
</ActionColumn>
|
|
</Table>
|
|
|
|
<GridRow Wrap="false" Style="padding: 10px 16px;">
|
|
<GridCol Flex="@("auto")" Style=";display: flex; align-items: center;">
|
|
@if (Saves.Count() > PageSize)
|
|
{
|
|
<Pagination Simple PageSize="@PageSize" OnChange="OnPageChange" Total="Saves.Count()" />
|
|
}
|
|
</GridCol>
|
|
|
|
<GridCol>
|
|
<Space Direction="SpaceDirection.Horizontal">
|
|
<SpaceItem>
|
|
<Button OnClick="() => Upload()">@LocalizationService.GetString("Upload")</Button>
|
|
</SpaceItem>
|
|
<SpaceItem>
|
|
<Button Type="ButtonType.Primary" OnClick="() => Close()">@LocalizationService.GetString("Close")</Button>
|
|
</SpaceItem>
|
|
</Space>
|
|
</GridCol>
|
|
</GridRow>
|
|
|
|
@code {
|
|
IEnumerable<GameSave> Saves = new List<GameSave>();
|
|
|
|
int PageSize = 10;
|
|
int CurrentPage = 1;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await LoadData();
|
|
}
|
|
|
|
async Task OnPageChange(PaginationEventArgs args)
|
|
{
|
|
CurrentPage = args.Page;
|
|
}
|
|
|
|
async Task Download(GameSave save)
|
|
{
|
|
await SaveService.DownloadAsync(Options.InstallDirectory, Options.Id, save.Id);
|
|
|
|
MessageService.Success(LocalizationService.GetString("SaveDownloaded"));
|
|
}
|
|
|
|
async Task Delete(GameSave save)
|
|
{
|
|
await SaveService.DeleteAsync(save.Id);
|
|
|
|
MessageService.Success(LocalizationService.GetString("SaveDeleted"));
|
|
|
|
await LoadData();
|
|
}
|
|
|
|
async Task Upload()
|
|
{
|
|
await SaveService.UploadAsync(Options.InstallDirectory, Options.Id);
|
|
|
|
MessageService.Success(LocalizationService.GetString("SaveUploaded"));
|
|
|
|
await LoadData();
|
|
}
|
|
|
|
async Task Close()
|
|
{
|
|
await CloseFeedbackAsync();
|
|
}
|
|
|
|
async Task LoadData()
|
|
{
|
|
Saves = await SaveService.Get(Options.Id);
|
|
Saves = Saves.OrderByDescending(s => s.CreatedOn);
|
|
}
|
|
}
|