-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dc6832
commit 37fe200
Showing
9 changed files
with
136 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
AudioCuesheetEditor/Resources/Localization/RecordOptions/de.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"culture": "de", | ||
"translations": { | ||
"Filename for recorded audio": "Dateiname für aufgenommenes Audio", | ||
"Record countdown timer in seconds": "Aufnahmecountdown in Sekunden", | ||
"Record time sensitivity": "Genauigkeit der Aufnahmezeiten", | ||
"TimeSensitivityMode.Full": "Alles (inkl. Millisekunden)", | ||
"TimeSensitivityMode.Seconds": "Nur Sekunden", | ||
"TimeSensitivityMode.Minutes": "Nur Minuten" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
AudioCuesheetEditor/Resources/Localization/RecordOptions/en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"culture": "en", | ||
"translations": { | ||
"Filename for recorded audio": "Filename for recorded audio", | ||
"Record time sensitivity": "Recordtime sensitivity", | ||
"TimeSensitivityMode.Full": "Everything (incl. milliseconds)", | ||
"TimeSensitivityMode.Seconds": "Only seconds", | ||
"TimeSensitivityMode.Minutes": "Only minutes" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!-- | ||
This file is part of AudioCuesheetEditor. | ||
AudioCuesheetEditor is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
AudioCuesheetEditor is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with Foobar. If not, see | ||
<http: //www.gnu.org/licenses />. | ||
--> | ||
@implements IDisposable | ||
|
||
@inject ITextLocalizer<RecordOptions> _localizer | ||
@inject LocalStorageOptionsProvider _localStorageOptionsProvider | ||
@inject ITextLocalizerService _localizationService | ||
@inject ITextLocalizer<ValidationMessage> _validationMessageLocalizer | ||
|
||
<Validations> | ||
<Validation AsyncValidator="(args, token) => ValidatorUtility<ApplicationOptions>.Validate(args, applicationOptions, x => x.RecordedAudiofilename, _validationMessageLocalizer, token)"> | ||
<Field Horizontal="true"> | ||
<FieldLabel ColumnSize="ColumnSize.Is5.OnWidescreen.Is12.OnDesktop">@_localizer["Filename for recorded audio"]</FieldLabel> | ||
<FieldBody ColumnSize="ColumnSize.Is7.OnWidescreen.Is12.OnDesktop"> | ||
@if (applicationOptions != null) | ||
{ | ||
<TextEdit @bind-Text="applicationOptions.RecordedAudiofilename" Immediate="false"> | ||
<Feedback> | ||
<ValidationError Tooltip /> | ||
</Feedback> | ||
</TextEdit> | ||
} | ||
</FieldBody> | ||
</Field> | ||
</Validation> | ||
<Field Horizontal="true"> | ||
<FieldLabel ColumnSize="ColumnSize.Is5.OnWidescreen.Is12.OnDesktop">@_localizer["Record time sensitivity"]</FieldLabel> | ||
<FieldBody ColumnSize="ColumnSize.Is7.OnWidescreen.Is12.OnDesktop"> | ||
@if (applicationOptions != null) | ||
{ | ||
<Select TValue="String" @bind-SelectedValue="@applicationOptions.RecordTimeSensitivityname"> | ||
@foreach (var name in Enum.GetNames(typeof(TimeSensitivityMode))) | ||
{ | ||
<SelectItem Value="@name">@_localizer["TimeSensitivityMode." + name]</SelectItem> | ||
} | ||
</Select> | ||
} | ||
</FieldBody> | ||
</Field> | ||
</Validations> | ||
|
||
@code { | ||
//TODO: Save each property when changed | ||
//TODO: Save, reset, reload, etc. like import options | ||
ApplicationOptions? applicationOptions; | ||
|
||
public void Dispose() | ||
{ | ||
_localizationService.LocalizationChanged -= LocalizationService_LocalizationChanged; | ||
_localStorageOptionsProvider.OptionSaved -= LocalStorageOptionsProvider_OptionsSaved; | ||
} | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
_localizationService.LocalizationChanged += LocalizationService_LocalizationChanged; | ||
_localStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionsSaved; | ||
|
||
applicationOptions = await _localStorageOptionsProvider.GetOptions<ApplicationOptions>(); | ||
await base.OnInitializedAsync(); | ||
} | ||
|
||
void LocalizationService_LocalizationChanged(object? sender, EventArgs args) | ||
{ | ||
StateHasChanged(); | ||
} | ||
|
||
void LocalStorageOptionsProvider_OptionsSaved(object? sender, IOptions options) | ||
{ | ||
if (options is ApplicationOptions applicationOption) | ||
{ | ||
applicationOptions = applicationOption; | ||
} | ||
} | ||
} |