|
6 | 6 | @inject Radzen.DialogService DialogService |
7 | 7 | @inject IJSRuntime JS |
8 | 8 |
|
9 | | -<RadzenStack Gap="1rem"> |
| 9 | +<RadzenStack Gap="1rem" Style="height: calc(90vh - 100px); display: flex; flex-direction: column;"> |
10 | 10 | @* Key Type Toggle *@ |
11 | 11 | @if (SupportsPluralKeys) |
12 | 12 | { |
|
90 | 90 | Density="Density.Compact" |
91 | 91 | AllowSorting="false" |
92 | 92 | AllowPaging="false" |
93 | | - Style="max-height: 400px; overflow-y: auto;"> |
| 93 | + Style="flex: 1; min-height: 200px; overflow-y: auto;"> |
94 | 94 | <Columns> |
95 | 95 | @* Language Column *@ |
96 | 96 | <RadzenDataGridColumn TItem="EditableTranslationRow" Title="Lang" Width="70px" Frozen="true"> |
|
361 | 361 | private IEnumerable<string> GetAvailablePluralForms() => |
362 | 362 | PluralForms.All.Where(pf => !_activePluralForms.Contains(pf)); |
363 | 363 |
|
364 | | - private void OnPluralFormSelected(object value) |
| 364 | + private async Task OnPluralFormSelected(object value) |
365 | 365 | { |
366 | 366 | if (value is string form && !string.IsNullOrEmpty(form)) |
367 | 367 | { |
368 | | - AddPluralForm(form); |
| 368 | + await AddPluralForm(form); |
369 | 369 | _selectedPluralForm = null; |
370 | 370 | } |
371 | 371 | } |
372 | 372 |
|
373 | | - private void AddPluralForm(string pluralForm) |
| 373 | + private async Task AddPluralForm(string pluralForm) |
374 | 374 | { |
375 | 375 | _activePluralForms.Add(pluralForm); |
376 | 376 | foreach (var lang in Languages) |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 | BuildEditableRows(); |
| 392 | + if (_grid != null) await _grid.Reload(); |
392 | 393 | NotificationService.Notify(NotificationSeverity.Info, "Added", $"Added '{pluralForm}' plural form"); |
393 | 394 | } |
394 | 395 |
|
395 | | - private void RemovePluralForm(string pluralForm) |
| 396 | + private async Task RemovePluralForm(string pluralForm) |
396 | 397 | { |
397 | 398 | if (pluralForm == PluralForms.Other) |
398 | 399 | { |
|
411 | 412 | } |
412 | 413 | } |
413 | 414 | BuildEditableRows(); |
| 415 | + if (_grid != null) await _grid.Reload(); |
414 | 416 | NotificationService.Notify(NotificationSeverity.Info, "Removed", $"Removed '{pluralForm}' plural form"); |
415 | 417 | } |
416 | 418 |
|
|
449 | 451 | _displayIsPlural = Row.IsPlural; |
450 | 452 | } |
451 | 453 |
|
452 | | - private void ConfirmConversion() |
| 454 | + private async Task ConfirmConversion() |
453 | 455 | { |
454 | 456 | _showConversionConfirm = false; |
455 | 457 |
|
|
523 | 525 |
|
524 | 526 | Row.IsPlural = _pendingIsPlural; |
525 | 527 | BuildEditableRows(); |
| 528 | + if (_grid != null) await _grid.Reload(); |
526 | 529 | NotificationService.Notify(NotificationSeverity.Success, "Converted", $"Converted to {(_pendingIsPlural ? "plural" : "single")} key"); |
527 | 530 | } |
528 | 531 |
|
|
661 | 664 | { |
662 | 665 | SyncRowsBackToTranslations(); |
663 | 666 | await OnTranslate.InvokeAsync(Row); |
664 | | - BuildEditableRows(); // Refresh after translation |
| 667 | + BuildEditableRows(); |
| 668 | + if (_grid != null) await _grid.Reload(); |
665 | 669 | } |
666 | 670 | finally |
667 | 671 | { |
|
0 commit comments