From 2adc7f217977aa1c74f8cfbbc6dc0c0094ba91fb Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Fri, 6 Dec 2024 21:05:25 +1100 Subject: [PATCH 01/12] Add first amount of i18n --- LiftLog.Ui/LiftLog.Ui.csproj | 24 +++- LiftLog.Ui/Pages/Index.razor | 4 +- ...creenshotCollectorPage.ExerciseEditPage.cs | 6 + LiftLog.Ui/ServiceRegistration.cs | 3 +- LiftLog.Ui/_Imports.razor | 2 + LiftLog.Ui/i18n/UiStrings.resx | 124 ++++++++++++++++++ 6 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 LiftLog.Ui/i18n/UiStrings.resx diff --git a/LiftLog.Ui/LiftLog.Ui.csproj b/LiftLog.Ui/LiftLog.Ui.csproj index 3b1ed0ab..13500ec6 100644 --- a/LiftLog.Ui/LiftLog.Ui.csproj +++ b/LiftLog.Ui/LiftLog.Ui.csproj @@ -8,7 +8,23 @@ true CS8524;CS1998 - + + $(AdditionalFileItemNames);EmbeddedResource + PrepareResources;$(CompileDependsOn) + + + + + MSBuild:Compile + UiStrings.Designer.cs + + $(IntermediateOutputPath)\UiStrings.Designer.cs + CSharp + LiftLog.Ui.i18n + UiStrings + + + $(DefineConstants);$(ExtraDefineConstants) @@ -32,6 +48,7 @@ + @@ -44,9 +61,12 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + - diff --git a/LiftLog.Ui/Pages/Index.razor b/LiftLog.Ui/Pages/Index.razor index ae324ab4..2ecf6977 100644 --- a/LiftLog.Ui/Pages/Index.razor +++ b/LiftLog.Ui/Pages/Index.razor @@ -6,6 +6,8 @@ @page "/" @inherits Fluxor.Blazor.Web.Components.FluxorComponent +@inject IStringLocalizer UiStrings + @inject IState ProgramState @inject IState AppState @inject IState SettingsState @@ -72,7 +74,7 @@ else auto_awesome } - + fitness_center diff --git a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs index b057af55..66bc1fdf 100644 --- a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs +++ b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs @@ -3,11 +3,17 @@ using LiftLog.Ui.Store.App; using LiftLog.Ui.Store.CurrentSession; using LiftLog.Ui.Store.Program; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Localization; +using LiftLog.Ui.i18n; namespace LiftLog.Ui.Pages.Screenshot; public partial class ScreenshotCollectorPage { + [Inject] + private IStringLocalizer UiStrings { get; set; } = null!; + private async Task HandleExerciseEditorScreenshotCollection() { Dispatcher.Dispatch( diff --git a/LiftLog.Ui/ServiceRegistration.cs b/LiftLog.Ui/ServiceRegistration.cs index ebf44662..c0f4f0f5 100644 --- a/LiftLog.Ui/ServiceRegistration.cs +++ b/LiftLog.Ui/ServiceRegistration.cs @@ -10,7 +10,6 @@ using LiftLog.Ui.Store.Program; using LiftLog.Ui.Store.Settings; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; #if DEBUG using Fluxor.Blazor.Web.ReduxDevTools; #endif @@ -69,6 +68,8 @@ public static IServiceCollection RegisterUiServices< services.Add(lifetime); services.Add(lifetime); + services.AddLocalization(); + services.Add< BlazorTransitionableRoute.IRouteTransitionInvoker, BlazorTransitionableRoute.DefaultRouteTransitionInvoker diff --git a/LiftLog.Ui/_Imports.razor b/LiftLog.Ui/_Imports.razor index a6c878e6..4f85fb6c 100644 --- a/LiftLog.Ui/_Imports.razor +++ b/LiftLog.Ui/_Imports.razor @@ -5,6 +5,7 @@ @using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Logging @using Microsoft.JSInterop @using LiftLog.Ui.Shared @@ -28,5 +29,6 @@ @using LiftLog.Ui.Store.Stats @using LiftLog.Ui.Store.AiSessionCreator @using LiftLog.Ui.Store.Feed +@using LiftLog.Ui.i18n @using BlazorTransitionableRoute @using LiftLog.Ui.Shared.Smart.Tips diff --git a/LiftLog.Ui/i18n/UiStrings.resx b/LiftLog.Ui/i18n/UiStrings.resx new file mode 100644 index 00000000..c6eb275f --- /dev/null +++ b/LiftLog.Ui/i18n/UiStrings.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Freeform Session + + + From aeafab57158b8c55248eb865ce9ebb7f06142948 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Fri, 6 Dec 2024 21:09:50 +1100 Subject: [PATCH 02/12] Comments are king --- LiftLog.Ui/LiftLog.Ui.csproj | 38 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/LiftLog.Ui/LiftLog.Ui.csproj b/LiftLog.Ui/LiftLog.Ui.csproj index 13500ec6..09b1a650 100644 --- a/LiftLog.Ui/LiftLog.Ui.csproj +++ b/LiftLog.Ui/LiftLog.Ui.csproj @@ -5,26 +5,28 @@ enable enable true - true - - CS8524;CS1998 - - $(AdditionalFileItemNames);EmbeddedResource - PrepareResources;$(CompileDependsOn) + true + + CS8524;CS1998 + + $(AdditionalFileItemNames);EmbeddedResource + PrepareResources;$(CompileDependsOn) - - - - MSBuild:Compile - UiStrings.Designer.cs - - $(IntermediateOutputPath)\UiStrings.Designer.cs - CSharp - LiftLog.Ui.i18n - UiStrings - + + + + + + MSBuild:Compile + UiStrings.Designer.cs + + $(IntermediateOutputPath)\UiStrings.Designer.cs + CSharp + LiftLog.Ui.i18n + UiStrings + - + $(DefineConstants);$(ExtraDefineConstants) From da18647b8f7a094e426c49eabc58ab87733dead6 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Fri, 6 Dec 2024 22:27:38 +1100 Subject: [PATCH 03/12] More strings localized --- LiftLog.Ui/Pages/Feed/FeedPage.razor | 5 ++- LiftLog.Ui/Pages/History/HistoryPage.razor | 4 ++- .../Pages/Settings/ManageSessionPage.razor | 3 +- LiftLog.Ui/Pages/StatsPage.razor | 4 ++- .../Presentation/WeightedExercise.razor | 11 +++--- LiftLog.Ui/Shared/Smart/NavBar.razor | 12 ++++--- .../Shared/Smart/SessionComponent.razor | 4 ++- LiftLog.Ui/i18n/UiStrings.resx | 36 +++++++++++++++++++ 8 files changed, 65 insertions(+), 14 deletions(-) diff --git a/LiftLog.Ui/Pages/Feed/FeedPage.razor b/LiftLog.Ui/Pages/Feed/FeedPage.razor index 2dbd43b4..60ce02eb 100644 --- a/LiftLog.Ui/Pages/Feed/FeedPage.razor +++ b/LiftLog.Ui/Pages/Feed/FeedPage.razor @@ -5,6 +5,9 @@ @inject IJSRuntime JSRuntime @inject IState FeedState @inject NavigationManager NavigationManager + +@inject IStringLocalizer UiStrings + @inject IDispatcher Dispatcher @inherits Fluxor.Blazor.Web.Components.FluxorComponent @@ -132,7 +135,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("Feed")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Feed())); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); Dispatcher.Dispatch(new FetchSessionFeedItemsAction(FromUserAction: false)); Dispatcher.Dispatch(new FetchInboxItemsAction(FromUserAction: false)); diff --git a/LiftLog.Ui/Pages/History/HistoryPage.razor b/LiftLog.Ui/Pages/History/HistoryPage.razor index a621b531..74aa7cd0 100644 --- a/LiftLog.Ui/Pages/History/HistoryPage.razor +++ b/LiftLog.Ui/Pages/History/HistoryPage.razor @@ -13,6 +13,8 @@ @inject IDispatcher Dispatcher @inject ILogger Logger +@inject IStringLocalizer UiStrings + @if (!_latestSessions.Any()) { @@ -104,7 +106,7 @@ else protected override async Task OnInitializedAsync() { var sw = System.Diagnostics.Stopwatch.StartNew(); - Dispatcher.Dispatch(new SetPageTitleAction("History")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.History())); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); Dispatcher.Dispatch(new SetReopenCurrentSessionAction(SessionTarget.HistorySession, false)); Dispatcher.Dispatch(new SetCurrentSessionAction(SessionTarget.HistorySession, null)); diff --git a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor index f368f9af..f0e65cbb 100644 --- a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor +++ b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor @@ -6,6 +6,7 @@ @page "/settings/manage-workouts/manage-session/{sessionIndex:int}" @inherits Fluxor.Blazor.Web.Components.FluxorComponent +@inject IStringLocalizer UiStrings @inject NavigationManager NavigationManager @inject IState SessionEditorState @inject IState ProgramState @@ -73,7 +74,7 @@ This will remove the exercise "@(selectedExercise?.Name)" from @SessionEditorState.Value.SessionBlueprint?.Name.
Cancel - Remove + @(UiStrings.Remove())
diff --git a/LiftLog.Ui/Pages/StatsPage.razor b/LiftLog.Ui/Pages/StatsPage.razor index 00af41c6..3b8cd86c 100644 --- a/LiftLog.Ui/Pages/StatsPage.razor +++ b/LiftLog.Ui/Pages/StatsPage.razor @@ -6,6 +6,8 @@ @inject IState StatsState; @inject IDispatcher Dispatcher; +@inject IStringLocalizer UiStrings +
@@ -112,7 +114,7 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null { base.OnInitialized(); Dispatcher.Dispatch(new FetchOverallStatsAction()); - Dispatcher.Dispatch(new SetPageTitleAction("Statistics")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Statistics())); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); } diff --git a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor index 23896d92..0fd36b44 100644 --- a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor +++ b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor @@ -1,4 +1,7 @@ -@{ + +@inject IStringLocalizer UiStrings + +@{ var displayedExercise = RecordedExercise; var setToStartNext = RecordedExercise.PotentialSets.IndexOf(x => x.Set is null); var previousNotes = PreviousRecordedExercises?.FirstOrDefault()?.RecordedExercise?.Notes ?? ""; @@ -20,9 +23,9 @@
- - - + + + @if(Uri.IsWellFormedUriString(displayedExercise.Blueprint.Link, UriKind.Absolute)) { diff --git a/LiftLog.Ui/Shared/Smart/NavBar.razor b/LiftLog.Ui/Shared/Smart/NavBar.razor index 4cee784f..ea29b4fb 100644 --- a/LiftLog.Ui/Shared/Smart/NavBar.razor +++ b/LiftLog.Ui/Shared/Smart/NavBar.razor @@ -7,19 +7,21 @@ @inject IState SettingsState @inject IDispatcher Dispatcher @inject InsetsManager InsetsManager +@inject IStringLocalizer UiStrings @inherits Fluxor.Blazor.Web.Components.FluxorComponent + diff --git a/LiftLog.Ui/Shared/Smart/SessionComponent.razor b/LiftLog.Ui/Shared/Smart/SessionComponent.razor index 70695dfe..9e3d6b95 100644 --- a/LiftLog.Ui/Shared/Smart/SessionComponent.razor +++ b/LiftLog.Ui/Shared/Smart/SessionComponent.razor @@ -4,6 +4,8 @@ @inject IState CurrentSessionState @inject IDispatcher Dispatcher +@inject IStringLocalizer UiStrings + @if(Session.Blueprint.Notes != "") { @@ -121,7 +123,7 @@ else
Cancel - Remove + @(UiStrings.Remove())
diff --git a/LiftLog.Ui/i18n/UiStrings.resx b/LiftLog.Ui/i18n/UiStrings.resx index c6eb275f..3eca09ff 100644 --- a/LiftLog.Ui/i18n/UiStrings.resx +++ b/LiftLog.Ui/i18n/UiStrings.resx @@ -121,4 +121,40 @@ Freeform Session + + Edit + + + + Notes + + + + Remove + + + + Workout + + + + Feed + + + + Stats + + + + History + + + + Settings + + + + Statistics + + From 2a9923f382200916dded8bee51542970bee1bc90 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Fri, 6 Dec 2024 23:23:19 +1100 Subject: [PATCH 04/12] Use more resx translations --- LiftLog.Ui/Pages/Feed/FeedPage.razor | 8 +++----- LiftLog.Ui/Pages/History/HistoryPage.razor | 1 - LiftLog.Ui/Pages/Index.razor | 2 -- .../ScreenshotCollectorPage.ExerciseEditPage.cs | 2 -- LiftLog.Ui/Pages/Settings/ManageSessionPage.razor | 1 - LiftLog.Ui/Pages/StatsPage.razor | 1 - LiftLog.Ui/Shared/Presentation/WeightedExercise.razor | 5 +---- LiftLog.Ui/Shared/Smart/NavBar.razor | 1 - LiftLog.Ui/Shared/Smart/SessionComponent.razor | 2 -- LiftLog.Ui/_Imports.razor | 1 + LiftLog.Ui/i18n/UiStrings.resx | 8 ++++++++ LiftLog.Web/wwwroot/index.html | 1 - 12 files changed, 13 insertions(+), 20 deletions(-) diff --git a/LiftLog.Ui/Pages/Feed/FeedPage.razor b/LiftLog.Ui/Pages/Feed/FeedPage.razor index 60ce02eb..34f9d4d0 100644 --- a/LiftLog.Ui/Pages/Feed/FeedPage.razor +++ b/LiftLog.Ui/Pages/Feed/FeedPage.razor @@ -6,19 +6,17 @@ @inject IState FeedState @inject NavigationManager NavigationManager -@inject IStringLocalizer UiStrings - @inject IDispatcher Dispatcher @inherits Fluxor.Blazor.Web.Components.FluxorComponent
- Feed - Following + @(UiStrings.Feed()) + @(UiStrings.Feed_Following()) - Followers + @(UiStrings.Feed_Followers()) @if (FeedState.Value.FollowRequests is { Count: > 0 }) {
diff --git a/LiftLog.Ui/Pages/History/HistoryPage.razor b/LiftLog.Ui/Pages/History/HistoryPage.razor index 74aa7cd0..8f7a0b66 100644 --- a/LiftLog.Ui/Pages/History/HistoryPage.razor +++ b/LiftLog.Ui/Pages/History/HistoryPage.razor @@ -13,7 +13,6 @@ @inject IDispatcher Dispatcher @inject ILogger Logger -@inject IStringLocalizer UiStrings @if (!_latestSessions.Any()) { diff --git a/LiftLog.Ui/Pages/Index.razor b/LiftLog.Ui/Pages/Index.razor index 2ecf6977..75ed83c9 100644 --- a/LiftLog.Ui/Pages/Index.razor +++ b/LiftLog.Ui/Pages/Index.razor @@ -6,8 +6,6 @@ @page "/" @inherits Fluxor.Blazor.Web.Components.FluxorComponent -@inject IStringLocalizer UiStrings - @inject IState ProgramState @inject IState AppState @inject IState SettingsState diff --git a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs index 66bc1fdf..33d6f4c3 100644 --- a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs +++ b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs @@ -11,8 +11,6 @@ namespace LiftLog.Ui.Pages.Screenshot; public partial class ScreenshotCollectorPage { - [Inject] - private IStringLocalizer UiStrings { get; set; } = null!; private async Task HandleExerciseEditorScreenshotCollection() { diff --git a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor index f0e65cbb..dd95c2f4 100644 --- a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor +++ b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor @@ -6,7 +6,6 @@ @page "/settings/manage-workouts/manage-session/{sessionIndex:int}" @inherits Fluxor.Blazor.Web.Components.FluxorComponent -@inject IStringLocalizer UiStrings @inject NavigationManager NavigationManager @inject IState SessionEditorState @inject IState ProgramState diff --git a/LiftLog.Ui/Pages/StatsPage.razor b/LiftLog.Ui/Pages/StatsPage.razor index 3b8cd86c..56e07514 100644 --- a/LiftLog.Ui/Pages/StatsPage.razor +++ b/LiftLog.Ui/Pages/StatsPage.razor @@ -6,7 +6,6 @@ @inject IState StatsState; @inject IDispatcher Dispatcher; -@inject IStringLocalizer UiStrings
diff --git a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor index 0fd36b44..90c2de34 100644 --- a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor +++ b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor @@ -1,7 +1,4 @@ - -@inject IStringLocalizer UiStrings - -@{ +@{ var displayedExercise = RecordedExercise; var setToStartNext = RecordedExercise.PotentialSets.IndexOf(x => x.Set is null); var previousNotes = PreviousRecordedExercises?.FirstOrDefault()?.RecordedExercise?.Notes ?? ""; diff --git a/LiftLog.Ui/Shared/Smart/NavBar.razor b/LiftLog.Ui/Shared/Smart/NavBar.razor index ea29b4fb..92c3ffce 100644 --- a/LiftLog.Ui/Shared/Smart/NavBar.razor +++ b/LiftLog.Ui/Shared/Smart/NavBar.razor @@ -7,7 +7,6 @@ @inject IState SettingsState @inject IDispatcher Dispatcher @inject InsetsManager InsetsManager -@inject IStringLocalizer UiStrings @inherits Fluxor.Blazor.Web.Components.FluxorComponent diff --git a/LiftLog.Ui/Shared/Smart/SessionComponent.razor b/LiftLog.Ui/Shared/Smart/SessionComponent.razor index 9e3d6b95..0ba878be 100644 --- a/LiftLog.Ui/Shared/Smart/SessionComponent.razor +++ b/LiftLog.Ui/Shared/Smart/SessionComponent.razor @@ -4,8 +4,6 @@ @inject IState CurrentSessionState @inject IDispatcher Dispatcher -@inject IStringLocalizer UiStrings - @if(Session.Blueprint.Notes != "") { diff --git a/LiftLog.Ui/_Imports.razor b/LiftLog.Ui/_Imports.razor index 4f85fb6c..ed378e9a 100644 --- a/LiftLog.Ui/_Imports.razor +++ b/LiftLog.Ui/_Imports.razor @@ -32,3 +32,4 @@ @using LiftLog.Ui.i18n @using BlazorTransitionableRoute @using LiftLog.Ui.Shared.Smart.Tips +@inject IStringLocalizer UiStrings diff --git a/LiftLog.Ui/i18n/UiStrings.resx b/LiftLog.Ui/i18n/UiStrings.resx index 3eca09ff..663add3d 100644 --- a/LiftLog.Ui/i18n/UiStrings.resx +++ b/LiftLog.Ui/i18n/UiStrings.resx @@ -157,4 +157,12 @@ Statistics + + Following + + + + Followers + + diff --git a/LiftLog.Web/wwwroot/index.html b/LiftLog.Web/wwwroot/index.html index 55ba6e38..bc28143f 100644 --- a/LiftLog.Web/wwwroot/index.html +++ b/LiftLog.Web/wwwroot/index.html @@ -49,6 +49,5 @@ - From 9b0fa07e19b30bbe11d021fe248f58386dd9ea13 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sat, 7 Dec 2024 12:50:08 +1100 Subject: [PATCH 05/12] Switch to codegenned ui strings --- LiftLog.Ui/Pages/Feed/FeedPage.razor | 8 +- LiftLog.Ui/Pages/History/HistoryPage.razor | 2 +- LiftLog.Ui/Pages/Index.razor | 15 ++- .../Pages/Settings/ManageSessionPage.razor | 4 +- LiftLog.Ui/Pages/StatsPage.razor | 75 ++++++++---- LiftLog.Ui/ServiceRegistration.cs | 2 + .../Presentation/WeightedExercise.razor | 8 +- LiftLog.Ui/Shared/Smart/BackupAlert.razor | 11 +- LiftLog.Ui/Shared/Smart/NavBar.razor | 10 +- .../Shared/Smart/SessionComponent.razor | 4 +- LiftLog.Ui/_Imports.razor | 2 +- LiftLog.Ui/i18n/UiStrings.resx | 108 ++++++++++++++++++ 12 files changed, 192 insertions(+), 57 deletions(-) diff --git a/LiftLog.Ui/Pages/Feed/FeedPage.razor b/LiftLog.Ui/Pages/Feed/FeedPage.razor index 34f9d4d0..aaf35e47 100644 --- a/LiftLog.Ui/Pages/Feed/FeedPage.razor +++ b/LiftLog.Ui/Pages/Feed/FeedPage.razor @@ -12,11 +12,11 @@
- @(UiStrings.Feed()) - @(UiStrings.Feed_Following()) + @UiStrings.Feed + @UiStrings.Feed_Following - @(UiStrings.Feed_Followers()) + @UiStrings.Feed_Followers @if (FeedState.Value.FollowRequests is { Count: > 0 }) {
@@ -133,7 +133,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Feed())); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Feed)); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); Dispatcher.Dispatch(new FetchSessionFeedItemsAction(FromUserAction: false)); Dispatcher.Dispatch(new FetchInboxItemsAction(FromUserAction: false)); diff --git a/LiftLog.Ui/Pages/History/HistoryPage.razor b/LiftLog.Ui/Pages/History/HistoryPage.razor index 8f7a0b66..88a577c1 100644 --- a/LiftLog.Ui/Pages/History/HistoryPage.razor +++ b/LiftLog.Ui/Pages/History/HistoryPage.razor @@ -105,7 +105,7 @@ else protected override async Task OnInitializedAsync() { var sw = System.Diagnostics.Stopwatch.StartNew(); - Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.History())); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.History)); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); Dispatcher.Dispatch(new SetReopenCurrentSessionAction(SessionTarget.HistorySession, false)); Dispatcher.Dispatch(new SetCurrentSessionAction(SessionTarget.HistorySession, null)); diff --git a/LiftLog.Ui/Pages/Index.razor b/LiftLog.Ui/Pages/Index.razor index 75ed83c9..ea7681e2 100644 --- a/LiftLog.Ui/Pages/Index.razor +++ b/LiftLog.Ui/Pages/Index.razor @@ -25,7 +25,7 @@
- No plan created yet! + @UiStrings.NoPlanCreated info
@@ -33,13 +33,13 @@ add - Add Workouts + @UiStrings.AddWorkouts NavigationManager.NavigateTo("/settings/program-list"))> assignment - Select a plan + @UiStrings.SelectAPlan
@@ -72,7 +72,7 @@ else auto_awesome } - + fitness_center
@@ -81,10 +81,9 @@ else - Replace current session + @UiStrings.ReplaceCurrentSession - There is already a current session in progress, start a new one without - saving? + @UiStrings.SessionInProgress @@ -97,7 +96,7 @@ else protected override async Task OnInitializedAsync() { - Dispatcher.Dispatch(new SetPageTitleAction("Upcoming Workouts")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.UpcomingWorkouts)); Dispatcher.Dispatch(new FetchUpcomingSessionsAction()); Dispatcher.Dispatch(new SetReopenCurrentSessionAction(SessionTarget.WorkoutSession, false)); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); diff --git a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor index dd95c2f4..87e9a95f 100644 --- a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor +++ b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor @@ -72,8 +72,8 @@ Remove Exercise? This will remove the exercise "@(selectedExercise?.Name)" from @SessionEditorState.Value.SessionBlueprint?.Name.
- Cancel - @(UiStrings.Remove()) + @UiStrings.Cancel + @UiStrings.Remove
diff --git a/LiftLog.Ui/Pages/StatsPage.razor b/LiftLog.Ui/Pages/StatsPage.razor index 56e07514..cc8d3cd0 100644 --- a/LiftLog.Ui/Pages/StatsPage.razor +++ b/LiftLog.Ui/Pages/StatsPage.razor @@ -8,8 +8,17 @@
- - +
@@ -18,17 +27,17 @@ {
- +
-

Calculating...

+

@UiStrings.Calculating

} else if ((StatsState.Value.OverallView?.SessionStats.Count ?? 0) == 0) { -

No data available.
Try changing your filters at the top.

+

@UiStrings.NoDataAvailable
@UiStrings.TryChangingFilters

} else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null) @@ -36,23 +45,23 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null var overallStats = StatsState.Value.OverallView;
- Average time between sets + @UiStrings.AverageTimeBetweenSets - Average session length + @UiStrings.AverageSessionLength - Most time spent + @UiStrings.MostTimeSpent @overallStats.ExerciseMostTimeSpent?.ExerciseName - Heaviest lift + @UiStrings.HeaviestLift
@@ -72,11 +81,11 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null @if (SettingsState.Value.ShowBodyweight && overallStats.BodyweightStats.Statistics.Any()) { - + } - + @@ -84,7 +93,7 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null @if(SearchTerm != "" && !UnpinnedExercisesToShow.Any()) { -

No exercises found.
Try changing your filters at the top.

+

@UiStrings.NoExercisesFound
@UiStrings.TryChangingFilters

}
@@ -94,17 +103,21 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null private string SearchTerm = ""; - private IEnumerable UnpinnedExercisesToShow => StatsState.Value.OverallView?.ExerciseStats.Where(x=>!StatsState.Value.IsExercisePinned(x)).Where(SearchTermMatches) ?? []; + private IEnumerable UnpinnedExercisesToShow + => StatsState.Value.OverallView?.ExerciseStats + .Where(x=>!StatsState.Value.IsExercisePinned(x)) + .Where(SearchTermMatches) + ?? []; - private List.SelectOption> SelectTimeOptions = + private List.SelectOption> SelectTimeOptions => [ - new("7 days", TimeSpan.FromDays(7)), - new("14 days", TimeSpan.FromDays(14)), - new("30 days", TimeSpan.FromDays(30)), - new("90 days", TimeSpan.FromDays(90)), - new("180 days", TimeSpan.FromDays(180)), - new("365 days", TimeSpan.FromDays(365)), - new("All time", TimeSpan.FromDays(36500)), + new(UiStrings.NumDays_Days(7), TimeSpan.FromDays(7)), + new(UiStrings.NumDays_Days(14), TimeSpan.FromDays(14)), + new(UiStrings.NumDays_Days(30), TimeSpan.FromDays(30)), + new(UiStrings.NumDays_Days(90), TimeSpan.FromDays(90)), + new(UiStrings.NumDays_Days(180), TimeSpan.FromDays(180)), + new(UiStrings.NumDays_Days(365), TimeSpan.FromDays(365)), + new(UiStrings.AllTime, TimeSpan.FromDays(36500)), ]; private List.SelectOption> SessionSelectOptions = []; @@ -113,7 +126,7 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null { base.OnInitialized(); Dispatcher.Dispatch(new FetchOverallStatsAction()); - Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Statistics())); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Statistics)); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); } @@ -122,8 +135,8 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null SessionSelectOptions = await SessionService.GetLatestSessionsAsync() .Select(x => new Select.SelectOption(x.Blueprint.Name, x.Blueprint.Name)) .Distinct() - .Prepend(new Select.SelectOption("All sessions", null!)) - .Prepend(new Select.SelectOption("Current sessions", "CURRENT_SESSIONS")) + .Prepend(new Select.SelectOption(UiStrings.AllSessions, null!)) + .Prepend(new Select.SelectOption(UiStrings.CurrentSessions, "CURRENT_SESSIONS")) .ToListAsync(); await base.OnInitializedAsync(); } @@ -140,4 +153,18 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null } return statistics.ExerciseName.Contains(SearchTerm, StringComparison.OrdinalIgnoreCase); } + + private void HandleSessionSelectChanged(string? value) + { + Dispatcher.Dispatch(new SetOverallViewSessionAction(value)); + Dispatcher.Dispatch(new SetStatsIsDirtyAction(true)); + Dispatcher.Dispatch(new FetchOverallStatsAction()); + } + + private void HandleTimeSelectChanged(TimeSpan value) + { + Dispatcher.Dispatch(new SetOverallViewTimeAction(value)); + Dispatcher.Dispatch(new SetStatsIsDirtyAction(true)); + Dispatcher.Dispatch(new FetchOverallStatsAction()); + } } diff --git a/LiftLog.Ui/ServiceRegistration.cs b/LiftLog.Ui/ServiceRegistration.cs index c0f4f0f5..3c3868c9 100644 --- a/LiftLog.Ui/ServiceRegistration.cs +++ b/LiftLog.Ui/ServiceRegistration.cs @@ -87,6 +87,8 @@ public static IServiceCollection RegisterUiServices< services.Add(lifetime); services.Add(lifetime); + services.Add(lifetime); + services.Add(lifetime); services.Add(lifetime); diff --git a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor index 90c2de34..7e57a416 100644 --- a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor +++ b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor @@ -20,12 +20,12 @@
- - - + + + @if(Uri.IsWellFormedUriString(displayedExercise.Blueprint.Link, UriKind.Absolute)) { - + }
diff --git a/LiftLog.Ui/Shared/Smart/BackupAlert.razor b/LiftLog.Ui/Shared/Smart/BackupAlert.razor index 4083f270..a68d617c 100644 --- a/LiftLog.Ui/Shared/Smart/BackupAlert.razor +++ b/LiftLog.Ui/Shared/Smart/BackupAlert.razor @@ -4,15 +4,14 @@ @inject IDispatcher Dispatcher - Back up data + @UiStrings.BackUpData - It has been a while since you last created a backup. It is HIGHLY recommended you back up your data regularly to prevent data loss. - Would you like to back up your data now? + @UiStrings.BackUpDataReminder
- Don't ask again - No - Yes + @UiStrings.DontAskAgain + @UiStrings.No + @UiStrings.Yes
diff --git a/LiftLog.Ui/Shared/Smart/NavBar.razor b/LiftLog.Ui/Shared/Smart/NavBar.razor index 92c3ffce..656f8575 100644 --- a/LiftLog.Ui/Shared/Smart/NavBar.razor +++ b/LiftLog.Ui/Shared/Smart/NavBar.razor @@ -13,14 +13,14 @@ diff --git a/LiftLog.Ui/Shared/Smart/SessionComponent.razor b/LiftLog.Ui/Shared/Smart/SessionComponent.razor index 0ba878be..2b9f04a2 100644 --- a/LiftLog.Ui/Shared/Smart/SessionComponent.razor +++ b/LiftLog.Ui/Shared/Smart/SessionComponent.razor @@ -120,8 +120,8 @@ else not be impacted.
- Cancel - @(UiStrings.Remove()) + @UiStrings.Cancel + @UiStrings.Remove
diff --git a/LiftLog.Ui/_Imports.razor b/LiftLog.Ui/_Imports.razor index ed378e9a..3fc6eaf7 100644 --- a/LiftLog.Ui/_Imports.razor +++ b/LiftLog.Ui/_Imports.razor @@ -32,4 +32,4 @@ @using LiftLog.Ui.i18n @using BlazorTransitionableRoute @using LiftLog.Ui.Shared.Smart.Tips -@inject IStringLocalizer UiStrings +@inject LiftLog.Ui.i18n.TypealizR.TypealizedUiStrings UiStrings; diff --git a/LiftLog.Ui/i18n/UiStrings.resx b/LiftLog.Ui/i18n/UiStrings.resx index 663add3d..977881e6 100644 --- a/LiftLog.Ui/i18n/UiStrings.resx +++ b/LiftLog.Ui/i18n/UiStrings.resx @@ -165,4 +165,112 @@ Followers + + There is already a current session in progress, start a new one without saving? + + + + Replace current session + + + + No plan created yet! + + + + Add Workouts + + + + Select a plan + + + + Upcoming Workouts + + + + Back up data + + + + It has been a while since you last created a backup. It is HIGHLY recommended you back up your data regularly to prevent data loss. Would you like to back up your data now? + + + + Yes + + + + No + + + + Don't ask again + + + + Open Link + + + + Cancel + + + + Calculating... + + + + No data available + + + + Try changing the filters at the top + + + + Average time between sets + + + + Heaviest lift + + + + Most time spent + + + + Average session length + + + + Bodyweight + + + + Sessions + + + + No exercises found. + + + + All time + + + + {0} days + + + + All sessions + + + + Current sessions + + From 11e9e0899db02d2f9fb93e0891c81f417b038b04 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sat, 7 Dec 2024 20:04:51 +1100 Subject: [PATCH 06/12] Convert many pages to ui strings --- LiftLog.Lib/Models/SessionModels.cs | 2 +- LiftLog.Lib/Util.cs | 7 - LiftLog.Lib/Util/EnumerableExtensions.cs | 9 +- LiftLog.Ui/LiftLog.Ui.csproj | 7 + LiftLog.Ui/Pages/Feed/FeedPage.razor | 29 +- .../Pages/History/HistoryEditPage.razor | 2 +- LiftLog.Ui/Pages/History/HistoryPage.razor | 11 +- LiftLog.Ui/Pages/Index.razor | 2 +- LiftLog.Ui/Pages/PostSessionPage.razor | 3 +- LiftLog.Ui/Pages/Settings/AppConfigPage.razor | 14 +- .../PlainTextExportPage.razor | 12 +- .../BackupAndRestore/RemoteBackupPage.razor | 20 +- .../Pages/Settings/BackupAndRestorePage.razor | 38 +- .../Pages/Settings/ManageSessionPage.razor | 27 +- .../Pages/Settings/ManageWorkoutsPage.razor | 18 +- .../Pages/Settings/NotificationsPage.razor | 4 +- .../Pages/Settings/ProgramListPage.razor | 6 +- LiftLog.Ui/Pages/Settings/SettingsPage.razor | 34 +- LiftLog.Ui/Pages/StatsPage.razor | 16 +- .../Shared/Presentation/ExerciseEditor.razor | 15 +- .../Shared/Presentation/LimitedHtml.razor | 24 + .../Shared/Presentation/LimitedHtml.razor.cs | 50 ++ .../Shared/Presentation/RestEditorGroup.razor | 14 +- .../Shared/Presentation/RestFormat.razor | 10 +- .../Presentation/WeightedExercise.razor | 2 +- .../Shared/Smart/SessionComponent.razor | 45 +- LiftLog.Ui/i18n/UiStrings.resx | 458 +++++++++++++++++- release_notes/whatsnew-en-AU | 4 +- 28 files changed, 711 insertions(+), 172 deletions(-) create mode 100644 LiftLog.Ui/Shared/Presentation/LimitedHtml.razor create mode 100644 LiftLog.Ui/Shared/Presentation/LimitedHtml.razor.cs diff --git a/LiftLog.Lib/Models/SessionModels.cs b/LiftLog.Lib/Models/SessionModels.cs index 1194c1fe..74ee2fe3 100644 --- a/LiftLog.Lib/Models/SessionModels.cs +++ b/LiftLog.Lib/Models/SessionModels.cs @@ -33,7 +33,7 @@ public RecordedExercise? NextExercise get { var latestExerciseIndex = RecordedExercises - .IndexedTuples() + .Index() .Where(x => x.Item.LastRecordedSet is not null) .OrderByDescending(x => x.Item.LastRecordedSet?.Set?.CompletionTime) .Select(x => x.Index) diff --git a/LiftLog.Lib/Util.cs b/LiftLog.Lib/Util.cs index 0687d905..17b25f15 100644 --- a/LiftLog.Lib/Util.cs +++ b/LiftLog.Lib/Util.cs @@ -24,11 +24,4 @@ public static ImmutableListValue ListOf(IEnumerable items) return new ImmutableListValue(ImmutableList.CreateRange(items)); } - - public static IEnumerable<(TSource Item, int Index)> IndexedTuples( - this IEnumerable source - ) - { - return source.Select((item, index) => (item, index)); - } } diff --git a/LiftLog.Lib/Util/EnumerableExtensions.cs b/LiftLog.Lib/Util/EnumerableExtensions.cs index a391dbec..e404ab56 100644 --- a/LiftLog.Lib/Util/EnumerableExtensions.cs +++ b/LiftLog.Lib/Util/EnumerableExtensions.cs @@ -6,13 +6,6 @@ namespace System.Linq; public static class LinqExtensions { - public static IEnumerable<(TSource Item, int Index)> IndexedTuples( - this IEnumerable source - ) - { - return source.Select((item, index) => (item, index)); - } - public static IEnumerable WhereNotNull(this IEnumerable source) where T : notnull { @@ -50,7 +43,7 @@ public static int IndexOf( Func predicate ) { - var tuples = source.IndexedTuples(); + var tuples = source.Index(); var matchingTuple = tuples .Where(x => predicate(x.Item)) .Cast<(TSource?, int)>() diff --git a/LiftLog.Ui/LiftLog.Ui.csproj b/LiftLog.Ui/LiftLog.Ui.csproj index 09b1a650..dd56b55e 100644 --- a/LiftLog.Ui/LiftLog.Ui.csproj +++ b/LiftLog.Ui/LiftLog.Ui.csproj @@ -12,8 +12,15 @@ $(AdditionalFileItemNames);EmbeddedResource PrepareResources;$(CompileDependsOn) + false + + + + + + diff --git a/LiftLog.Ui/Pages/Feed/FeedPage.razor b/LiftLog.Ui/Pages/Feed/FeedPage.razor index aaf35e47..72817557 100644 --- a/LiftLog.Ui/Pages/Feed/FeedPage.razor +++ b/LiftLog.Ui/Pages/Feed/FeedPage.razor @@ -35,15 +35,15 @@ }else { error - You are not publishing your workouts - Start publishing + @UiStrings.NotPublishingWorkouts + @UiStrings.StartPublishing } @if (FeedState.Value.Feed is { Count: 0 }) { -

Nothing here yet!
Nobody you're following has published anything yet! Come back later.

+

@UiStrings.NothingHereYet
@UiStrings.NoFollowingData

} @@ -55,7 +55,7 @@ @if (FeedState.Value.FollowedUsers is { Count: 0 }) { -

Start following someone!
You're not currently following anyone, ask a friend for their share link to start!

+

@UiStrings.StartFollowingSomeone
@UiStrings.NotFollowingAnyone

} @@ -71,14 +71,14 @@ }else { error - You are not publishing your workouts - Start publishing + @UiStrings.NotPublishingWorkouts + @UiStrings.StartPublishing } @if (FeedState.Value.Followers is { Count: 0 } && FeedState.Value.FollowRequests is { Count: 0 }) { -

Nobody is following you yet!
Share your link with friends to get followers

+

@UiStrings.NobodyFollowingYou
@UiStrings.ShareLinkToGetFollowers

} @@ -103,14 +103,17 @@ } - - Unfollow user - This will unfollow @(userToDelete?.Nickname ?? userToDelete?.Name ?? "Anonymous User") and remove all their content on your device. + + @UiStrings.UnfollowUser + + + - - Remove follower - This will stop @(userToDelete?.Nickname ?? userToDelete?.Name ?? "Anonymous User") from following you and remove all your content from their device. + + @UiStrings.RemoveFollower + @UiStrings.RemoveFollowerMsgPart1 @(userToDelete?.Nickname ?? userToDelete?.Name ?? "Anonymous User") @UiStrings.RemoveFollowerMsgPart2 @code diff --git a/LiftLog.Ui/Pages/History/HistoryEditPage.razor b/LiftLog.Ui/Pages/History/HistoryEditPage.razor index b2aea114..86505f37 100644 --- a/LiftLog.Ui/Pages/History/HistoryEditPage.razor +++ b/LiftLog.Ui/Pages/History/HistoryEditPage.razor @@ -17,7 +17,7 @@ {
-

Nothing recorded yet!
Complete a session and check again.

+

@UiStrings.NothingHereYet
@UiStrings.CompleteAndComeBack

} else @@ -46,16 +46,15 @@ else @if (!filteredToMonthSessions.Any()) { -

Nothing recorded in @(currentMonth.ToString("MMMM"))
Complete a session or switch to another month to view your sessions.

+

} } - - Delete Session? + + @UiStrings.DeleteSessionQuestion - The session named @_selectedSession.Blueprint.Name, - on @(_selectedSession.Date) will be deleted from history. This cannot be undone. + diff --git a/LiftLog.Ui/Pages/Index.razor b/LiftLog.Ui/Pages/Index.razor index ea7681e2..5a76f441 100644 --- a/LiftLog.Ui/Pages/Index.razor +++ b/LiftLog.Ui/Pages/Index.razor @@ -50,7 +50,7 @@ else
- + diff --git a/LiftLog.Ui/Pages/PostSessionPage.razor b/LiftLog.Ui/Pages/PostSessionPage.razor index 167e27ce..a5cb2a3f 100644 --- a/LiftLog.Ui/Pages/PostSessionPage.razor +++ b/LiftLog.Ui/Pages/PostSessionPage.razor @@ -10,7 +10,8 @@

Congratulations!

You completed @Session.Blueprint.Name! - +
You hit the rep target on these exercises without failure!
+
Next time you'll go heavier!
} diff --git a/LiftLog.Ui/Pages/Settings/AppConfigPage.razor b/LiftLog.Ui/Pages/Settings/AppConfigPage.razor index 3c45fbd2..01f23fa2 100644 --- a/LiftLog.Ui/Pages/Settings/AppConfigPage.razor +++ b/LiftLog.Ui/Pages/Settings/AppConfigPage.razor @@ -7,17 +7,17 @@ @inherits Fluxor.Blazor.Web.Components.FluxorComponent - - - + + + @* If android, we need a status bar fix sometimes *@ @if(DeviceService.GetDeviceType() == DeviceType.Android) { - + } - - Reset tips + + @UiStrings.ResetTips
- This feature allows you to export your data in a plaintext format such as CSV for use in other applications. - It is not intended for backup purposes. For backups, please use the backup feature. - LiftLog cannot restore data from plaintext exports. + @UiStrings.PlaintextExportDescription
- Read Documentation + @UiStrings.ReadDocumentation - +
- Export + @UiStrings.Export
@@ -32,7 +30,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("Plaintext Export")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.PlaintextExport)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/settings/backup-and-restore")); } diff --git a/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor b/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor index 92bea55f..27f66bd3 100644 --- a/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor +++ b/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor @@ -5,16 +5,12 @@ @inherits Fluxor.Blazor.Web.Components.FluxorComponent -
- This is an advanced feature which enables LiftLog to send backups to a remote server. -
- Please read the documentation for instructions on how to set up a remote server. -
- Read Documentation + + @UiStrings.ReadDocumentation
- + - + - +
- Test - Save + @UiStrings.Test + @UiStrings.Save
@@ -56,7 +52,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("Automatic Remote Backup")); + Dispatcher.Dispatch(new SetPageTitleAction(@UiStrings.AutomaticRemoteBackup)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/settings/backup-and-restore")); SubscribeToAction(OnRemoteBackupSucceeded); EndpointValue = SettingsState.Value.RemoteBackupSettings.Endpoint; diff --git a/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor b/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor index 53b675b7..f4405b25 100644 --- a/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor +++ b/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor @@ -9,42 +9,44 @@ backup - Backup data - Export your data to a file for backup or transfer + @UiStrings.BackUpData + @UiStrings.BackUpDataSubtitle restore - Restore data - Import data from a file to restore + @UiStrings.RestoreData + @UiStrings.RestoreDataSubtitle cloud_upload - Automatic remote backup - Send backups to a remote server. Advanced users only + @UiStrings.AutomaticRemoteBackup + @UiStrings.AutomaticRemoteBackupSubtitle description - Plaintext export - Export your data in a plaintext format such as CSV for use in other applications + @UiStrings.PlaintextExport + @UiStrings.PlaintextExportSubtitle - - Import Feed Data? + + @UiStrings.ImportFeedDataQuestion -

This backup includes a feed account. Would you like to import it?

-

You will lose access to your current account without a backup.

-

This will replace your current account and cannot be undone!

+
- - Backup Feed Account + + @UiStrings.BackupFeedAccount -

Include your feed account and followed users in this backup?

-

Caution: This would allow anyone with this backup to post feed content with your account

+
@@ -68,7 +70,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("Export, Backup and Restore")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.ExportBackupRestore)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/settings")); SubscribeToAction(OnBeginFeedImport); } diff --git a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor index 87e9a95f..def42505 100644 --- a/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor +++ b/LiftLog.Ui/Pages/Settings/ManageSessionPage.razor @@ -17,14 +17,14 @@
- + - + - + @if(SessionEditorState.Value.SessionBlueprint.Exercises.Count == 0) {
- No exercises added yet + @UiStrings.NoExercisesAdded
} - + @{ var exercise = context.Item; var index = context.Index; } - +
@@ -56,12 +61,12 @@
- add + add } - + @if(selectedExercise is not null) { @@ -69,8 +74,10 @@ - Remove Exercise? - This will remove the exercise "@(selectedExercise?.Name)" from @SessionEditorState.Value.SessionBlueprint?.Name. + @UiStrings.RemoveExerciseQuestion + + +
@UiStrings.Cancel @UiStrings.Remove diff --git a/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor b/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor index 0c66ea12..74150cbd 100644 --- a/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor +++ b/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor @@ -14,20 +14,20 @@ @if(ProgramState.Value.SavedPrograms.ContainsKey(PlanId)){ + OnChange="@((val) => Dispatcher.Dispatch(new SetSavedPlanNameAction(PlanId, val ?? "")))" /> @if (!ProgramState.Value.GetSessionBlueprints(PlanId).Any()) { -

No sessions in plan
Add a session to get started.

+ @UiStrings.NoWorkoutsInPlan
} - + @{ var session = context.Item; var index = context.Index; @@ -42,14 +42,14 @@ - add + add @if(IsInActiveScreen && ProgramState.Value.ActivePlanId != PlanId) { - Use + @UiStrings.UseWorkout } } @@ -82,7 +82,7 @@ Dispatcher.Dispatch( new AddProgramSessionAction( PlanId, - SessionBlueprint.Empty with { Name = $"Session {ProgramState.Value.GetSessionBlueprints(PlanId).Count + 1}" }) + SessionBlueprint.Empty with { Name = $"{UiStrings.Workout} {ProgramState.Value.GetSessionBlueprints(PlanId).Count + 1}" }) ); SelectSession(ProgramState.Value.GetSessionBlueprints(PlanId).Last(), ProgramState.Value.GetSessionBlueprints(PlanId).Count - 1); } @@ -92,7 +92,7 @@ PlanId, sessionBlueprint with { - Name = $"Session {ProgramState.Value.GetSessionBlueprints(PlanId).Count + 1}" + Name = $"{UiStrings.Workout} {ProgramState.Value.GetSessionBlueprints(PlanId).Count + 1}" } ) ); @@ -106,7 +106,7 @@ protected override void OnInitialized() { base.OnInitialized(); - var title = "Manage " + ProgramState.Value.SavedPrograms[PlanId].Name; + var title = UiStrings.ManageWorkout(ProgramState.Value.SavedPrograms[PlanId].Name); Dispatcher.Dispatch(new SetPageTitleAction(title)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/settings/program-list")); } diff --git a/LiftLog.Ui/Pages/Settings/NotificationsPage.razor b/LiftLog.Ui/Pages/Settings/NotificationsPage.razor index a3e469fb..1fa3366f 100644 --- a/LiftLog.Ui/Pages/Settings/NotificationsPage.razor +++ b/LiftLog.Ui/Pages/Settings/NotificationsPage.razor @@ -5,7 +5,7 @@ @inherits Fluxor.Blazor.Web.Components.FluxorComponent - + @@ -14,7 +14,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("Notifications")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Notifications)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/settings")); } diff --git a/LiftLog.Ui/Pages/Settings/ProgramListPage.razor b/LiftLog.Ui/Pages/Settings/ProgramListPage.razor index 0a526b9f..6feb4984 100644 --- a/LiftLog.Ui/Pages/Settings/ProgramListPage.razor +++ b/LiftLog.Ui/Pages/Settings/ProgramListPage.razor @@ -14,7 +14,7 @@ var orderedPrograms = ProgramState.Value.SavedPrograms.OrderBy(x=>x.Value.Name).ToList();
- + @foreach (var (id, program) in orderedPrograms) {
- + add
@@ -47,7 +47,7 @@ {
- Selected @ProgramState.Value.GetActivePlan().Name + Dispatcher.Dispatch(new NavigateAction("/")))>Go to workouts
diff --git a/LiftLog.Ui/Pages/Settings/SettingsPage.razor b/LiftLog.Ui/Pages/Settings/SettingsPage.razor index 9d61b34f..239a6aab 100644 --- a/LiftLog.Ui/Pages/Settings/SettingsPage.razor +++ b/LiftLog.Ui/Pages/Settings/SettingsPage.razor @@ -12,26 +12,26 @@ assignment - Manage plans - Setup your workout plans + @UiStrings.ManagePlans + @UiStrings.ManagePlansSubtitle settings - App Configuration - Adjust weight units, theme, and other misc. settings + @UiStrings.AppConfiguration + @UiStrings.AppConfigurationSubtitle notifications - Notifications - Adjust notification settings for rest timers + @UiStrings.Notifications + @UiStrings.NotificationsSubtitle settings_backup_restore - Export, backup, and restore - Create and export backups for transfering between devices + @UiStrings.ExportBackupRestore + @UiStrings.ExportBackupRestoreSubtitle
@@ -39,31 +39,31 @@ star - Feature request - Suggest a new feature that you think LiftLog should have! + @UiStrings.FeatureRequest + @UiStrings.FeatureRequestSubtitle bug_report - Bug report - Let us know when you encounter a bug + @UiStrings.BugReport + @UiStrings.BugReportSubtitle info - App Info - Display app information + @UiStrings.AppInfo + @UiStrings.AppInfoSubtitle - App Info + @UiStrings.AppInfo LiftLog is an entirely open source app, licensed under the AGPL-3.0 license. You can find the source code on GitHub.
- Close + @UiStrings.Close
@@ -74,7 +74,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("Settings")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.Settings)); Dispatcher.Dispatch(new SetBackNavigationUrlAction(null)); } diff --git a/LiftLog.Ui/Pages/StatsPage.razor b/LiftLog.Ui/Pages/StatsPage.razor index cc8d3cd0..8e284e5f 100644 --- a/LiftLog.Ui/Pages/StatsPage.razor +++ b/LiftLog.Ui/Pages/StatsPage.razor @@ -72,7 +72,7 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null
- @foreach(var pinnedStat in StatsState.Value.GetPinnedExercises().Where(SearchTermMatches).IndexedTuples()) + @foreach(var pinnedStat in StatsState.Value.GetPinnedExercises().Where(SearchTermMatches).Index()) { @@ -87,7 +87,7 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null - + @if(SearchTerm != "" && !UnpinnedExercisesToShow.Any()) @@ -111,12 +111,12 @@ else if (!StatsState.Value.IsLoading && StatsState.Value.OverallView is not null private List.SelectOption> SelectTimeOptions => [ - new(UiStrings.NumDays_Days(7), TimeSpan.FromDays(7)), - new(UiStrings.NumDays_Days(14), TimeSpan.FromDays(14)), - new(UiStrings.NumDays_Days(30), TimeSpan.FromDays(30)), - new(UiStrings.NumDays_Days(90), TimeSpan.FromDays(90)), - new(UiStrings.NumDays_Days(180), TimeSpan.FromDays(180)), - new(UiStrings.NumDays_Days(365), TimeSpan.FromDays(365)), + new(UiStrings.NumDays(7), TimeSpan.FromDays(7)), + new(UiStrings.NumDays(14), TimeSpan.FromDays(14)), + new(UiStrings.NumDays(30), TimeSpan.FromDays(30)), + new(UiStrings.NumDays(90), TimeSpan.FromDays(90)), + new(UiStrings.NumDays(180), TimeSpan.FromDays(180)), + new(UiStrings.NumDays(365), TimeSpan.FromDays(365)), new(UiStrings.AllTime, TimeSpan.FromDays(36500)), ]; diff --git a/LiftLog.Ui/Shared/Presentation/ExerciseEditor.razor b/LiftLog.Ui/Shared/Presentation/ExerciseEditor.razor index 276a69a9..60c396ef 100644 --- a/LiftLog.Ui/Shared/Presentation/ExerciseEditor.razor +++ b/LiftLog.Ui/Shared/Presentation/ExerciseEditor.razor @@ -1,10 +1,11 @@ @inject IJSRuntime JSRuntime +
+ Label="@UiStrings.Sets"/> + Label="@UiStrings.Reps"/>
- +
diff --git a/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor b/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor new file mode 100644 index 00000000..0a0221b5 --- /dev/null +++ b/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor @@ -0,0 +1,24 @@ + +@foreach(var (isHighlighted, text, insertBrBefore) in ParseLimitedHtml()) +{ + if (insertBrBefore) + { +
+ } + if (isHighlighted) + { + @text + } + else + { + @text + } +} +
+ +@code +{ + [Parameter] [EditorRequired] public string Value { get; set; } = null!; + + [Parameter] public string HighlightClass { get; set; } = "font-bold text-primary"; +} diff --git a/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor.cs b/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor.cs new file mode 100644 index 00000000..7073cb62 --- /dev/null +++ b/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor.cs @@ -0,0 +1,50 @@ +namespace LiftLog.Ui.Shared.Presentation; + +public partial class LimitedHtml +{ + private IEnumerable<(bool IsHighlighted, string Text, bool HasBreakBefore)> ParseLimitedHtml() + { + var currentIndex = 0; + var closed = true; + const string HIGHLIGHT_TAG = ""; + const string HIGHLIGHT_TAG_CLOSING = ""; + + while (currentIndex < Value.Length) + { + var findTag = closed ? HIGHLIGHT_TAG : HIGHLIGHT_TAG_CLOSING; + var index = Value.IndexOf(findTag, currentIndex); + + if (index == -1) + { + var remainingText = Value.Substring(currentIndex); + if (!closed) + { + remainingText = HIGHLIGHT_TAG + remainingText; + } + // split on br and return each part + // if the index is odd, it means the previous part had a
tag so it should be inserted + var parts = remainingText.Split("
"); + for (var i = 0; i < parts.Length; i++) + { + yield return (!closed, parts[i], i % 2 == 1); + } + break; + } + + closed = !closed; + var innerText = Value.Substring(currentIndex, index - currentIndex); + if (!string.IsNullOrEmpty(innerText)) + { + // split on br and return each part + // if the index is odd, it means the previous part had a
tag so it should be inserted + var parts = innerText.Split("
"); + for (var i = 0; i < parts.Length; i++) + { + yield return (!closed, parts[i], i % 2 == 1); + } + } + + currentIndex = index + findTag.Length; + } + } +} diff --git a/LiftLog.Ui/Shared/Presentation/RestEditorGroup.razor b/LiftLog.Ui/Shared/Presentation/RestEditorGroup.razor index d251d722..89f3b538 100644 --- a/LiftLog.Ui/Shared/Presentation/RestEditorGroup.razor +++ b/LiftLog.Ui/Shared/Presentation/RestEditorGroup.razor @@ -2,18 +2,18 @@ Rest
- - - - + + + +
@if (_isCustom) {
- - - + + +
} else diff --git a/LiftLog.Ui/Shared/Presentation/RestFormat.razor b/LiftLog.Ui/Shared/Presentation/RestFormat.razor index 7ee74913..6372efc1 100644 --- a/LiftLog.Ui/Shared/Presentation/RestFormat.razor +++ b/LiftLog.Ui/Shared/Presentation/RestFormat.razor @@ -1,16 +1,22 @@ @if (Rest.MinRest >= Rest.MaxRest) { - Rest @(Rest.MinRest.ToString(TimespanFormatStr)) + } else { - Rest between @(Rest.MinRest.ToString(TimespanFormatStr)) and @(Rest.MaxRest.ToString(TimespanFormatStr)) + } @code { private const string TimespanFormatStr = @"m\:ss"; + private string HighlightClass => "font-bold " + (Highlight ? "text-primary" : ""); + [Parameter] [EditorRequired] public Rest Rest { get; set; } = null!; diff --git a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor index 7e57a416..643893dc 100644 --- a/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor +++ b/LiftLog.Ui/Shared/Presentation/WeightedExercise.razor @@ -46,7 +46,7 @@
- @foreach (var (set, i) in displayedExercise.PotentialSets.IndexedTuples()) + @foreach (var (i, set) in displayedExercise.PotentialSets.Index()) { -

Session contains no exercises.

+

@UiStrings.SessionContainsNoExercises

} else { - + - Bodyweight - + @UiStrings.Bodyweight + } @@ -56,7 +56,7 @@ else assignment_add - Update Plan + @UiStrings.UpdatePlan }
@@ -65,7 +65,7 @@ else { - add + add @RenderSnackBar() @@ -81,12 +81,18 @@ else { - @(SessionTarget == SessionTarget.WorkoutSession ? "Finish" : "Save") + @(SessionTarget == SessionTarget.WorkoutSession ? UiStrings.Finish : UiStrings.Save) } - + @@ -95,7 +101,7 @@ else { var exercise = Session.RecordedExercises[setAdditionalActions.Value.ExerciseIndex]; var set = exercise.PotentialSets[setAdditionalActions.Value.PotentialSetIndex]; - Select Reps + @UiStrings.SelectReps {})>
- Cancel + @UiStrings.Cancel
} - Remove Exercise? + @UiStrings.RemoveExerciseQuestion - Exercise will be removed from the current session, future sessions will - not be impacted. + @UiStrings.RemoveExerciseMessage
@UiStrings.Cancel @@ -126,23 +131,23 @@ else
- Update Plan + @UiStrings.UpdatePlan - The plan will be updated with the current session's exercises. + @UiStrings.PlanWillBeUpdated @if (SessionWithSameNameInPlan) { - Would you like to update the existing session @Session.Blueprint.Name, or add a new session? + }
- Cancel + @UiStrings.Cancel
- Add + @UiStrings.Add @if (SessionWithSameNameInPlan) { - Update + @UiStrings.Update }
@@ -372,7 +377,7 @@ else { if (Session.Blueprint is SessionBlueprint blueprint) { - var blueprintIndex = ProgramState.Value.GetActivePlanSessionBlueprints().IndexedTuples().First(x => x.Item.Name == blueprint.Name).Index; + var blueprintIndex = ProgramState.Value.GetActivePlanSessionBlueprints().Index().First(x => x.Item.Name == blueprint.Name).Index; Dispatcher.Dispatch(new SetProgramSessionAction(ProgramState.Value.ActivePlanId, blueprintIndex, blueprint)); } } diff --git a/LiftLog.Ui/i18n/UiStrings.resx b/LiftLog.Ui/i18n/UiStrings.resx index 977881e6..52e4a03a 100644 --- a/LiftLog.Ui/i18n/UiStrings.resx +++ b/LiftLog.Ui/i18n/UiStrings.resx @@ -261,7 +261,7 @@ All time - + {0} days @@ -273,4 +273,460 @@ Current sessions + + You are not publishing your workouts + + + + Start publishing + + + + Nothing here yet! + + + + Nobody you're following has published anything yet! Come back later. + + + + Start following someone! + + + + You're not currently following anyone, ask a friend for their share link to start! + + + + Nobody is following you yet! + + + + Share your link with friends to get followers + + + + Unfollow + + + + Unfollow user + + + + Remove follower + + + + This will stop + + + + from following you and remove all your content from their device. + + + + This will unfollow <em>{0}</em> and remove all their content on your device. + + + + Session contains no exercises. + + + + Update plan + + + + Add Exercise + + + + Finish + + + + Save + + + + Edit Exercise + + + + Update + + + + Add + + + + Select Reps + + + + Remove exercise? + + + + Exercise will be removed from the current session, future sessions will not be impacted. + + + + Would you like to update the existing workout named <em>{0}</em>, or add a new workout? + + + + The plan will be updated with the current session's exercises. + + + + Exercise + noun form of exercise + + + Sets + Noun form for sets, as in number of sets in an exercise + + + Reps + Noun form for exercise reps, as in repetitions + + + Plan Notes + + + + Session Notes + + + + External Link + The name for a HTTPS url link outside of the app + + + Progressive Overload + + + + Superset next exercise + + + + Short + A short period of rest + + + Medium + A medium period of rest + + + Long + A long period of rest + + + Custom + As in customized + + + Min Rest + + + + Max Rest + + + + Failure Rest + + + + Rest <em>{0}</em> + + + + Rest between <em>{0}</em> and <em>{0}</em> + + + + Date + as in calendar date + + + Complete a session and check again. + + + + Nothing recorded in {0}<br>Complete a session or switch to another month to view your sessions. + + + + The session named <em>{0}</em>, on {1} will be deleted from history. This cannot be undone. + + + + Delete Session? + + + + Delete + + + + Manage plans + + + + Setup your workout plans + + + + App configuration + + + + Adjust weight units, theme, and other misc. settings + + + + Notifications + + + + Adjust notification settings for rest timers + + + + Export, backup, and restore + + + + Create and export backups for transferring between devices + + + + Feature request + + + + Suggest a new feature that you think LiftLog should have! + + + + Bug report + + + + Let us know when you encounter a bug + + + + App info + + + + Display app information + + + + Close + as in the opposite of open, close a dialog + + + Saved Plans + + + + Add plan + + + + Selected <em>{0}</em> + + + + Rest notifications + the title for the rest notifications toggle + + + Show a notification when the rest timer is up + + + + Plan Name + + + + No workouts in plan<br> Add a workout to get started. + + + + Add workout + + + + Use + + + + Manage {0} + + + + Workout Name + + + + Workout Notes + + + + No exercises added yet + + + + Exercises + Multiple noun exercises + + + This will remove the exercise <em>{0}</em> from <em>{1}</em>. + + + + Export your data to a file for backup or transfer + + + + Restore data + + + + Import data from a file to restore + + + + Automatic remote backup + + + + Plaintext export + + + + Export your data in a plaintext format such as CSV for use in other applications + + + + Send backups to a remote server. Advanced users only + + + + Import feed data? + + + + This backup includes a feed account. Would you like to import it?<br>You will lose access to your current account without a backup.<br><em>This will replace your current account and cannot be undone!</em> + + + + Import + Import as a verb + + + Include feed + Include feed data in the backup + + + Just my data + A button saying to include only our data in the backup, and no feed content + + + Backup feed account + + + + Include your feed account and followed users in this backup?<br><em>Caution: This would allow anyone with this backup to post feed content with your account</em> + + + + Use imperial units + + + + Use pounds in favour of kilograms + + + + Show bodyweight + + + + Enable bodyweight tracking and statistics + + + + Show feed + + + + Display the feed in the navigation bar + + + + Status bar fix + + + + Fixes the status bar overlapping the page title controls on some devices + + + + Show tips + + + + Show tips on how to use the app + + + + Reset tips + + + + This feature allows you to export your data in a plaintext format such as CSV for use in other applications. It is not intended for backup purposes. For backups, please use the backup feature. LiftLog cannot restore data from plaintext exports. + + + + Read documentation + + + + Format + The export format type for the plaintext export + + + Export + Export as a verb + + + This is an advanced feature which enables LiftLog to send backups to a remote server.<br>Please read the documentation for instructions on how to set up a remote server. + + + + Endpoint + + + + API Key + + + + Include your feed account data in backups + + + + Test + The button for testing the remote backup + diff --git a/release_notes/whatsnew-en-AU b/release_notes/whatsnew-en-AU index b0257e6e..bc0fcecb 100644 --- a/release_notes/whatsnew-en-AU +++ b/release_notes/whatsnew-en-AU @@ -1,3 +1 @@ -You can now submit bug reports and feature requests directly from the app! - -Additionally, external links for exercises can now be opened from the exercise overflow menu. +The app can now be translated into your language! Interested in submitting translations? Go to settings and submit your translations! From 01da475c14b37fd77d09c32275813593dc3b5fcb Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sat, 7 Dec 2024 20:10:29 +1100 Subject: [PATCH 07/12] Format --- .../Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs index 33d6f4c3..d63364e1 100644 --- a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs +++ b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.ExerciseEditPage.cs @@ -11,7 +11,6 @@ namespace LiftLog.Ui.Pages.Screenshot; public partial class ScreenshotCollectorPage { - private async Task HandleExerciseEditorScreenshotCollection() { Dispatcher.Dispatch( From b0d9ac6a3d307a0456c5d8b9086137319c6d0794 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sun, 8 Dec 2024 12:10:06 +1100 Subject: [PATCH 08/12] l10n a lot more components --- LiftLog.Lib/Util/EnumerableExtensions.cs | 6 +- LiftLog.Ui/Pages/Settings/AiPlannerPage.razor | 26 +- .../Pages/Settings/AiSessionCreatorPage.razor | 30 +- .../BackupAndRestore/RemoteBackupPage.razor | 4 +- .../Pages/Settings/BackupAndRestorePage.razor | 6 +- .../Pages/Settings/ProgramListPage.razor | 2 +- LiftLog.Ui/Pages/StatsPage.razor | 9 +- LiftLog.Ui/Shared/MainLayout.razor | 9 +- .../Presentation/AiSessionCreator.razor | 28 +- .../AdditionalInfoInput.razor | 4 +- .../AiWorkoutWalkthrough/AgeSelector.razor | 2 +- .../AiWorkoutWalkthrough.razor | 8 +- .../ExperienceLevelSelector.razor | 10 +- .../AiWorkoutWalkthrough/GenderSelector.razor | 10 +- .../AiWorkoutWalkthrough/GoalsSelector.razor | 10 +- .../NumberOfDaysSelector.razor | 16 +- .../AiWorkoutWalkthrough/WeightSelector.razor | 2 +- .../Presentation/ConfirmationDialog.razor | 8 +- .../Presentation/FeedItemCardContent.razor | 2 +- .../Presentation/FeedUserCardContent.razor | 8 +- .../FollowRequestCardContent.razor | 8 +- .../Presentation/FollowerCardContent.razor | 6 +- .../Shared/Presentation/LimitedHtml.razor | 4 +- LiftLog.Ui/Shared/Presentation/Loader.razor | 14 +- .../ManageWorkoutCardContent.razor | 4 +- .../Presentation/PreviousExerciseViewer.razor | 2 +- .../Shared/Presentation/ProgramListItem.razor | 12 +- .../Shared/Presentation/RestFormat.razor | 6 +- .../Shared/Presentation/RestTimer.razor | 4 +- .../Shared/Presentation/SearchInput.razor | 2 +- .../Presentation/SessionSummaryTitle.razor | 4 +- .../Presentation/StatGraphCardContent.razor | 10 +- .../Shared/Presentation/ThemeChooser.razor | 4 +- .../Shared/Presentation/WeightDialog.razor | 10 +- .../Smart/AndroidNotificationAlert.razor | 6 +- .../Shared/Smart/AppReviewRequest.razor | 16 +- .../Shared/Smart/FeedIdentityManager.razor | 20 +- LiftLog.Ui/Shared/Smart/FeedShareUrl.razor | 4 +- LiftLog.Ui/Shared/Smart/ProFeatures.razor | 22 +- .../SharedProgramBlueprintComponent.razor | 6 +- LiftLog.Ui/Store/Settings/SettingsEffects.cs | 14 +- LiftLog.Ui/i18n/UiStrings.resx | 434 +++++++++++++++++- 42 files changed, 610 insertions(+), 202 deletions(-) diff --git a/LiftLog.Lib/Util/EnumerableExtensions.cs b/LiftLog.Lib/Util/EnumerableExtensions.cs index e404ab56..2aca7ad0 100644 --- a/LiftLog.Lib/Util/EnumerableExtensions.cs +++ b/LiftLog.Lib/Util/EnumerableExtensions.cs @@ -46,9 +46,9 @@ Func predicate var tuples = source.Index(); var matchingTuple = tuples .Where(x => predicate(x.Item)) - .Cast<(TSource?, int)>() - .DefaultIfEmpty((default, -1)); - return matchingTuple.First().Item2; + .Cast<(int, TSource?)>() + .DefaultIfEmpty(( -1, default)); + return matchingTuple.First().Item1; } public static async Task> ToImmutableListValueAsync( diff --git a/LiftLog.Ui/Pages/Settings/AiPlannerPage.razor b/LiftLog.Ui/Pages/Settings/AiPlannerPage.razor index 09484e48..fa3cc5e6 100644 --- a/LiftLog.Ui/Pages/Settings/AiPlannerPage.razor +++ b/LiftLog.Ui/Pages/Settings/AiPlannerPage.razor @@ -14,15 +14,9 @@ @if (SettingsState.Value.IsGeneratingAiPlan) { -
-
- -
- -

Generating AI plan...

-

This may take up to 3 minutes

-
-
+ + + } else if (SettingsState.Value.AiPlan != null) { @@ -30,18 +24,18 @@ else if (SettingsState.Value.AiPlan != null) -

Note: you can tweak this plan after you accept it. Just head to the Manage Plan page in settings.

+

@UiStrings.NoteAboutTweakingAiPlan

- doneAccept + done@UiStrings.Accept
- closeCancel + close@UiStrings.Cancel - refreshRegenerate + refresh@UiStrings.Regenerate
@@ -53,11 +47,11 @@ else if (SettingsState.Value.AiPlanError != null)

@SettingsState.Value.AiPlanError

- closeCancel + close@UiStrings.Cancel - refreshRetry + refresh@UiStrings.Retry
@@ -74,7 +68,7 @@ else protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("AI Planner")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.AiPlanner)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/settings")); } diff --git a/LiftLog.Ui/Pages/Settings/AiSessionCreatorPage.razor b/LiftLog.Ui/Pages/Settings/AiSessionCreatorPage.razor index 86426e9b..7eef842e 100644 --- a/LiftLog.Ui/Pages/Settings/AiSessionCreatorPage.razor +++ b/LiftLog.Ui/Pages/Settings/AiSessionCreatorPage.razor @@ -11,14 +11,9 @@ @if (AiSessionCreatorState.Value.IsLoading) { -
-
- -
- -

Generating Session...

-
-
+ + + } else if (AiSessionCreatorState.Value.ErrorMessage is not null) { @@ -30,8 +25,8 @@ else if (AiSessionCreatorState.Value.ErrorMessage is not null)

@AiSessionCreatorState.Value.ErrorMessage

- Back - Dispatcher.Dispatch(new ClearAiGeneratedSessionStateAction()))>Retry + @UiStrings.Back + Dispatcher.Dispatch(new ClearAiGeneratedSessionStateAction()))>@UiStrings.Retry
} @@ -41,16 +36,15 @@ else if (AiSessionCreatorState.Value.GeneratedSession is not null)
- Dispatcher.Dispatch(new ClearAiGeneratedSessionStateAction()))>Regenerate + Dispatcher.Dispatch(new ClearAiGeneratedSessionStateAction()))>@UiStrings.Regenerate
- assignment_addAdd - To Plan + assignment_add@UiStrings.AddToPlan - fitness_centerStart + fitness_center@UiStrings.Start
@@ -70,7 +64,7 @@ else @if(IsInActiveScreen) { - Generate + @UiStrings.Generate } } @@ -82,16 +76,16 @@ else [CascadingParameter(Name = "IsInActiveScreen")] public bool IsInActiveScreen { get; set; } - private string? ValidationError => Model switch + private LocalizedString? ValidationError => Model switch { - var m when m.AreasToWorkout.Count == 0 => "Please select at least one area to workout", + var m when m.AreasToWorkout.Count == 0 => UiStrings.SelectAtLeastOneArea, _ => null }; protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("AI Session Creator")); + Dispatcher.Dispatch(new SetPageTitleAction(@UiStrings.AiSessionCreator)); } private void HandleGenerateSession() diff --git a/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor b/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor index 27f66bd3..4f4358c6 100644 --- a/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor +++ b/LiftLog.Ui/Pages/Settings/BackupAndRestore/RemoteBackupPage.razor @@ -72,7 +72,7 @@ return; } Dispatcher.Dispatch(new UpdateRemoteBackupSettingsAction(new(EndpointValue, ApiKeyValue, IncludeFeedAccount))); - Dispatcher.Dispatch(new ToastAction("Settings saved")); + Dispatcher.Dispatch(new ToastAction(UiStrings.SettingsSaved)); } private void OpenDocumentation(MouseEventArgs _) @@ -108,6 +108,6 @@ private void OnRemoteBackupSucceeded(RemoteBackupSucceededEvent _) { - Dispatcher.Dispatch(new ToastAction("Backup sent successfully")); + Dispatcher.Dispatch(new ToastAction(UiStrings.BackupSentSuccessfully)); } } diff --git a/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor b/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor index f4405b25..abc34878 100644 --- a/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor +++ b/LiftLog.Ui/Pages/Settings/BackupAndRestorePage.razor @@ -31,10 +31,10 @@ - + @UiStrings.ImportFeedDataQuestion - + @@ -46,7 +46,7 @@ OnCancel="()=>ExportData(false)"> @UiStrings.BackupFeedAccount - + diff --git a/LiftLog.Ui/Pages/Settings/ProgramListPage.razor b/LiftLog.Ui/Pages/Settings/ProgramListPage.razor index 6feb4984..a4350654 100644 --- a/LiftLog.Ui/Pages/Settings/ProgramListPage.razor +++ b/LiftLog.Ui/Pages/Settings/ProgramListPage.razor @@ -47,7 +47,7 @@ {
- + Dispatcher.Dispatch(new NavigateAction("/")))>Go to workouts
diff --git a/LiftLog.Ui/Pages/StatsPage.razor b/LiftLog.Ui/Pages/StatsPage.razor index 8e284e5f..5c32def6 100644 --- a/LiftLog.Ui/Pages/StatsPage.razor +++ b/LiftLog.Ui/Pages/StatsPage.razor @@ -25,14 +25,7 @@
@if (StatsState.Value.IsLoading) { -
-
- -
- -

@UiStrings.Calculating

-
-
+ } else if ((StatsState.Value.OverallView?.SessionStats.Count ?? 0) == 0) { diff --git a/LiftLog.Ui/Shared/MainLayout.razor b/LiftLog.Ui/Shared/MainLayout.razor index 4ef68863..fd92c861 100644 --- a/LiftLog.Ui/Shared/MainLayout.razor +++ b/LiftLog.Ui/Shared/MainLayout.razor @@ -38,14 +38,7 @@ } else { -
-
- -
- -

Loading...

-
-
+ }
diff --git a/LiftLog.Ui/Shared/Presentation/AiSessionCreator.razor b/LiftLog.Ui/Shared/Presentation/AiSessionCreator.razor index 9fefe559..e25213f4 100644 --- a/LiftLog.Ui/Shared/Presentation/AiSessionCreator.razor +++ b/LiftLog.Ui/Shared/Presentation/AiSessionCreator.razor @@ -1,18 +1,18 @@ - + - @RenderFilterChip("Arms") - @RenderFilterChip("Chest") - @RenderFilterChip("Back") - @RenderFilterChip("Legs") - @RenderFilterChip("Triceps") - @RenderFilterChip("Biceps") - @RenderFilterChip("Quads") - @RenderFilterChip("Hamstrings") - @RenderFilterChip("Calves") + @RenderFilterChip(@UiStrings.Arms) + @RenderFilterChip(@UiStrings.Chest) + @RenderFilterChip(@UiStrings.BackMuscle) + @RenderFilterChip(@UiStrings.Legs) + @RenderFilterChip(@UiStrings.Triceps) + @RenderFilterChip(@UiStrings.Biceps) + @RenderFilterChip(@UiStrings.Quads) + @RenderFilterChip(@UiStrings.Hamstrings) + @RenderFilterChip(@UiStrings.Calves) - + @@ -29,9 +29,9 @@ private string VolumeLabel => Value.Volume switch { - <= 30 => "Light", - <= 60 => "Medium", - _ => "Heavy", + <= 30 => UiStrings.VolumeLight, + <= 60 => UiStrings.VolumeMedium, + _ => UiStrings.VolumeHeavy, }; diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AdditionalInfoInput.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AdditionalInfoInput.razor index e84214ff..985af6a5 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AdditionalInfoInput.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AdditionalInfoInput.razor @@ -1,5 +1,5 @@ - - + + @code { diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AgeSelector.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AgeSelector.razor index a409e314..8f3c1200 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AgeSelector.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AgeSelector.razor @@ -1,6 +1,6 @@ @inject IJSRuntime Js - + diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AiWorkoutWalkthrough.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AiWorkoutWalkthrough.razor index 4752075f..3f57a1a7 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AiWorkoutWalkthrough.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/AiWorkoutWalkthrough.razor @@ -18,7 +18,7 @@ @if(IsInActiveScreen) { - Generate + @UiStrings.Generate } @@ -80,10 +80,10 @@ OnAttributesSelected(attributes); } - private string? ValidationError => attributes switch + private LocalizedString? ValidationError => attributes switch { - {DaysPerWeek: 0} => "Please select the number of days per week", - {Goals.Count: 0} => "Please select at least one goal", + {DaysPerWeek: 0} => UiStrings.SelectNumberOfDays, + {Goals.Count: 0} => UiStrings.SelectAtLeastOneGoal, _ => null }; diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/ExperienceLevelSelector.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/ExperienceLevelSelector.razor index 86fd585b..9882f5f2 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/ExperienceLevelSelector.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/ExperienceLevelSelector.razor @@ -1,9 +1,9 @@ - + - - - - + + + + diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GenderSelector.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GenderSelector.razor index 590215ff..213ad24f 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GenderSelector.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GenderSelector.razor @@ -1,10 +1,10 @@ - + - - - - + + + + diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GoalsSelector.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GoalsSelector.razor index e4e74298..c3659dae 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GoalsSelector.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/GoalsSelector.razor @@ -1,10 +1,10 @@ - + - @RenderFilterChip("Strength") - @RenderFilterChip("Gaining Muscle") - @RenderFilterChip("Losing Weight") - @RenderFilterChip("Toning") + @RenderFilterChip(UiStrings.Strength) + @RenderFilterChip(UiStrings.GainingMuscle) + @RenderFilterChip(UiStrings.LosingWeight) + @RenderFilterChip(UiStrings.Toning) diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/NumberOfDaysSelector.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/NumberOfDaysSelector.razor index 2c747631..40054aa5 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/NumberOfDaysSelector.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/NumberOfDaysSelector.razor @@ -1,12 +1,12 @@ - + - - - - - - - + + + + + + + diff --git a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/WeightSelector.razor b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/WeightSelector.razor index 30f11610..228e5e50 100644 --- a/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/WeightSelector.razor +++ b/LiftLog.Ui/Shared/Presentation/AiWorkoutWalkthrough/WeightSelector.razor @@ -1,6 +1,6 @@ @inject IJSRuntime Js - + @code { diff --git a/LiftLog.Ui/Shared/Presentation/ConfirmationDialog.razor b/LiftLog.Ui/Shared/Presentation/ConfirmationDialog.razor index f4858b7b..5bf255a7 100644 --- a/LiftLog.Ui/Shared/Presentation/ConfirmationDialog.razor +++ b/LiftLog.Ui/Shared/Presentation/ConfirmationDialog.razor @@ -5,8 +5,8 @@ @TextContent
- @CancelText - @OkText + @(CancelText ?? UiStrings.Cancel) + @(OkText ?? UiStrings.Ok)
@@ -19,13 +19,13 @@ public RenderFragment TextContent {get;set;} = null!; [Parameter] - public string CancelText {get;set;} = "Cancel"; + public string? CancelText { get;set; } [Parameter] public EventCallback OnCancel { get; set; } [Parameter] - public string OkText { get; set; } = "Ok"; + public string? OkText { get; set; } [Parameter] public EventCallback OnOk { get; set; } diff --git a/LiftLog.Ui/Shared/Presentation/FeedItemCardContent.razor b/LiftLog.Ui/Shared/Presentation/FeedItemCardContent.razor index 21c4fd82..50899b84 100644 --- a/LiftLog.Ui/Shared/Presentation/FeedItemCardContent.razor +++ b/LiftLog.Ui/Shared/Presentation/FeedItemCardContent.razor @@ -6,7 +6,7 @@ - @(User.DisplayName) completed a workout! + } diff --git a/LiftLog.Ui/Shared/Presentation/FeedUserCardContent.razor b/LiftLog.Ui/Shared/Presentation/FeedUserCardContent.razor index a2526e96..21b7d701 100644 --- a/LiftLog.Ui/Shared/Presentation/FeedUserCardContent.razor +++ b/LiftLog.Ui/Shared/Presentation/FeedUserCardContent.razor @@ -1,10 +1,10 @@
- + @if (User.AesKey is null) { - Awaiting Response + @UiStrings.AwaitingResponse }
@@ -13,12 +13,12 @@
- + @if (User.CurrentPlan is not []) { - View their plan + @UiStrings.ViewTheirPlan }
diff --git a/LiftLog.Ui/Shared/Presentation/FollowRequestCardContent.razor b/LiftLog.Ui/Shared/Presentation/FollowRequestCardContent.razor index 027195d9..6d712a70 100644 --- a/LiftLog.Ui/Shared/Presentation/FollowRequestCardContent.razor +++ b/LiftLog.Ui/Shared/Presentation/FollowRequestCardContent.razor @@ -1,8 +1,8 @@
- @(FollowRequest.Name ?? "Anonymous User") wants to follow you! +
- Deny - Accept + @UiStrings.Deny + @UiStrings.Accept
@@ -13,4 +13,4 @@ [Parameter] [EditorRequired] public Action Accept { get; set; } = null!; [Parameter] [EditorRequired] public Action Deny { get; set; } = null!; -} \ No newline at end of file +} diff --git a/LiftLog.Ui/Shared/Presentation/FollowerCardContent.razor b/LiftLog.Ui/Shared/Presentation/FollowerCardContent.razor index 17ef5ee2..92f35f98 100644 --- a/LiftLog.Ui/Shared/Presentation/FollowerCardContent.razor +++ b/LiftLog.Ui/Shared/Presentation/FollowerCardContent.razor @@ -1,13 +1,13 @@ -
- @(User.Name ?? "Anonymous User") is following you! +
+
@if (ShowFollowBack) { - Follow @(User.Name ?? "Anonymous User") back + @UiStrings.FollowUserBack(User.Name ?? "Anonymous User") } diff --git a/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor b/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor index 0a0221b5..2df6c754 100644 --- a/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor +++ b/LiftLog.Ui/Shared/Presentation/LimitedHtml.razor @@ -7,7 +7,7 @@ } if (isHighlighted) { - @text + @text } else { @@ -20,5 +20,5 @@ { [Parameter] [EditorRequired] public string Value { get; set; } = null!; - [Parameter] public string HighlightClass { get; set; } = "font-bold text-primary"; + [Parameter] public string EmClass { get; set; } = "font-bold text-primary"; } diff --git a/LiftLog.Ui/Shared/Presentation/Loader.razor b/LiftLog.Ui/Shared/Presentation/Loader.razor index 3463c1f3..8867d6b9 100644 --- a/LiftLog.Ui/Shared/Presentation/Loader.razor +++ b/LiftLog.Ui/Shared/Presentation/Loader.razor @@ -3,11 +3,21 @@
-

@LoadingText

+ @if(ChildContent is not null) + { + @ChildContent + } + else + { +

@(LoadingText ?? UiStrings.GenericLoading)

+ }
@code { [Parameter] - public string LoadingText { get; set; } = "Loading..."; + public string? LoadingText { get; set; } + + [Parameter] + public RenderFragment? ChildContent { get; set; } } diff --git a/LiftLog.Ui/Shared/Presentation/ManageWorkoutCardContent.razor b/LiftLog.Ui/Shared/Presentation/ManageWorkoutCardContent.razor index ae07988b..6a45eef6 100644 --- a/LiftLog.Ui/Shared/Presentation/ManageWorkoutCardContent.razor +++ b/LiftLog.Ui/Shared/Presentation/ManageWorkoutCardContent.razor @@ -7,8 +7,8 @@ - - + + diff --git a/LiftLog.Ui/Shared/Presentation/PreviousExerciseViewer.razor b/LiftLog.Ui/Shared/Presentation/PreviousExerciseViewer.razor index 3098d309..c9902528 100644 --- a/LiftLog.Ui/Shared/Presentation/PreviousExerciseViewer.razor +++ b/LiftLog.Ui/Shared/Presentation/PreviousExerciseViewer.razor @@ -15,7 +15,7 @@ @if(!PreviousRecordedExercises.Any()) { - You have never done this exercise before + @UiStrings.NeverDoneThisExerciseBefore }
diff --git a/LiftLog.Ui/Shared/Presentation/ProgramListItem.razor b/LiftLog.Ui/Shared/Presentation/ProgramListItem.razor index ff151199..c92c80c8 100644 --- a/LiftLog.Ui/Shared/Presentation/ProgramListItem.razor +++ b/LiftLog.Ui/Shared/Presentation/ProgramListItem.razor @@ -8,9 +8,9 @@ @RenderActiveBadge() _menu?.Open())> - - - + + +
@@ -44,7 +44,7 @@ [Parameter] public EventCallback OnShare { get; set; } - private string SupportingText => $"Edited: {ProgramBlueprint.LastEdited.ToShortDateString()}"; + private string SupportingText => UiStrings.EditedOn(ProgramBlueprint.LastEdited.ToShortDateString()); private string FocusClass => IsFocused ? "bg-secondary-container text-on-secondary-container " : ""; @@ -62,10 +62,10 @@ { if (IsActive) { - return @
Active
; + return @
@UiStrings.Active
; } - return @Use; + return @@UiStrings.UseWorkout; } } diff --git a/LiftLog.Ui/Shared/Presentation/RestFormat.razor b/LiftLog.Ui/Shared/Presentation/RestFormat.razor index 6372efc1..aa34d20a 100644 --- a/LiftLog.Ui/Shared/Presentation/RestFormat.razor +++ b/LiftLog.Ui/Shared/Presentation/RestFormat.razor @@ -3,19 +3,19 @@ { + EmClass="@EmClass" /> } else { + EmClass="@EmClass" /> } @code { private const string TimespanFormatStr = @"m\:ss"; - private string HighlightClass => "font-bold " + (Highlight ? "text-primary" : ""); + private string EmClass => "font-bold " + (Highlight ? "text-primary" : ""); [Parameter] [EditorRequired] diff --git a/LiftLog.Ui/Shared/Presentation/RestTimer.razor b/LiftLog.Ui/Shared/Presentation/RestTimer.razor index 000ee719..e9fb6933 100644 --- a/LiftLog.Ui/Shared/Presentation/RestTimer.razor +++ b/LiftLog.Ui/Shared/Presentation/RestTimer.razor @@ -2,7 +2,9 @@
@if (Failed) { - Rest @(Rest.FailureRest.ToString(TimespanFormatStr)) + } else { diff --git a/LiftLog.Ui/Shared/Presentation/SearchInput.razor b/LiftLog.Ui/Shared/Presentation/SearchInput.razor index 1dbff09e..9326f2bf 100644 --- a/LiftLog.Ui/Shared/Presentation/SearchInput.razor +++ b/LiftLog.Ui/Shared/Presentation/SearchInput.razor @@ -8,7 +8,7 @@ bg-surface-container-high px-12 py-4 placeholder-on-surface-variant focus:outline-none focus:border-none" - placeholder="Search" + placeholder="@UiStrings.Search" @bind="SearchTerm" @oninput="e=>OnSearch.InvokeAsync(e.Value as string)" > diff --git a/LiftLog.Ui/Shared/Presentation/SessionSummaryTitle.razor b/LiftLog.Ui/Shared/Presentation/SessionSummaryTitle.razor index 8e0c0631..ce6ee2ef 100644 --- a/LiftLog.Ui/Shared/Presentation/SessionSummaryTitle.razor +++ b/LiftLog.Ui/Shared/Presentation/SessionSummaryTitle.razor @@ -16,6 +16,6 @@ [Parameter] public bool IsFilled { get; set; } private string FormattedDate => Session.Date.Year == DateTime.Now.Year - ? Session.Date.ToString("dddd d MMMM", CultureInfo.InvariantCulture) - : Session.Date.ToString("dddd d MMMM", CultureInfo.InvariantCulture) + " " + Session.Date.Year; + ? Session.Date.ToString("dddd d MMMM") + : Session.Date.ToString("dddd d MMMM") + " " + Session.Date.Year; } diff --git a/LiftLog.Ui/Shared/Presentation/StatGraphCardContent.razor b/LiftLog.Ui/Shared/Presentation/StatGraphCardContent.razor index f7f9aedc..68223e8e 100644 --- a/LiftLog.Ui/Shared/Presentation/StatGraphCardContent.razor +++ b/LiftLog.Ui/Shared/Presentation/StatGraphCardContent.razor @@ -11,19 +11,11 @@
@if (ShowTitle) { - } @if (IsLoading) { -
-
- -
- -

Loading...

-
-
+ } else { diff --git a/LiftLog.Ui/Shared/Presentation/ThemeChooser.razor b/LiftLog.Ui/Shared/Presentation/ThemeChooser.razor index 317c284c..d29292ab 100644 --- a/LiftLog.Ui/Shared/Presentation/ThemeChooser.razor +++ b/LiftLog.Ui/Shared/Presentation/ThemeChooser.razor @@ -1,10 +1,10 @@ @inject IJSRuntime JSRuntime - Theme + @UiStrings.Theme
- Default + @UiStrings.Default
@ColorBall(FromHex("AA0000")) @ColorBall(FromHex("00AA00")) diff --git a/LiftLog.Ui/Shared/Presentation/WeightDialog.razor b/LiftLog.Ui/Shared/Presentation/WeightDialog.razor index da248c86..cf7c8f3b 100644 --- a/LiftLog.Ui/Shared/Presentation/WeightDialog.razor +++ b/LiftLog.Ui/Shared/Presentation/WeightDialog.razor @@ -1,10 +1,10 @@ - @Label + @(Label ?? UiStrings.Weight)
- +
remove @@ -16,8 +16,8 @@
- Close - Save + @UiStrings.Close + @UiStrings.Save
@@ -28,7 +28,7 @@ [EditorRequired] [Parameter] public decimal? Weight { get; set; } = null!; - [Parameter] public string Label { get; set; } = "Weight"; + [Parameter] public string? Label { get; set; } [EditorRequired] [Parameter] public decimal Increment { get; set; } = 2.5m; diff --git a/LiftLog.Ui/Shared/Smart/AndroidNotificationAlert.razor b/LiftLog.Ui/Shared/Smart/AndroidNotificationAlert.razor index ff55afb9..1c121fb2 100644 --- a/LiftLog.Ui/Shared/Smart/AndroidNotificationAlert.razor +++ b/LiftLog.Ui/Shared/Smart/AndroidNotificationAlert.razor @@ -13,10 +13,8 @@ CancelText="Disable Notifications" OnCancel="DisableNotifications" SectionName="AndroidNotificationDialog"> - Enable Notifications? - Newer Android devices require an additional permission to ensure that rest notifications are delivered on time. - Without this permission, they will arrive late and largely be useless. - On the next screen, please grant LiftLog the permission. + @UiStrings.EnableNotificationsQuestion + @UiStrings.AndroidNotificationPermissionExplanation @code diff --git a/LiftLog.Ui/Shared/Smart/AppReviewRequest.razor b/LiftLog.Ui/Shared/Smart/AppReviewRequest.razor index 19184e49..bed772c6 100644 --- a/LiftLog.Ui/Shared/Smart/AppReviewRequest.razor +++ b/LiftLog.Ui/Shared/Smart/AppReviewRequest.razor @@ -5,18 +5,18 @@ @inject IDispatcher Dispatcher - Enjoying LiftLog? - If so, would you take a minute to leave a @ReviewType on @AppStore? + @UiStrings.EnjoyingLiftLogQuestion + @UiStrings.EnjoyingLiftLogMessage(ReviewType, AppStore)
- Never - Not Now + @UiStrings.Never + @UiStrings.NotNow @if(DeviceService.GetDeviceType() == DeviceType.Web) { - Rate + @UiStrings.Rate } else { - Rate + @UiStrings.Rate }
@@ -34,8 +34,8 @@ private string ReviewType => DeviceService.GetDeviceType() switch { - DeviceType.Web => "star", - _ => "review" + DeviceType.Web => UiStrings.GithubStar, + _ => UiStrings.Review }; private void Never() diff --git a/LiftLog.Ui/Shared/Smart/FeedIdentityManager.razor b/LiftLog.Ui/Shared/Smart/FeedIdentityManager.razor index 44118f93..08f3c621 100644 --- a/LiftLog.Ui/Shared/Smart/FeedIdentityManager.razor +++ b/LiftLog.Ui/Shared/Smart/FeedIdentityManager.razor @@ -11,27 +11,27 @@
- - + + - - - + + + - Reset account + @UiStrings.ResetAccount
- Reset account - This will delete your data on the servers and unsubscribe you from all feeds. You will need to resubscribe and share a new link if you want to share your workouts again. + @UiStrings.ResetAccount + @UiStrings.ResetAccountMessage
- Cancel - Delete + @UiStrings.Cancel + @UiStrings.ResetAccount
diff --git a/LiftLog.Ui/Shared/Smart/FeedShareUrl.razor b/LiftLog.Ui/Shared/Smart/FeedShareUrl.razor index 0687cc84..a129247c 100644 --- a/LiftLog.Ui/Shared/Smart/FeedShareUrl.razor +++ b/LiftLog.Ui/Shared/Smart/FeedShareUrl.razor @@ -3,8 +3,8 @@ @if (FeedState.Value.Identity is not null) { - - Only those with the link can see what you've shared. + + @UiStrings.OnlyThoseWithTheLinkCanSee } @code { diff --git a/LiftLog.Ui/Shared/Smart/ProFeatures.razor b/LiftLog.Ui/Shared/Smart/ProFeatures.razor index 3f1b2821..2cb1e958 100644 --- a/LiftLog.Ui/Shared/Smart/ProFeatures.razor +++ b/LiftLog.Ui/Shared/Smart/ProFeatures.razor @@ -12,30 +12,30 @@
- + @RenderLockedPro()
bolt - AI Program Planner - Use AI to generate an entire program suited to your goals + @UiStrings.AiPlanner + @UiStrings.AiPlannerSubtitle auto_awesome - AI Session Creator - Generate a workout session to import into your plan or complete now! + @UiStrings.AiSessionCreator + @UiStrings.AiSessionCreatorSubtitle
- Upgrade to Pro + @UiStrings.UpgradeToPro - This will unlock the AI planner, which will generate a plan tailored - specifically to you and your goals.
This is a one time purchase of @RenderPrice(). + + @RenderPrice()
- Close - Upgrade + @UiStrings.Close + @UiStrings.Upgrade
@@ -57,7 +57,7 @@ return null; } - return @lockUnlock; + return @lock@UiStrings.Unlock; } private RenderFragment RenderPrice() diff --git a/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor b/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor index 461fcc57..dcb6b89a 100644 --- a/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor +++ b/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor @@ -2,7 +2,7 @@

@ProgramBlueprint.Name

-

This plan has been shared with you.

+

@UiStrings.PlanSharedWithYou

@@ -18,7 +18,7 @@ @if(IsInActiveScreen) { - Import + @UiStrings.Import } @code { @@ -32,7 +32,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("Shared Plan")); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.ShardPlan)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/")); } diff --git a/LiftLog.Ui/Store/Settings/SettingsEffects.cs b/LiftLog.Ui/Store/Settings/SettingsEffects.cs index d19ac82a..87bc8ac0 100644 --- a/LiftLog.Ui/Store/Settings/SettingsEffects.cs +++ b/LiftLog.Ui/Store/Settings/SettingsEffects.cs @@ -7,6 +7,7 @@ using Fluxor; using Google.Protobuf; using LiftLog.Lib.Services; +using LiftLog.Ui.i18n.TypealizR; using LiftLog.Ui.Models; using LiftLog.Ui.Models.ExportedDataDao; using LiftLog.Ui.Models.ProgramBlueprintDao; @@ -19,7 +20,7 @@ namespace LiftLog.Ui.Store.Settings; -public class SettingsEffects( +internal class SettingsEffects( ProgressRepository progressRepository, IState settingsState, IState programState, @@ -30,7 +31,8 @@ public class SettingsEffects( ILogger logger, PreferencesRepository preferencesRepository, PlaintextExportService plaintextExportService, - HttpClient httpClient + HttpClient httpClient, + TypealizedUiStrings uiStrings ) { [EffectMethod] @@ -264,7 +266,7 @@ public async Task ExecuteRemoteBackup(ExecuteRemoteBackupAction action, IDispatc { logger.LogWarning(ex, "Failed to backup data to remote server [connection failure]"); dispatcher.Dispatch( - new ToastAction("Failed to backup data to remote server [connection failure]") + new ToastAction(uiStrings.FailedToBackupToRemote + " [connection failure]") ); } catch (HttpRequestException ex) @@ -275,15 +277,13 @@ public async Task ExecuteRemoteBackup(ExecuteRemoteBackupAction action, IDispatc ex.StatusCode ); dispatcher.Dispatch( - new ToastAction("Failed to backup data to remote server [" + ex.StatusCode + "]") + new ToastAction(uiStrings.FailedToBackupToRemote + " [" + ex.StatusCode + "]") ); } catch (Exception ex) { logger.LogWarning(ex, "Failed to backup data to remote server [unknown]"); - dispatcher.Dispatch( - new ToastAction("Failed to backup data to remote server [unknown]") - ); + dispatcher.Dispatch(new ToastAction(uiStrings.FailedToBackupToRemote + " [unknown]")); } } diff --git a/LiftLog.Ui/i18n/UiStrings.resx b/LiftLog.Ui/i18n/UiStrings.resx index 52e4a03a..0bb42d92 100644 --- a/LiftLog.Ui/i18n/UiStrings.resx +++ b/LiftLog.Ui/i18n/UiStrings.resx @@ -215,7 +215,7 @@ Cancel - + As a verb Calculating... @@ -729,4 +729,436 @@ Test The button for testing the remote backup + + Generating AI plan...<br><em>This may take up to 3 minutes</em> + + + + Note: you can tweak this plan after you accept it. Just head to the Manage Plan page in settings. + + + + Accept + As a verb + + + Regenerate + Recreate the ai plan + + + Retry + Generic retry verb + + + AI Planner + + + + Back + As in, go back to the previous screen + + + Add to plan + A button to add the session to the user's plan + + + Start + A verb for beginnning the workout + + + Generate + Verb for generating an ai plan + + + Please select at least one area to workout + Area referring to the area of the body, like a muscle + + + AI Session Creator + + + + Theme + As in the general colours of the app + + + Default + The default, as a noun + + + Any additional information? + + + + Goals, injuries, available equipment, etc. + + + + How old are you? + + + + Please select at least one goal + + + + Please select the number of days per week + + + + What is your gender? + + + + Female + + + + Male + + + + Other + A gender other than female or male + + + Prefer not to say + The user prefers not to say their gender + + + What are your goals? + + + + Toning + As in getting more muscular definition + + + Lowing Weight + + + + Gaining Muscle + + + + Strength + + + + What is your experience level? + + + + Professional + + + + Advanced + + + + Intermediate + + + + Beginner + + + + One + + + + Two + + + + Three + + + + Four + + + + Five + + + + Six + + + + Seven + + + + How many days per week? + + + + How much do you weigh? + + + + Arms + + + + Chest + + + + Back + As in a person's back muscles + + + Legs + + + + Triceps + + + + Biceps + + + + Quads + + + + Hamstrings + + + + Calves + + + + What are we working out? + + + + How much volume? + + + + Light + As in the opposite of heavy + + + Medium + As in the middle of light and heavy + + + Heavy + + + + Ok + + + + <em>{0}</em> completed a workout! + + + + Anonymous User + + + + Awaiting Response + + + + Nickname + + + + View their plan + + + + <em>{0}</em> is following you! + + + + Follow {0} back + + + + <em>{0}</em> wants to follow you! + + + + Deny + + + + Loading... + + + + Duplicate + + + + You have never done this exercise before + + + + Share + Verb + + + Edited: {0} + + + + Active + + + + Search + + + + Weight + + + + Enable Notifications? + + + + Newer Android devices require an additional permission to ensure that rest notifications are delivered on time. Without this permission, they will arrive late and largely be useless. On the next screen, please grant LiftLog the permission. + + + + Enjoying LiftLog? + + + + If so, would you take a minute to leave a {0} on {1}? + + + + Not now + + + + Rate + + + + Never + + + + star + as in a star on github + + + review + as in a review on the app store + + + Optional + + + + Your Name + + + + Publish workout + + + + Publish bodyweight + + + + Publish plan + + + + Publish workouts as you complete them + + + + Publish your current plan for your followers to see and import + + + + Publish your bodyweight with your workouts + + + + Reset account + + + + This will delete your data on the servers and unsubscribe you from all feeds. You will need to resubscribe and share a new link if you want to share your workouts again. + + + + Only those with the link can see what you've shared. + + + + Share link + + + + Unlock + + + + Pro Features + + + + Use AI to generate an entire program suited to your goals + + + + Generate a workout session to import into your plan or complete now! + + + + Upgrade to Pro + + + + This will unlock the AI planner, which will generate a plan tailored specifically to you and your goals. <br>This is a one time purchase of: + The price immediately follows this, so translations will need to be worded in such a way that this is possible + + + Upgrade + + + + This plan has been shared with you. + + + + Shared Plan + + + + Settings saved + + + + Backup sent successfully + + + + Failed to backup to remote server + + From 0d57a9434b26c004690052abf87d1e74b64f1ba5 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sun, 8 Dec 2024 12:20:32 +1100 Subject: [PATCH 09/12] More l10n --- LiftLog.Ui/Pages/Feed/FeedUserPlanPage.razor | 14 ++++++++------ LiftLog.Ui/i18n/UiStrings.resx | 10 +++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/LiftLog.Ui/Pages/Feed/FeedUserPlanPage.razor b/LiftLog.Ui/Pages/Feed/FeedUserPlanPage.razor index 177ca1fa..5846b014 100644 --- a/LiftLog.Ui/Pages/Feed/FeedUserPlanPage.razor +++ b/LiftLog.Ui/Pages/Feed/FeedUserPlanPage.razor @@ -17,7 +17,7 @@
- assignmentImport their plan + assignment@UiStrings.ImportTheirPlan
@@ -25,11 +25,13 @@ { - Import their plan - This will import @(user.DisplayName)'s plan. It will not overwrite your existing plan. + @UiStrings.ImportTheirPlan + + +
- importPlanDialog?.Close())>Cancel - Import + importPlanDialog?.Close())>@UiStrings.Cancel + @UiStrings.Import
} @@ -47,7 +49,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction("User Plan")); + Dispatcher.Dispatch(new SetPageTitleAction("User plan")); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/feed")); if (!Guid.TryParse(UserIdStr, out var userId) || !FeedState.Value.FollowedUsers.TryGetValue(userId, out user)) { diff --git a/LiftLog.Ui/i18n/UiStrings.resx b/LiftLog.Ui/i18n/UiStrings.resx index 0bb42d92..d255e32b 100644 --- a/LiftLog.Ui/i18n/UiStrings.resx +++ b/LiftLog.Ui/i18n/UiStrings.resx @@ -629,7 +629,7 @@ This backup includes a feed account. Would you like to import it?<br>You will lose access to your current account without a backup.<br><em>This will replace your current account and cannot be undone!</em> - + Import Import as a verb @@ -1161,4 +1161,12 @@ Failed to backup to remote server + + Import their plan + + + + This will import <em>{0}'s</em> plan. It will not overwrite your existing plan. + + From f67f3e9ae0936a4b2a49cb2f98d4d75806488e87 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sun, 8 Dec 2024 12:24:16 +1100 Subject: [PATCH 10/12] Format --- LiftLog.Lib/Util/EnumerableExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiftLog.Lib/Util/EnumerableExtensions.cs b/LiftLog.Lib/Util/EnumerableExtensions.cs index 2aca7ad0..4580cd31 100644 --- a/LiftLog.Lib/Util/EnumerableExtensions.cs +++ b/LiftLog.Lib/Util/EnumerableExtensions.cs @@ -47,7 +47,7 @@ Func predicate var matchingTuple = tuples .Where(x => predicate(x.Item)) .Cast<(int, TSource?)>() - .DefaultIfEmpty(( -1, default)); + .DefaultIfEmpty((-1, default)); return matchingTuple.First().Item1; } From 40c02d64465201ff914dfd20d3546fc4aee13f72 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sun, 8 Dec 2024 12:24:46 +1100 Subject: [PATCH 11/12] Fix --- LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor b/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor index dcb6b89a..a8a2667d 100644 --- a/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor +++ b/LiftLog.Ui/Shared/Smart/SharedProgramBlueprintComponent.razor @@ -32,7 +32,7 @@ protected override void OnInitialized() { base.OnInitialized(); - Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.ShardPlan)); + Dispatcher.Dispatch(new SetPageTitleAction(UiStrings.SharedPlan)); Dispatcher.Dispatch(new SetBackNavigationUrlAction("/")); } From 112e0f7f2d2513e28a0d2f93c49b1d5e7b29bce3 Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Sun, 8 Dec 2024 12:32:40 +1100 Subject: [PATCH 12/12] Fix tests --- LiftLog.Cypress/cypress/e2e/completing-a-session.cy.js | 4 ++-- LiftLog.Cypress/cypress/e2e/creating-a-plan.cy.js | 8 ++++---- LiftLog.Cypress/cypress/e2e/settings.cy.js | 6 +++--- .../Pages/Screenshot/ScreenshotCollectorPage.Home.cs | 2 +- LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor | 2 +- LiftLog.Ui/Shared/Presentation/FullScreenDialog.razor | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/LiftLog.Cypress/cypress/e2e/completing-a-session.cy.js b/LiftLog.Cypress/cypress/e2e/completing-a-session.cy.js index 4df7efe6..c452de37 100644 --- a/LiftLog.Cypress/cypress/e2e/completing-a-session.cy.js +++ b/LiftLog.Cypress/cypress/e2e/completing-a-session.cy.js @@ -14,7 +14,7 @@ describe('Completing a session', () => { cy.containsA('Add Exercise', { includeShadowDom: true }).click() cy.dialog().find('md-filled-text-field').find('input', { includeShadowDom: true }).first().click().type('Squat') - cy.dialog().contains("Update").click() + cy.dialog().find("[data-cy=dialog-action]").click() cy.getA('.repcount').first().click() @@ -41,7 +41,7 @@ describe('Completing a session', () => { beforeEach(() => { cy.navigate('Settings') // Disable tips - cy.containsA('App Configuration').click() + cy.containsA('App configuration').click() cy.containsA('Show tips').click() cy.navigate('Settings') cy.containsA('Manage plans').click() diff --git a/LiftLog.Cypress/cypress/e2e/creating-a-plan.cy.js b/LiftLog.Cypress/cypress/e2e/creating-a-plan.cy.js index 035a3e00..4cd18bf0 100644 --- a/LiftLog.Cypress/cypress/e2e/creating-a-plan.cy.js +++ b/LiftLog.Cypress/cypress/e2e/creating-a-plan.cy.js @@ -9,7 +9,7 @@ describe('Creating a plan', () => { beforeEach(() => { cy.navigate('Settings') // Disable tips - cy.containsA('App Configuration').click() + cy.containsA('App configuration').click() cy.containsA('Show tips').click() cy.navigate('Settings') cy.containsA('Manage plans').click() @@ -24,7 +24,7 @@ describe('Creating a plan', () => { beforeEach(() => { cy.navigate('Settings') // Disable tips - cy.containsA('App Configuration').click() + cy.containsA('App configuration').click() cy.containsA('Show tips').click() cy.navigate('Settings') cy.containsA('Manage plans').click() @@ -50,7 +50,7 @@ describe('Creating a plan', () => { function populatePlanFromEditPage(exerciseName) { - cy.containsA('Add Session', { includeShadowDom: true }).click() + cy.containsA('Add workout', { includeShadowDom: true }).click() cy.containsA('Add Exercise', { includeShadowDom: true }).click() cy.dialog().find('[data-cy=exercise-name]').find('input', { includeShadowDom: true }).clear().type(exerciseName) cy.dialog().find('[data-cy=exercise-sets]').should('contain.text', '3').find('[data-cy=fixed-increment]').click() @@ -66,7 +66,7 @@ function populatePlanFromEditPage(exerciseName) { function assertPlanFromEditPage(exerciseName) { - cy.containsA('Session 1').click() + cy.containsA('Workout 1').click() cy.getA('.itemlist').children().first().click() cy.dialog().find('[data-cy=exercise-name]').find('input', { includeShadowDom: true }).should('have.value', exerciseName) cy.dialog().find('[data-cy=exercise-sets]').should('contain.text', '4') diff --git a/LiftLog.Cypress/cypress/e2e/settings.cy.js b/LiftLog.Cypress/cypress/e2e/settings.cy.js index 26588c11..ed600c0a 100644 --- a/LiftLog.Cypress/cypress/e2e/settings.cy.js +++ b/LiftLog.Cypress/cypress/e2e/settings.cy.js @@ -9,7 +9,7 @@ describe('Settings', () => { beforeEach(() => { cy.navigate('Settings') // Disable tips - cy.containsA('App Configuration').click() + cy.containsA('App configuration').click() cy.containsA('Show tips').click() cy.navigate('Settings') @@ -25,7 +25,7 @@ describe('Settings', () => { cy.navigate('Settings') // Navigate twice, because settings remembers its last page when you click it cy.navigate('Settings') - cy.containsA('App Configuration').click() + cy.containsA('App configuration').click() cy.containsA('Use imperial units').click() assertCorrectWeightUnitsOnAllPages('lbs') }) @@ -37,7 +37,7 @@ describe('Settings', () => { cy.navigate('Settings') // Navigate twice, because settings remembers its last page when you click it cy.navigate('Settings') - cy.containsA('App Configuration').click() + cy.containsA('App configuration').click() cy.containsA('Show bodyweight').click() assertShowsBodyweightOnAllPages(false) }) diff --git a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.Home.cs b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.Home.cs index 76411bef..dc1c67e1 100644 --- a/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.Home.cs +++ b/LiftLog.Ui/Pages/Screenshot/ScreenshotCollectorPage.Home.cs @@ -10,7 +10,7 @@ namespace LiftLog.Ui.Pages.Screenshot; public partial class ScreenshotCollectorPage { private SessionBlueprint demoSessionBlueprint = new( - Name: "Session 1", + Name: "Workout 1", Exercises: [ new ExerciseBlueprint( diff --git a/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor b/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor index 74150cbd..23cd7b0c 100644 --- a/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor +++ b/LiftLog.Ui/Pages/Settings/ManageWorkoutsPage.razor @@ -24,7 +24,7 @@ @if (!ProgramState.Value.GetSessionBlueprints(PlanId).Any()) { - @UiStrings.NoWorkoutsInPlan + } diff --git a/LiftLog.Ui/Shared/Presentation/FullScreenDialog.razor b/LiftLog.Ui/Shared/Presentation/FullScreenDialog.razor index 299e3bf0..e2bfe0a6 100644 --- a/LiftLog.Ui/Shared/Presentation/FullScreenDialog.razor +++ b/LiftLog.Ui/Shared/Presentation/FullScreenDialog.razor @@ -14,7 +14,7 @@ @Title @if(Action != null) { - @Action + @Action }