small bug fixes

This commit is contained in:
2026-10-11 22:19:34 +02:00
parent c6391a384c
commit 4af7385804
36 changed files with 1558 additions and 399 deletions
+41 -8
View File
@@ -1,4 +1,5 @@
using cfs_tracker.Services; using cfs_tracker.Services;
using cfs_tracker.ViewModels;
using System.Diagnostics; using System.Diagnostics;
namespace cfs_tracker; namespace cfs_tracker;
@@ -7,15 +8,22 @@ public partial class App : Application
{ {
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly AppBootstrapService _bootstrapService; private readonly AppBootstrapService _bootstrapService;
private readonly LocalizationService _localizationService;
private bool _startupTriggered; private bool _startupTriggered;
public App(IServiceProvider serviceProvider, AppBootstrapService bootstrapService) public App(
IServiceProvider serviceProvider,
AppBootstrapService bootstrapService,
LocalizationService localizationService)
{ {
InitializeComponent();
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_bootstrapService = bootstrapService; _bootstrapService = bootstrapService;
_localizationService = localizationService;
_localizationService.Initialize();
InitializeComponent();
UserAppTheme = AppTheme.Dark; UserAppTheme = AppTheme.Dark;
} }
@@ -63,7 +71,7 @@ public partial class App : Application
{ {
return new ContentPage return new ContentPage
{ {
Title = "Laden", Title = LocalizationService.Translate("App_Loading_Title"),
BackgroundColor = Color.FromArgb("#0B1A2A"), BackgroundColor = Color.FromArgb("#0B1A2A"),
Content = new Grid Content = new Grid
{ {
@@ -86,7 +94,7 @@ public partial class App : Application
}, },
new Label new Label
{ {
Text = "App wird geladen ...", Text = LocalizationService.Translate("App_Loading_Message"),
FontSize = 20, FontSize = 20,
HorizontalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center,
TextColor = Color.FromArgb("#DCE7F3") TextColor = Color.FromArgb("#DCE7F3")
@@ -102,7 +110,7 @@ public partial class App : Application
{ {
return new ContentPage return new ContentPage
{ {
Title = "Startfehler", Title = LocalizationService.Translate("App_Error_Title"),
BackgroundColor = Color.FromArgb("#0B1A2A"), BackgroundColor = Color.FromArgb("#0B1A2A"),
Content = new ScrollView Content = new ScrollView
{ {
@@ -114,7 +122,7 @@ public partial class App : Application
{ {
new Label new Label
{ {
Text = "Fehler beim Starten der App", Text = LocalizationService.Translate("App_Error_Header"),
FontSize = 24, FontSize = 24,
FontAttributes = FontAttributes.Bold, FontAttributes = FontAttributes.Bold,
TextColor = Color.FromArgb("#FFB4B4") TextColor = Color.FromArgb("#FFB4B4")
@@ -130,4 +138,29 @@ public partial class App : Application
} }
}; };
} }
}
public async Task ReloadShellAsync(string route = "//options", OptionsViewModel.OptionsTab? optionsTab = null)
{
var shell = _serviceProvider.GetRequiredService<AppShell>();
await MainThread.InvokeOnMainThreadAsync(async () =>
{
var window = Windows.FirstOrDefault();
if (window is null)
return;
window.Page = shell;
if (!string.IsNullOrWhiteSpace(route))
await shell.GoToAsync(route);
if (optionsTab.HasValue)
{
await Task.Delay(50);
if (shell.CurrentPage is Views.OptionsPage optionsPage)
optionsPage.ViewModel.SelectedTab = optionsTab.Value;
}
});
}
}
+7 -6
View File
@@ -3,6 +3,7 @@
x:Class="cfs_tracker.AppShell" x:Class="cfs_tracker.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:views="clr-namespace:cfs_tracker.Views" xmlns:views="clr-namespace:cfs_tracker.Views"
Shell.BackgroundColor="{DynamicResource ShellBackground}" Shell.BackgroundColor="{DynamicResource ShellBackground}"
Shell.ForegroundColor="{DynamicResource ShellForeground}" Shell.ForegroundColor="{DynamicResource ShellForeground}"
@@ -14,24 +15,24 @@
Shell.TabBarUnselectedColor="{DynamicResource TabBarUnselected}"> Shell.TabBarUnselectedColor="{DynamicResource TabBarUnselected}">
<TabBar> <TabBar>
<ShellContent Title="Tag" <ShellContent Title="{loc:Translate Tab_Day}"
Route="day" Route="day"
ContentTemplate="{DataTemplate views:DayPage}" /> ContentTemplate="{DataTemplate views:DayPage}" />
<ShellContent Title="Woche" <ShellContent Title="{loc:Translate Tab_Week}"
Route="week" Route="week"
ContentTemplate="{DataTemplate views:WeekPage}" /> ContentTemplate="{DataTemplate views:WeekPage}" />
<ShellContent Title="Monat" <ShellContent Title="{loc:Translate Tab_Month}"
Route="month" Route="month"
ContentTemplate="{DataTemplate views:MonthPage}" /> ContentTemplate="{DataTemplate views:MonthPage}" />
<ShellContent Title="Jahr" <ShellContent Title="{loc:Translate Tab_Year}"
Route="year" Route="year"
ContentTemplate="{DataTemplate views:YearPage}" /> ContentTemplate="{DataTemplate views:YearPage}" />
<ShellContent Title="Optionen" <ShellContent Title="{loc:Translate Tab_Options}"
Route="options" Route="options"
ContentTemplate="{DataTemplate views:OptionsPage}" /> ContentTemplate="{DataTemplate views:OptionsPage}" />
</TabBar> </TabBar>
</Shell> </Shell>
+5 -4
View File
@@ -1,4 +1,5 @@
using System.Globalization; using System.Globalization;
using cfs_tracker.Services;
namespace cfs_tracker.Helpers; namespace cfs_tracker.Helpers;
@@ -14,14 +15,14 @@ public static class DateHelper
} }
public static string ToGermanDateText(DateTime date) => public static string ToGermanDateText(DateTime date) =>
date.ToString("dddd, dd. MMMM yyyy", GermanCulture); date.ToString(LocalizationService.Translate("Date_LongDateFormat"), LocalizationService.GetCurrentCulture());
public static string ToGermanShortDay(DateTime date) => public static string ToGermanShortDay(DateTime date) =>
date.ToString("ddd dd.MM.", GermanCulture); date.ToString(LocalizationService.Translate("Date_ShortDayFormat"), LocalizationService.GetCurrentCulture());
public static string ToGermanMonthYear(DateTime date) => public static string ToGermanMonthYear(DateTime date) =>
date.ToString("MMMM yyyy", GermanCulture); date.ToString(LocalizationService.Translate("Date_MonthYearFormat"), LocalizationService.GetCurrentCulture());
public static string ToGermanYear(DateTime date) => public static string ToGermanYear(DateTime date) =>
date.ToString("yyyy", GermanCulture); date.ToString(LocalizationService.Translate("Date_YearFormat"), LocalizationService.GetCurrentCulture());
} }
+21
View File
@@ -0,0 +1,21 @@
using cfs_tracker.Services;
using Microsoft.Maui.Controls.Xaml;
namespace cfs_tracker.Helpers;
[ContentProperty(nameof(Key))]
[AcceptEmptyServiceProvider]
public sealed class TranslateExtension : IMarkupExtension<string>
{
public string Key { get; set; } = string.Empty;
public string ProvideValue(IServiceProvider serviceProvider)
{
return LocalizationService.Translate(Key);
}
object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
{
return ProvideValue(serviceProvider);
}
}
+3 -2
View File
@@ -40,6 +40,7 @@ public static class MauiProgram
// Services // Services
builder.Services.AddSingleton<CalendarStateService>(); builder.Services.AddSingleton<CalendarStateService>();
builder.Services.AddSingleton<LocalizationService>();
builder.Services.AddSingleton<AppearanceService>(); builder.Services.AddSingleton<AppearanceService>();
builder.Services.AddSingleton<AggregationService>(); builder.Services.AddSingleton<AggregationService>();
#if ANDROID #if ANDROID
@@ -54,7 +55,7 @@ public static class MauiProgram
builder.Services.AddSingleton<NotificationNavigationService>(); builder.Services.AddSingleton<NotificationNavigationService>();
// Shell / Pages // Shell / Pages
builder.Services.AddSingleton<AppShell>(); builder.Services.AddTransient<AppShell>();
builder.Services.AddTransient<DayPage>(); builder.Services.AddTransient<DayPage>();
builder.Services.AddTransient<QuickEntryPage>(); builder.Services.AddTransient<QuickEntryPage>();
builder.Services.AddTransient<WeekPage>(); builder.Services.AddTransient<WeekPage>();
@@ -72,4 +73,4 @@ public static class MauiProgram
return builder.Build(); return builder.Build();
} }
} }
@@ -208,15 +208,19 @@ public sealed class AndroidNotificationScheduler : INotificationScheduler
var redLabel = Preferences.Default.Get(PrefRedLabel, "Rot"); var redLabel = Preferences.Default.Get(PrefRedLabel, "Rot");
var grayLabel = Preferences.Default.Get(PrefGrayLabel, "Schwarz"); var grayLabel = Preferences.Default.Get(PrefGrayLabel, "Schwarz");
var smallIcon = context.ApplicationInfo?.Icon ?? global::Android.Resource.Drawable.IcDialogInfo; // A dedicated monochrome status icon is more reliable for Android system surfaces,
// including mirrored smartwatch notifications, than the adaptive launcher icon.
var smallIcon = global::Android.Resource.Drawable.IcDialogInfo;
var builder = new NotificationCompat.Builder(context, channelId); var builder = new NotificationCompat.Builder(context, channelId);
builder.SetSmallIcon(smallIcon); builder.SetSmallIcon(smallIcon);
builder.SetContentTitle(title); builder.SetContentTitle(title);
builder.SetContentText(message); builder.SetContentText(message);
builder.SetStyle(new NotificationCompat.BigTextStyle().BigText(message));
builder.SetCategory(NotificationCompat.CategoryReminder);
builder.SetVisibility((int)NotificationCompat.VisibilityPublic);
builder.SetPriority((int)NotificationPriority.High); builder.SetPriority((int)NotificationPriority.High);
builder.SetAutoCancel(true); builder.SetAutoCancel(true);
builder.SetOnlyAlertOnce(true);
if (openPendingIntent is not null) if (openPendingIntent is not null)
builder.SetContentIntent(openPendingIntent); builder.SetContentIntent(openPendingIntent);

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

+230
View File
@@ -0,0 +1,230 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, ...</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, ...</value>
</resheader>
<data name="App_Loading_Title" xml:space="preserve"><value>Loading</value></data>
<data name="App_Loading_Message" xml:space="preserve"><value>Loading app ...</value></data>
<data name="App_Error_Title" xml:space="preserve"><value>Startup Error</value></data>
<data name="App_Error_Header" xml:space="preserve"><value>Error while starting the app</value></data>
<data name="Tab_Day" xml:space="preserve"><value>Day</value></data>
<data name="Tab_Week" xml:space="preserve"><value>Week</value></data>
<data name="Tab_Month" xml:space="preserve"><value>Month</value></data>
<data name="Tab_Year" xml:space="preserve"><value>Year</value></data>
<data name="Tab_Options" xml:space="preserve"><value>Options</value></data>
<data name="Common_Today" xml:space="preserve"><value>Today</value></data>
<data name="Common_Export" xml:space="preserve"><value>Export</value></data>
<data name="Common_Edit" xml:space="preserve"><value>Edit</value></data>
<data name="Common_Delete" xml:space="preserve"><value>Delete</value></data>
<data name="Common_Cancel" xml:space="preserve"><value>Cancel</value></data>
<data name="Common_Save" xml:space="preserve"><value>Save</value></data>
<data name="Common_Reset" xml:space="preserve"><value>Reset</value></data>
<data name="Common_Active" xml:space="preserve"><value>Active</value></data>
<data name="Common_Inactive" xml:space="preserve"><value>Inactive</value></data>
<data name="Common_Yes" xml:space="preserve"><value>Yes</value></data>
<data name="Common_No" xml:space="preserve"><value>No</value></data>
<data name="Common_OK" xml:space="preserve"><value>OK</value></data>
<data name="Common_Error" xml:space="preserve"><value>Error</value></data>
<data name="Common_Morning" xml:space="preserve"><value>Morning</value></data>
<data name="Common_Afternoon" xml:space="preserve"><value>Afternoon</value></data>
<data name="Common_Default" xml:space="preserve"><value>Default</value></data>
<data name="Common_DefaultValue" xml:space="preserve"><value>Default value</value></data>
<data name="Common_Weekday_Mon" xml:space="preserve"><value>Mon</value></data>
<data name="Common_Weekday_Tue" xml:space="preserve"><value>Tue</value></data>
<data name="Common_Weekday_Wed" xml:space="preserve"><value>Wed</value></data>
<data name="Common_Weekday_Thu" xml:space="preserve"><value>Thu</value></data>
<data name="Common_Weekday_Fri" xml:space="preserve"><value>Fri</value></data>
<data name="Common_Weekday_Sat" xml:space="preserve"><value>Sat</value></data>
<data name="Common_Weekday_Sun" xml:space="preserve"><value>Sun</value></data>
<data name="Common_InactiveSuffix" xml:space="preserve"><value>{0} (inactive)</value></data>
<data name="Date_LongDateFormat" xml:space="preserve"><value>dddd, dd MMMM yyyy</value></data>
<data name="Date_ShortDayFormat" xml:space="preserve"><value>ddd dd/MM</value></data>
<data name="Date_MonthYearFormat" xml:space="preserve"><value>MMMM yyyy</value></data>
<data name="Date_YearFormat" xml:space="preserve"><value>yyyy</value></data>
<data name="Date_ShortNumericFormat" xml:space="preserve"><value>dd/MM/yyyy</value></data>
<data name="DayPage_NoEntries" xml:space="preserve"><value>No entries yet.</value></data>
<data name="DayPage_AddBackfillButton" xml:space="preserve"><value>+ Backfill</value></data>
<data name="DayPage_AddEntryButton" xml:space="preserve"><value>+ Entry</value></data>
<data name="DayPage_HintToday" xml:space="preserve"><value>Today you can set a quick status or create an entry with activity and symptoms.</value></data>
<data name="DayPage_HintPast" xml:space="preserve"><value>For past days you can create a backfill for morning or afternoon.</value></data>
<data name="DayPage_HintFuture" xml:space="preserve"><value>No entries can be created for future days.</value></data>
<data name="DayPage_DeleteAlert_Title" xml:space="preserve"><value>Delete entry</value></data>
<data name="DayPage_DeleteAlert_Message" xml:space="preserve"><value>Do you really want to delete this entry?</value></data>
<data name="DayPage_DetailsShow" xml:space="preserve"><value>Show details</value></data>
<data name="DayPage_DetailsHide" xml:space="preserve"><value>Hide details</value></data>
<data name="DayPage_ActivityFormat" xml:space="preserve"><value>Activity: {0}</value></data>
<data name="DayPage_DurationFormat" xml:space="preserve"><value>Duration: {0}</value></data>
<data name="DayPage_SymptomsFormat" xml:space="preserve"><value>Symptoms: {0}</value></data>
<data name="WeekPage_HeaderFormat" xml:space="preserve"><value>Week {0} - {1}</value></data>
<data name="WeekPage_SummaryShow" xml:space="preserve"><value>Show summary</value></data>
<data name="WeekPage_SummaryHide" xml:space="preserve"><value>Hide summary</value></data>
<data name="WeekPage_ActivitiesFormat" xml:space="preserve"><value>Activities: {0}</value></data>
<data name="WeekPage_SymptomsFormat" xml:space="preserve"><value>Symptoms: {0}</value></data>
<data name="QuickEntry_Title" xml:space="preserve"><value>Entry</value></data>
<data name="QuickEntry_BackfillTitle" xml:space="preserve"><value>Backfill</value></data>
<data name="QuickEntry_DayPartPicker" xml:space="preserve"><value>Part of day</value></data>
<data name="QuickEntry_ActivityLabel" xml:space="preserve"><value>Activity</value></data>
<data name="QuickEntry_ActivityPicker" xml:space="preserve"><value>Activity</value></data>
<data name="QuickEntry_DurationLabel" xml:space="preserve"><value>Duration (HH:mm)</value></data>
<data name="QuickEntry_SymptomsLabel" xml:space="preserve"><value>Symptoms</value></data>
<data name="QuickEntry_SaveButton" xml:space="preserve"><value>Save entry</value></data>
<data name="QuickEntry_FutureDateMessage" xml:space="preserve"><value>Future days cannot be saved.</value></data>
<data name="QuickEntry_SelectedStatusFormat" xml:space="preserve"><value>Selected status: {0}</value></data>
<data name="QuickEntry_SelectStatusPrompt" xml:space="preserve"><value>Please choose a status</value></data>
<data name="Activity_None" xml:space="preserve"><value>No activity</value></data>
<data name="Status_Default_Green" xml:space="preserve"><value>Green</value></data>
<data name="Status_Default_Yellow" xml:space="preserve"><value>Yellow</value></data>
<data name="Status_Default_Red" xml:space="preserve"><value>Red</value></data>
<data name="Status_Default_Gray" xml:space="preserve"><value>Black</value></data>
<data name="Language_Name_German" xml:space="preserve"><value>German</value></data>
<data name="Language_Name_English" xml:space="preserve"><value>English</value></data>
<data name="Language_SystemOption" xml:space="preserve"><value>System ({0})</value></data>
<data name="Options_Tab_Appearance" xml:space="preserve"><value>Appearance</value></data>
<data name="Options_Tab_Notifications" xml:space="preserve"><value>Notifications</value></data>
<data name="Options_Tab_Data" xml:space="preserve"><value>Data management</value></data>
<data name="Options_Tab_Legal" xml:space="preserve"><value>Legal</value></data>
<data name="Options_Appearance_Title" xml:space="preserve"><value>Appearance</value></data>
<data name="Options_Appearance_Description" xml:space="preserve"><value>Edit status texts and language first. Color adjustments are shown below in the color dialog.</value></data>
<data name="Options_Appearance_LanguageLabel" xml:space="preserve"><value>App language</value></data>
<data name="Options_Appearance_LanguagePicker" xml:space="preserve"><value>Select language</value></data>
<data name="Options_Appearance_ChooseColor" xml:space="preserve"><value>Choose color</value></data>
<data name="Options_Language_SystemHint" xml:space="preserve"><value>Automatically detected from the system language: {0}</value></data>
<data name="Options_Language_SelectedHint" xml:space="preserve"><value>Current app language: {0}</value></data>
<data name="Options_Status_AppearanceSaved" xml:space="preserve"><value>Appearance saved.</value></data>
<data name="Options_Status_AppearanceReset" xml:space="preserve"><value>Appearance reset to defaults.</value></data>
<data name="Options_UsageHint_Used" xml:space="preserve"><value>Already used, can only be deactivated.</value></data>
<data name="Options_UsageHint_Unused" xml:space="preserve"><value>Can be deleted as long as it is unused.</value></data>
<data name="Options_Database_CurrentPathFormat" xml:space="preserve"><value>Current path: {0}</value></data>
<data name="Common_Add" xml:space="preserve"><value>Add</value></data>
<data name="Common_Apply" xml:space="preserve"><value>Apply</value></data>
<data name="Common_From" xml:space="preserve"><value>From</value></data>
<data name="Common_To" xml:space="preserve"><value>To</value></data>
<data name="Options_Notifications_Title" xml:space="preserve"><value>Notifications</value></data>
<data name="Options_Notifications_Description" xml:space="preserve"><value>A time block can be active on multiple weekdays.</value></data>
<data name="Options_Notifications_VibrationLabel" xml:space="preserve"><value>Vibration for notifications</value></data>
<data name="Options_Notifications_VibrationHint" xml:space="preserve"><value>On Android the matching notification channel is used automatically.</value></data>
<data name="Options_Notifications_AddTime" xml:space="preserve"><value>Add time</value></data>
<data name="Options_Notifications_Save" xml:space="preserve"><value>Save notification times</value></data>
<data name="Options_Export_Title" xml:space="preserve"><value>Export</value></data>
<data name="Options_Export_Description" xml:space="preserve"><value>Choose the date range and layout. After creating the export you can open or share it directly.</value></data>
<data name="Options_Export_FilterTitle" xml:space="preserve"><value>Filters (optional)</value></data>
<data name="Options_Export_SymptomsHint" xml:space="preserve"><value>Multiple selection is possible.</value></data>
<data name="Options_Export_ResetFilters" xml:space="preserve"><value>Reset filters</value></data>
<data name="Options_Export_ModeTitle" xml:space="preserve"><value>Export mode</value></data>
<data name="Options_Export_Mode_DayView" xml:space="preserve"><value>Day view</value></data>
<data name="Options_Export_Mode_WeekBlock" xml:space="preserve"><value>Week block</value></data>
<data name="Options_Export_Mode_DaySummary" xml:space="preserve"><value>Day summary</value></data>
<data name="Options_Export_Create" xml:space="preserve"><value>Create export</value></data>
<data name="Options_Export_Clear" xml:space="preserve"><value>Clear exports</value></data>
<data name="Options_Export_RangeSingleFormat" xml:space="preserve"><value>1 day selected: {0}</value></data>
<data name="Options_Export_RangeMultipleFormat" xml:space="preserve"><value>{0} days selected: {1} to {2}</value></data>
<data name="Options_Export_LayoutDescription_DayView" xml:space="preserve"><value>Day view: each day is exported with all individual entries, activities, duration and symptoms.</value></data>
<data name="Options_Export_LayoutDescription_WeekBlock" xml:space="preserve"><value>Week block: each day shows morning and afternoon with status, activities, total duration and symptoms.</value></data>
<data name="Options_Export_LayoutDescription_DaySummary" xml:space="preserve"><value>Day summary: each day appears compactly in a single line, similar to the month and year exports.</value></data>
<data name="Options_Export_Filter_ActivityFormat" xml:space="preserve"><value>Activity: {0}</value></data>
<data name="Options_Export_Filter_SymptomsFormat" xml:space="preserve"><value>Symptoms: {0}</value></data>
<data name="Options_Export_Filter_None" xml:space="preserve"><value>No filters active.</value></data>
<data name="Options_Export_SymptomsHide" xml:space="preserve"><value>Hide symptoms</value></data>
<data name="Options_Export_SymptomsHideWithCount" xml:space="preserve"><value>Hide symptoms ({0} selected)</value></data>
<data name="Options_Export_SymptomsSelect" xml:space="preserve"><value>Select symptoms</value></data>
<data name="Options_Export_SymptomsSelectWithCount" xml:space="preserve"><value>Select symptoms ({0} selected)</value></data>
<data name="Options_Export_AllActivities" xml:space="preserve"><value>All activities</value></data>
<data name="Options_Export_Clear_Confirm" xml:space="preserve"><value>Do you really want to delete all locally saved exports?</value></data>
<data name="Options_Export_Clear_ResultDeletedFormat" xml:space="preserve"><value>{0} export file(s) were deleted.</value></data>
<data name="Options_Export_Clear_ResultEmpty" xml:space="preserve"><value>There were no export files.</value></data>
<data name="Options_Export_ActionsTitle" xml:space="preserve"><value>Export saved:&#xA;{0}</value></data>
<data name="Options_Export_ActionClose" xml:space="preserve"><value>Close</value></data>
<data name="Options_Export_ActionOpen" xml:space="preserve"><value>Open</value></data>
<data name="Options_Export_ActionShare" xml:space="preserve"><value>Share</value></data>
<data name="Options_Export_OpenTitle" xml:space="preserve"><value>Open export</value></data>
<data name="Options_Export_ShareTitle" xml:space="preserve"><value>Share export</value></data>
<data name="Options_Data_ActivitiesTitle" xml:space="preserve"><value>Activities</value></data>
<data name="Options_Data_NewActivityPlaceholder" xml:space="preserve"><value>New activity</value></data>
<data name="Options_Data_ToggleActive" xml:space="preserve"><value>Activate/Deactivate</value></data>
<data name="Options_Data_SymptomsTitle" xml:space="preserve"><value>Symptoms</value></data>
<data name="Options_Data_NewSymptomPlaceholder" xml:space="preserve"><value>New symptom</value></data>
<data name="Options_Data_DeleteAllTitle" xml:space="preserve"><value>Delete all entries</value></data>
<data name="Options_Data_DeleteAllDescription" xml:space="preserve"><value>Type 'delete' to confirm.</value></data>
<data name="Options_Data_DeleteConfirmationKeyword" xml:space="preserve"><value>delete</value></data>
<data name="Options_Data_DeleteAllButton" xml:space="preserve"><value>Delete everything</value></data>
<data name="Options_Database_Title" xml:space="preserve"><value>Database</value></data>
<data name="Options_Database_UseExternal" xml:space="preserve"><value>Use external database</value></data>
<data name="Options_Database_ExternalPathPlaceholder" xml:space="preserve"><value>Folder or file path for external DB</value></data>
<data name="Options_Database_Hint" xml:space="preserve"><value>For SQLite, an external file path can be useful. For real multi-user synchronization, a dedicated server or API layer would be the better long-term option.</value></data>
<data name="Options_Database_Save" xml:space="preserve"><value>Save database path</value></data>
<data name="Options_Status_AllDataDeleted" xml:space="preserve"><value>All entries were deleted.</value></data>
<data name="Options_Status_ActivityNameRequired" xml:space="preserve"><value>Please enter an activity name first.</value></data>
<data name="Options_Status_ActivityAdded" xml:space="preserve"><value>Activity added.</value></data>
<data name="Options_Status_ActivitySaved" xml:space="preserve"><value>Activity saved.</value></data>
<data name="Options_Status_ActivityUpdated" xml:space="preserve"><value>Activity updated.</value></data>
<data name="Options_Status_ActivityDisabled" xml:space="preserve"><value>Activity was deactivated.</value></data>
<data name="Options_Status_ActivityDeleted" xml:space="preserve"><value>Activity was deleted.</value></data>
<data name="Options_Status_SymptomNameRequired" xml:space="preserve"><value>Please enter a symptom name first.</value></data>
<data name="Options_Status_SymptomAdded" xml:space="preserve"><value>Symptom added.</value></data>
<data name="Options_Status_SymptomSaved" xml:space="preserve"><value>Symptom saved.</value></data>
<data name="Options_Status_SymptomUpdated" xml:space="preserve"><value>Symptom updated.</value></data>
<data name="Options_Status_SymptomDisabled" xml:space="preserve"><value>Symptom was deactivated.</value></data>
<data name="Options_Status_SymptomDeleted" xml:space="preserve"><value>Symptom was deleted.</value></data>
<data name="Options_Status_NotificationAdded" xml:space="preserve"><value>Notification time added.</value></data>
<data name="Options_Status_NotificationRemoved" xml:space="preserve"><value>Notification time removed.</value></data>
<data name="Options_Status_NotificationPermissionAndroid31" xml:space="preserve"><value>Please allow notifications, push messages and alarms, then save again.</value></data>
<data name="Options_Status_NotificationPermissionLegacy" xml:space="preserve"><value>Please allow notifications and push messages, then save again.</value></data>
<data name="Options_Status_NotificationWeekdayRequired" xml:space="preserve"><value>Please select at least one weekday for each notification time.</value></data>
<data name="Options_Status_NotificationsSavedActive" xml:space="preserve"><value>Notification times saved. Vibration is active.</value></data>
<data name="Options_Status_NotificationsSavedInactive" xml:space="preserve"><value>Notification times saved. Vibration is off.</value></data>
<data name="Options_Status_DatabaseSaved" xml:space="preserve"><value>Database path saved. Please restart the app so the path becomes active.</value></data>
<data name="Options_Status_ExportCreated" xml:space="preserve"><value>Export created: {0}</value></data>
<data name="Options_Appearance_Color_AppBackground" xml:space="preserve"><value>App background</value></data>
<data name="Options_Appearance_Color_SurfaceBackground" xml:space="preserve"><value>Card background</value></data>
<data name="Options_Appearance_Color_SurfaceBackgroundAlt" xml:space="preserve"><value>Secondary surface</value></data>
<data name="Options_Appearance_Color_Border" xml:space="preserve"><value>Border</value></data>
<data name="Options_Appearance_Color_TextPrimary" xml:space="preserve"><value>Primary text</value></data>
<data name="Options_Appearance_Color_TextMuted" xml:space="preserve"><value>Muted text</value></data>
<data name="Options_Appearance_Color_StateGreen" xml:space="preserve"><value>Green status color</value></data>
<data name="Options_Appearance_Color_StateYellow" xml:space="preserve"><value>Yellow status color</value></data>
<data name="Options_Appearance_Color_StateRed" xml:space="preserve"><value>Red status color</value></data>
<data name="Options_Appearance_Color_StateGray" xml:space="preserve"><value>Black / gray status color</value></data>
<data name="Options_Appearance_Color_ButtonPrimaryBackground" xml:space="preserve"><value>Primary button background</value></data>
<data name="Options_Appearance_Color_ButtonPrimaryText" xml:space="preserve"><value>Primary button text</value></data>
<data name="Options_Appearance_Color_ButtonSecondaryBackground" xml:space="preserve"><value>Secondary button background</value></data>
<data name="Options_Appearance_Color_ButtonSecondaryText" xml:space="preserve"><value>Secondary button text</value></data>
<data name="Options_Appearance_Color_ShellBackground" xml:space="preserve"><value>App bar background</value></data>
<data name="Options_Appearance_Color_ShellForeground" xml:space="preserve"><value>App bar foreground</value></data>
<data name="Options_Appearance_Color_ShellTitle" xml:space="preserve"><value>App bar title</value></data>
<data name="Options_Appearance_Color_ShellUnselected" xml:space="preserve"><value>App bar inactive</value></data>
<data name="Options_Appearance_Color_TabBarBackground" xml:space="preserve"><value>Tab bar background</value></data>
<data name="Options_Appearance_Color_TabBarForeground" xml:space="preserve"><value>Tab bar active</value></data>
<data name="Options_Appearance_Color_TabBarTitle" xml:space="preserve"><value>Tab bar title</value></data>
<data name="Options_Appearance_Color_TabBarUnselected" xml:space="preserve"><value>Tab bar inactive</value></data>
<data name="Options_Appearance_Text_Green" xml:space="preserve"><value>Text for green</value></data>
<data name="Options_Appearance_Text_Yellow" xml:space="preserve"><value>Text for yellow</value></data>
<data name="Options_Appearance_Text_Red" xml:space="preserve"><value>Text for red</value></data>
<data name="Options_Appearance_Text_Gray" xml:space="preserve"><value>Text for black / gray</value></data>
<data name="Options_Legal_PrivacyTitle" xml:space="preserve"><value>Privacy policy</value></data>
<data name="Options_Legal_PrivacyDate" xml:space="preserve"><value>As of: April 3, 2026</value></data>
<data name="Options_Legal_PrivacyBody1" xml:space="preserve"><value>This app processes your entries exclusively for use on your device. No user data is automatically transmitted to me or to third parties, sold, or shared for advertising purposes.</value></data>
<data name="Options_Legal_PrivacyBody2" xml:space="preserve"><value>Saved data includes entries, selection lists, notification schedules, appearance settings and, when needed, locally created export files. The app does not offer cloud synchronization or automatic background uploads.</value></data>
<data name="Options_Legal_PrivacyBody3" xml:space="preserve"><value>Data is stored locally in the internal app area or in a storage location chosen by you. The data is kept in technical app structures and is not intended for direct public display. However, direct technical access to the device or files may allow knowledgeable persons to infer the type and content of stored data.</value></data>
<data name="Options_Legal_PrivacyBody4" xml:space="preserve"><value>If you intentionally share export files or use an external database path, you decide yourself about that storage or transfer path.</value></data>
<data name="Options_Legal_DisclaimerTitle" xml:space="preserve"><value>Disclaimer</value></data>
<data name="Options_Legal_DisclaimerBody1" xml:space="preserve"><value>Use of the app is at your own risk. To the extent permitted by law, I accept no warranty or liability for timeliness, accuracy, completeness, technical availability, data loss, or suitability for a specific purpose.</value></data>
<data name="Options_Legal_DisclaimerBody2" xml:space="preserve"><value>The app does not replace medical, therapeutic, nursing, legal, or technical professional advice.</value></data>
<data name="Options_Legal_PersonalTitle" xml:space="preserve"><value>Personal note</value></data>
<data name="Options_Legal_PersonalBody1" xml:space="preserve"><value>This app was not developed by a professional software engineer. I am personally affected by ME/CFS and created the application from my own perspective and experience.</value></data>
<data name="Options_Legal_PersonalBody2" xml:space="preserve"><value>That is exactly why the app is meant to help in everyday life, but it remains a personal project and not a professionally certified medical or software product.</value></data>
<data name="Options_ColorDialog_EditTitle" xml:space="preserve"><value>Edit color</value></data>
<data name="Options_ColorDialog_Red" xml:space="preserve"><value>Red</value></data>
<data name="Options_ColorDialog_Green" xml:space="preserve"><value>Green</value></data>
<data name="Options_ColorDialog_Blue" xml:space="preserve"><value>Blue</value></data>
<data name="Options_ColorDialog_Brightness" xml:space="preserve"><value>Brightness</value></data>
<data name="Options_ColorDialog_Hint" xml:space="preserve"><value>Reset only loads the default value into the dialog. The change is saved only after Apply. Cancel discards everything from this dialog.</value></data>
</root>
+230
View File
@@ -0,0 +1,230 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, ...</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, ...</value>
</resheader>
<data name="App_Loading_Title" xml:space="preserve"><value>Laden</value></data>
<data name="App_Loading_Message" xml:space="preserve"><value>App wird geladen ...</value></data>
<data name="App_Error_Title" xml:space="preserve"><value>Startfehler</value></data>
<data name="App_Error_Header" xml:space="preserve"><value>Fehler beim Starten der App</value></data>
<data name="Tab_Day" xml:space="preserve"><value>Tag</value></data>
<data name="Tab_Week" xml:space="preserve"><value>Woche</value></data>
<data name="Tab_Month" xml:space="preserve"><value>Monat</value></data>
<data name="Tab_Year" xml:space="preserve"><value>Jahr</value></data>
<data name="Tab_Options" xml:space="preserve"><value>Optionen</value></data>
<data name="Common_Today" xml:space="preserve"><value>Heute</value></data>
<data name="Common_Export" xml:space="preserve"><value>Export</value></data>
<data name="Common_Edit" xml:space="preserve"><value>Bearbeiten</value></data>
<data name="Common_Delete" xml:space="preserve"><value>Löschen</value></data>
<data name="Common_Cancel" xml:space="preserve"><value>Abbrechen</value></data>
<data name="Common_Save" xml:space="preserve"><value>Speichern</value></data>
<data name="Common_Reset" xml:space="preserve"><value>Zurücksetzen</value></data>
<data name="Common_Active" xml:space="preserve"><value>Aktiv</value></data>
<data name="Common_Inactive" xml:space="preserve"><value>Inaktiv</value></data>
<data name="Common_Yes" xml:space="preserve"><value>Ja</value></data>
<data name="Common_No" xml:space="preserve"><value>Nein</value></data>
<data name="Common_OK" xml:space="preserve"><value>OK</value></data>
<data name="Common_Error" xml:space="preserve"><value>Fehler</value></data>
<data name="Common_Morning" xml:space="preserve"><value>Vormittag</value></data>
<data name="Common_Afternoon" xml:space="preserve"><value>Nachmittag</value></data>
<data name="Common_Default" xml:space="preserve"><value>Standard</value></data>
<data name="Common_DefaultValue" xml:space="preserve"><value>Standardwert</value></data>
<data name="Common_Weekday_Mon" xml:space="preserve"><value>Mo</value></data>
<data name="Common_Weekday_Tue" xml:space="preserve"><value>Di</value></data>
<data name="Common_Weekday_Wed" xml:space="preserve"><value>Mi</value></data>
<data name="Common_Weekday_Thu" xml:space="preserve"><value>Do</value></data>
<data name="Common_Weekday_Fri" xml:space="preserve"><value>Fr</value></data>
<data name="Common_Weekday_Sat" xml:space="preserve"><value>Sa</value></data>
<data name="Common_Weekday_Sun" xml:space="preserve"><value>So</value></data>
<data name="Common_InactiveSuffix" xml:space="preserve"><value>{0} (inaktiv)</value></data>
<data name="Date_LongDateFormat" xml:space="preserve"><value>dddd, dd. MMMM yyyy</value></data>
<data name="Date_ShortDayFormat" xml:space="preserve"><value>ddd dd.MM.</value></data>
<data name="Date_MonthYearFormat" xml:space="preserve"><value>MMMM yyyy</value></data>
<data name="Date_YearFormat" xml:space="preserve"><value>yyyy</value></data>
<data name="Date_ShortNumericFormat" xml:space="preserve"><value>dd.MM.yyyy</value></data>
<data name="DayPage_NoEntries" xml:space="preserve"><value>Noch keine Einträge vorhanden.</value></data>
<data name="DayPage_AddBackfillButton" xml:space="preserve"><value>+ Nachtrag</value></data>
<data name="DayPage_AddEntryButton" xml:space="preserve"><value>+ Eintrag</value></data>
<data name="DayPage_HintToday" xml:space="preserve"><value>Heute kannst du Schnellstatus oder einen Eintrag mit Tätigkeit und Symptomen setzen.</value></data>
<data name="DayPage_HintPast" xml:space="preserve"><value>Für vergangene Tage legst du einen Nachtrag für Vormittag oder Nachmittag an.</value></data>
<data name="DayPage_HintFuture" xml:space="preserve"><value>Für zukünftige Tage sind keine Einträge möglich.</value></data>
<data name="DayPage_DeleteAlert_Title" xml:space="preserve"><value>Eintrag löschen</value></data>
<data name="DayPage_DeleteAlert_Message" xml:space="preserve"><value>Soll dieser Eintrag wirklich gelöscht werden?</value></data>
<data name="DayPage_DetailsShow" xml:space="preserve"><value>Details anzeigen</value></data>
<data name="DayPage_DetailsHide" xml:space="preserve"><value>Details ausblenden</value></data>
<data name="DayPage_ActivityFormat" xml:space="preserve"><value>Tätigkeit: {0}</value></data>
<data name="DayPage_DurationFormat" xml:space="preserve"><value>Dauer: {0}</value></data>
<data name="DayPage_SymptomsFormat" xml:space="preserve"><value>Symptome: {0}</value></data>
<data name="WeekPage_HeaderFormat" xml:space="preserve"><value>Woche {0} - {1}</value></data>
<data name="WeekPage_SummaryShow" xml:space="preserve"><value>Zusammenfassung anzeigen</value></data>
<data name="WeekPage_SummaryHide" xml:space="preserve"><value>Zusammenfassung ausblenden</value></data>
<data name="WeekPage_ActivitiesFormat" xml:space="preserve"><value>Tätigkeiten: {0}</value></data>
<data name="WeekPage_SymptomsFormat" xml:space="preserve"><value>Symptome: {0}</value></data>
<data name="QuickEntry_Title" xml:space="preserve"><value>Eintrag</value></data>
<data name="QuickEntry_BackfillTitle" xml:space="preserve"><value>Nachtrag</value></data>
<data name="QuickEntry_DayPartPicker" xml:space="preserve"><value>Tageszeit</value></data>
<data name="QuickEntry_ActivityLabel" xml:space="preserve"><value>Tätigkeit</value></data>
<data name="QuickEntry_ActivityPicker" xml:space="preserve"><value>Tätigkeit</value></data>
<data name="QuickEntry_DurationLabel" xml:space="preserve"><value>Dauer (HH:mm)</value></data>
<data name="QuickEntry_SymptomsLabel" xml:space="preserve"><value>Symptome</value></data>
<data name="QuickEntry_SaveButton" xml:space="preserve"><value>Eintrag speichern</value></data>
<data name="QuickEntry_FutureDateMessage" xml:space="preserve"><value>Zukünftige Tage können nicht gespeichert werden.</value></data>
<data name="QuickEntry_SelectedStatusFormat" xml:space="preserve"><value>Gewählter Status: {0}</value></data>
<data name="QuickEntry_SelectStatusPrompt" xml:space="preserve"><value>Bitte Status wählen</value></data>
<data name="Activity_None" xml:space="preserve"><value>Keine Tätigkeit</value></data>
<data name="Status_Default_Green" xml:space="preserve"><value>Grün</value></data>
<data name="Status_Default_Yellow" xml:space="preserve"><value>Gelb</value></data>
<data name="Status_Default_Red" xml:space="preserve"><value>Rot</value></data>
<data name="Status_Default_Gray" xml:space="preserve"><value>Schwarz</value></data>
<data name="Language_Name_German" xml:space="preserve"><value>Deutsch</value></data>
<data name="Language_Name_English" xml:space="preserve"><value>English</value></data>
<data name="Language_SystemOption" xml:space="preserve"><value>System ({0})</value></data>
<data name="Options_Tab_Appearance" xml:space="preserve"><value>Aussehen</value></data>
<data name="Options_Tab_Notifications" xml:space="preserve"><value>Push-Nachrichten</value></data>
<data name="Options_Tab_Data" xml:space="preserve"><value>Datenverwaltung</value></data>
<data name="Options_Tab_Legal" xml:space="preserve"><value>Rechtliches</value></data>
<data name="Options_Appearance_Title" xml:space="preserve"><value>Aussehen</value></data>
<data name="Options_Appearance_Description" xml:space="preserve"><value>Bearbeite zuerst Statustexte und Sprache. Die Farben werden darunter im Farbdialog angepasst.</value></data>
<data name="Options_Appearance_LanguageLabel" xml:space="preserve"><value>App-Sprache</value></data>
<data name="Options_Appearance_LanguagePicker" xml:space="preserve"><value>Sprache auswählen</value></data>
<data name="Options_Appearance_ChooseColor" xml:space="preserve"><value>Farbe wählen</value></data>
<data name="Options_Language_SystemHint" xml:space="preserve"><value>Automatisch erkannt über die Systemsprache: {0}</value></data>
<data name="Options_Language_SelectedHint" xml:space="preserve"><value>Aktive App-Sprache: {0}</value></data>
<data name="Options_Status_AppearanceSaved" xml:space="preserve"><value>Aussehen gespeichert.</value></data>
<data name="Options_Status_AppearanceReset" xml:space="preserve"><value>Aussehen auf Standard zurückgesetzt.</value></data>
<data name="Options_UsageHint_Used" xml:space="preserve"><value>Bereits verwendet, kann nur deaktiviert werden.</value></data>
<data name="Options_UsageHint_Unused" xml:space="preserve"><value>Kann gelöscht werden, solange unbenutzt.</value></data>
<data name="Options_Database_CurrentPathFormat" xml:space="preserve"><value>Aktiver Pfad: {0}</value></data>
<data name="Common_Add" xml:space="preserve"><value>Hinzufügen</value></data>
<data name="Common_Apply" xml:space="preserve"><value>Übernehmen</value></data>
<data name="Common_From" xml:space="preserve"><value>Von</value></data>
<data name="Common_To" xml:space="preserve"><value>Bis</value></data>
<data name="Options_Notifications_Title" xml:space="preserve"><value>Push-Benachrichtigungen</value></data>
<data name="Options_Notifications_Description" xml:space="preserve"><value>Ein Zeitblock kann auf mehreren Wochentagen aktiv sein.</value></data>
<data name="Options_Notifications_VibrationLabel" xml:space="preserve"><value>Vibration für Push-Nachrichten</value></data>
<data name="Options_Notifications_VibrationHint" xml:space="preserve"><value>Auf Android wird dafür automatisch der passende Benachrichtigungskanal verwendet.</value></data>
<data name="Options_Notifications_AddTime" xml:space="preserve"><value>Zeit hinzufügen</value></data>
<data name="Options_Notifications_Save" xml:space="preserve"><value>Benachrichtigungszeiten speichern</value></data>
<data name="Options_Export_Title" xml:space="preserve"><value>Export</value></data>
<data name="Options_Export_Description" xml:space="preserve"><value>Lege Zeitraum und Darstellung fest. Nach dem Erstellen kannst du den Export direkt öffnen oder teilen.</value></data>
<data name="Options_Export_FilterTitle" xml:space="preserve"><value>Filter (optional)</value></data>
<data name="Options_Export_SymptomsHint" xml:space="preserve"><value>Mehrfachauswahl möglich.</value></data>
<data name="Options_Export_ResetFilters" xml:space="preserve"><value>Filter zurücksetzen</value></data>
<data name="Options_Export_ModeTitle" xml:space="preserve"><value>Exportmodus</value></data>
<data name="Options_Export_Mode_DayView" xml:space="preserve"><value>Tagesansicht</value></data>
<data name="Options_Export_Mode_WeekBlock" xml:space="preserve"><value>Wochenblock</value></data>
<data name="Options_Export_Mode_DaySummary" xml:space="preserve"><value>Tageszusammenfassung</value></data>
<data name="Options_Export_Create" xml:space="preserve"><value>Export erstellen</value></data>
<data name="Options_Export_Clear" xml:space="preserve"><value>Export leeren</value></data>
<data name="Options_Export_RangeSingleFormat" xml:space="preserve"><value>1 Tag ausgewählt: {0}</value></data>
<data name="Options_Export_RangeMultipleFormat" xml:space="preserve"><value>{0} Tage ausgewählt: {1} bis {2}</value></data>
<data name="Options_Export_LayoutDescription_DayView" xml:space="preserve"><value>Tagesansicht: Jeder Tag wird mit allen einzelnen Einträgen, Tätigkeiten, Dauer und Symptomen exportiert.</value></data>
<data name="Options_Export_LayoutDescription_WeekBlock" xml:space="preserve"><value>Wochenblock: Pro Tag werden Vormittag und Nachmittag mit Status, Tätigkeiten, Gesamtdauer und Symptomen dargestellt.</value></data>
<data name="Options_Export_LayoutDescription_DaySummary" xml:space="preserve"><value>Tageszusammenfassung: Jeder Tag erscheint kompakt in einer Zeile, ähnlich wie bei Monats- und Jahresexporten.</value></data>
<data name="Options_Export_Filter_ActivityFormat" xml:space="preserve"><value>Tätigkeit: {0}</value></data>
<data name="Options_Export_Filter_SymptomsFormat" xml:space="preserve"><value>Symptome: {0}</value></data>
<data name="Options_Export_Filter_None" xml:space="preserve"><value>Keine Filter aktiv.</value></data>
<data name="Options_Export_SymptomsHide" xml:space="preserve"><value>Symptome ausblenden</value></data>
<data name="Options_Export_SymptomsHideWithCount" xml:space="preserve"><value>Symptome ausblenden ({0} ausgewählt)</value></data>
<data name="Options_Export_SymptomsSelect" xml:space="preserve"><value>Symptome auswählen</value></data>
<data name="Options_Export_SymptomsSelectWithCount" xml:space="preserve"><value>Symptome auswählen ({0} ausgewählt)</value></data>
<data name="Options_Export_AllActivities" xml:space="preserve"><value>Alle Tätigkeiten</value></data>
<data name="Options_Export_Clear_Confirm" xml:space="preserve"><value>Möchtest du wirklich alle lokal gespeicherten Exporte löschen?</value></data>
<data name="Options_Export_Clear_ResultDeletedFormat" xml:space="preserve"><value>{0} Export-Datei(en) wurden gelöscht.</value></data>
<data name="Options_Export_Clear_ResultEmpty" xml:space="preserve"><value>Es waren keine Export-Dateien vorhanden.</value></data>
<data name="Options_Export_ActionsTitle" xml:space="preserve"><value>Export gespeichert:&#xA;{0}</value></data>
<data name="Options_Export_ActionClose" xml:space="preserve"><value>Schließen</value></data>
<data name="Options_Export_ActionOpen" xml:space="preserve"><value>Öffnen</value></data>
<data name="Options_Export_ActionShare" xml:space="preserve"><value>Teilen</value></data>
<data name="Options_Export_OpenTitle" xml:space="preserve"><value>Export öffnen</value></data>
<data name="Options_Export_ShareTitle" xml:space="preserve"><value>Export teilen</value></data>
<data name="Options_Data_ActivitiesTitle" xml:space="preserve"><value>Tätigkeiten</value></data>
<data name="Options_Data_NewActivityPlaceholder" xml:space="preserve"><value>Neue Tätigkeit</value></data>
<data name="Options_Data_ToggleActive" xml:space="preserve"><value>Aktiv/Inaktiv</value></data>
<data name="Options_Data_SymptomsTitle" xml:space="preserve"><value>Symptome</value></data>
<data name="Options_Data_NewSymptomPlaceholder" xml:space="preserve"><value>Neues Symptom</value></data>
<data name="Options_Data_DeleteAllTitle" xml:space="preserve"><value>Alle Einträge löschen</value></data>
<data name="Options_Data_DeleteAllDescription" xml:space="preserve"><value>Zum Bestätigen 'löschen' eingeben.</value></data>
<data name="Options_Data_DeleteConfirmationKeyword" xml:space="preserve"><value>löschen</value></data>
<data name="Options_Data_DeleteAllButton" xml:space="preserve"><value>Alles löschen</value></data>
<data name="Options_Database_Title" xml:space="preserve"><value>Datenbank</value></data>
<data name="Options_Database_UseExternal" xml:space="preserve"><value>Externe Datenbank verwenden</value></data>
<data name="Options_Database_ExternalPathPlaceholder" xml:space="preserve"><value>Ordner oder Dateipfad für externe DB</value></data>
<data name="Options_Database_Hint" xml:space="preserve"><value>Für SQLite ist ein externer Dateipfad sinnvoll. Für echte Mehrbenutzer-Synchronisierung ist später eher ein eigener Server oder eine API-Schicht besser geeignet.</value></data>
<data name="Options_Database_Save" xml:space="preserve"><value>Datenbankpfad speichern</value></data>
<data name="Options_Status_AllDataDeleted" xml:space="preserve"><value>Alle Einträge wurden gelöscht.</value></data>
<data name="Options_Status_ActivityNameRequired" xml:space="preserve"><value>Bitte zuerst einen Tätigkeitsnamen eingeben.</value></data>
<data name="Options_Status_ActivityAdded" xml:space="preserve"><value>Tätigkeit hinzugefügt.</value></data>
<data name="Options_Status_ActivitySaved" xml:space="preserve"><value>Tätigkeit gespeichert.</value></data>
<data name="Options_Status_ActivityUpdated" xml:space="preserve"><value>Tätigkeit aktualisiert.</value></data>
<data name="Options_Status_ActivityDisabled" xml:space="preserve"><value>Tätigkeit wurde deaktiviert.</value></data>
<data name="Options_Status_ActivityDeleted" xml:space="preserve"><value>Tätigkeit wurde gelöscht.</value></data>
<data name="Options_Status_SymptomNameRequired" xml:space="preserve"><value>Bitte zuerst einen Symptomnamen eingeben.</value></data>
<data name="Options_Status_SymptomAdded" xml:space="preserve"><value>Symptom hinzugefügt.</value></data>
<data name="Options_Status_SymptomSaved" xml:space="preserve"><value>Symptom gespeichert.</value></data>
<data name="Options_Status_SymptomUpdated" xml:space="preserve"><value>Symptom aktualisiert.</value></data>
<data name="Options_Status_SymptomDisabled" xml:space="preserve"><value>Symptom wurde deaktiviert.</value></data>
<data name="Options_Status_SymptomDeleted" xml:space="preserve"><value>Symptom wurde gelöscht.</value></data>
<data name="Options_Status_NotificationAdded" xml:space="preserve"><value>Benachrichtigungszeit hinzugefügt.</value></data>
<data name="Options_Status_NotificationRemoved" xml:space="preserve"><value>Benachrichtigungszeit entfernt.</value></data>
<data name="Options_Status_NotificationPermissionAndroid31" xml:space="preserve"><value>Bitte Benachrichtigungen, Push-Nachrichten und Alarme erlauben und danach erneut speichern.</value></data>
<data name="Options_Status_NotificationPermissionLegacy" xml:space="preserve"><value>Bitte Benachrichtigungen und Push-Nachrichten erlauben und danach erneut speichern.</value></data>
<data name="Options_Status_NotificationWeekdayRequired" xml:space="preserve"><value>Bitte pro Benachrichtigungszeit mindestens einen Wochentag auswählen.</value></data>
<data name="Options_Status_NotificationsSavedActive" xml:space="preserve"><value>Benachrichtigungszeiten gespeichert. Vibration ist aktiv.</value></data>
<data name="Options_Status_NotificationsSavedInactive" xml:space="preserve"><value>Benachrichtigungszeiten gespeichert. Vibration ist aus.</value></data>
<data name="Options_Status_DatabaseSaved" xml:space="preserve"><value>Datenbankpfad gespeichert. Bitte App neu starten, damit der Pfad aktiv wird.</value></data>
<data name="Options_Status_ExportCreated" xml:space="preserve"><value>Export erstellt: {0}</value></data>
<data name="Options_Appearance_Color_AppBackground" xml:space="preserve"><value>App-Hintergrund</value></data>
<data name="Options_Appearance_Color_SurfaceBackground" xml:space="preserve"><value>Karten-Hintergrund</value></data>
<data name="Options_Appearance_Color_SurfaceBackgroundAlt" xml:space="preserve"><value>Sekundäre Fläche</value></data>
<data name="Options_Appearance_Color_Border" xml:space="preserve"><value>Rahmen</value></data>
<data name="Options_Appearance_Color_TextPrimary" xml:space="preserve"><value>Haupttext</value></data>
<data name="Options_Appearance_Color_TextMuted" xml:space="preserve"><value>Nebentext</value></data>
<data name="Options_Appearance_Color_StateGreen" xml:space="preserve"><value>Statusfarbe Grün</value></data>
<data name="Options_Appearance_Color_StateYellow" xml:space="preserve"><value>Statusfarbe Gelb</value></data>
<data name="Options_Appearance_Color_StateRed" xml:space="preserve"><value>Statusfarbe Rot</value></data>
<data name="Options_Appearance_Color_StateGray" xml:space="preserve"><value>Statusfarbe Schwarz / Grau</value></data>
<data name="Options_Appearance_Color_ButtonPrimaryBackground" xml:space="preserve"><value>Button Primär Hintergrund</value></data>
<data name="Options_Appearance_Color_ButtonPrimaryText" xml:space="preserve"><value>Button Primär Text</value></data>
<data name="Options_Appearance_Color_ButtonSecondaryBackground" xml:space="preserve"><value>Button Sekundär Hintergrund</value></data>
<data name="Options_Appearance_Color_ButtonSecondaryText" xml:space="preserve"><value>Button Sekundär Text</value></data>
<data name="Options_Appearance_Color_ShellBackground" xml:space="preserve"><value>App-Leiste Hintergrund</value></data>
<data name="Options_Appearance_Color_ShellForeground" xml:space="preserve"><value>App-Leiste Vordergrund</value></data>
<data name="Options_Appearance_Color_ShellTitle" xml:space="preserve"><value>App-Leiste Titel</value></data>
<data name="Options_Appearance_Color_ShellUnselected" xml:space="preserve"><value>App-Leiste Inaktiv</value></data>
<data name="Options_Appearance_Color_TabBarBackground" xml:space="preserve"><value>Tableiste Hintergrund</value></data>
<data name="Options_Appearance_Color_TabBarForeground" xml:space="preserve"><value>Tableiste Aktiv</value></data>
<data name="Options_Appearance_Color_TabBarTitle" xml:space="preserve"><value>Tableiste Titel</value></data>
<data name="Options_Appearance_Color_TabBarUnselected" xml:space="preserve"><value>Tableiste Inaktiv</value></data>
<data name="Options_Appearance_Text_Green" xml:space="preserve"><value>Text für Grün</value></data>
<data name="Options_Appearance_Text_Yellow" xml:space="preserve"><value>Text für Gelb</value></data>
<data name="Options_Appearance_Text_Red" xml:space="preserve"><value>Text für Rot</value></data>
<data name="Options_Appearance_Text_Gray" xml:space="preserve"><value>Text für Schwarz / Grau</value></data>
<data name="Options_Legal_PrivacyTitle" xml:space="preserve"><value>Datenschutzerklärung</value></data>
<data name="Options_Legal_PrivacyDate" xml:space="preserve"><value>Stand: 03.04.2026</value></data>
<data name="Options_Legal_PrivacyBody1" xml:space="preserve"><value>Diese App verarbeitet deine Angaben ausschließlich für die Nutzung auf deinem Gerät. Es werden keine Nutzerdaten automatisch an mich oder an Dritte übermittelt, verkauft oder für Werbezwecke weitergegeben.</value></data>
<data name="Options_Legal_PrivacyBody2" xml:space="preserve"><value>Gespeichert werden Einträge, Auswahllisten, Benachrichtigungszeiten, Darstellungseinstellungen und bei Bedarf lokal erzeugte Exportdateien. Eine Cloud-Synchronisierung oder ein automatischer Hintergrund-Upload findet durch diese App nicht statt.</value></data>
<data name="Options_Legal_PrivacyBody3" xml:space="preserve"><value>Die Speicherung erfolgt lokal im internen App-Bereich beziehungsweise in einem von dir selbst gewählten Speicherort. Die Daten liegen dort in technischer App-Struktur und sind nicht für eine unmittelbar öffentliche Darstellung bestimmt. Bei direktem technischem Zugriff auf das Gerät oder auf Dateien kann jedoch nicht vollständig ausgeschlossen werden, dass fachkundige Personen Rückschlüsse auf Art und Inhalt der gespeicherten Daten ziehen können.</value></data>
<data name="Options_Legal_PrivacyBody4" xml:space="preserve"><value>Wenn du Exportdateien bewusst teilst oder einen externen Datenbankpfad verwendest, entscheidest du selbst über diesen Speicher- oder Weitergabeweg.</value></data>
<data name="Options_Legal_DisclaimerTitle" xml:space="preserve"><value>Haftungshinweis</value></data>
<data name="Options_Legal_DisclaimerBody1" xml:space="preserve"><value>Die Nutzung der App erfolgt auf eigenes Risiko. Soweit gesetzlich zulässig, übernehme ich keine Gewähr oder Haftung für Aktualität, Richtigkeit, Vollständigkeit, technische Verfügbarkeit, Datenverlust oder dafür, dass die App für einen bestimmten Zweck geeignet ist.</value></data>
<data name="Options_Legal_DisclaimerBody2" xml:space="preserve"><value>Die App ersetzt keine medizinische, therapeutische, pflegerische, rechtliche oder technische Fachberatung.</value></data>
<data name="Options_Legal_PersonalTitle" xml:space="preserve"><value>Persönlicher Hinweis</value></data>
<data name="Options_Legal_PersonalBody1" xml:space="preserve"><value>Diese App wurde nicht von einem Fachinformatiker entwickelt. Ich bin selbst Betroffener mit ME/CFS und habe die Anwendung aus eigener Perspektive und Erfahrung heraus erstellt.</value></data>
<data name="Options_Legal_PersonalBody2" xml:space="preserve"><value>Gerade deshalb soll die App im Alltag helfen, sie ist aber ein persönliches Projekt und kein professionell zertifiziertes Medizin- oder Softwareprodukt.</value></data>
<data name="Options_ColorDialog_EditTitle" xml:space="preserve"><value>Farbe bearbeiten</value></data>
<data name="Options_ColorDialog_Red" xml:space="preserve"><value>Rot</value></data>
<data name="Options_ColorDialog_Green" xml:space="preserve"><value>Grün</value></data>
<data name="Options_ColorDialog_Blue" xml:space="preserve"><value>Blau</value></data>
<data name="Options_ColorDialog_Brightness" xml:space="preserve"><value>Hell</value></data>
<data name="Options_ColorDialog_Hint" xml:space="preserve"><value>Zurücksetzen lädt nur den Standardwert in den Dialog. Erst Übernehmen speichert die Änderung. Abbrechen verwirft alles aus diesem Dialog wieder.</value></data>
</root>
+2 -1
View File
@@ -38,6 +38,7 @@ public class AppBootstrapService
await _activityRepository.EnsureDefaultsAsync(); await _activityRepository.EnsureDefaultsAsync();
await _symptomRepository.EnsureDefaultsAsync(); await _symptomRepository.EnsureDefaultsAsync();
await _appearanceRepository.EnsureDefaultsAsync(); await _appearanceRepository.EnsureDefaultsAsync();
await _appearanceService.SyncLocalizedStatusTextsAsync();
// Wichtig: gespeicherte Appearance-Werte direkt beim Start // Wichtig: gespeicherte Appearance-Werte direkt beim Start
// auf die App-Ressourcen anwenden. // auf die App-Ressourcen anwenden.
@@ -47,4 +48,4 @@ public class AppBootstrapService
_initialized = true; _initialized = true;
} }
} }
+30 -1
View File
@@ -65,6 +65,7 @@ public class AppearanceService
public async Task ResetAsync() public async Task ResetAsync()
{ {
await _appearanceRepository.ResetAsync(); await _appearanceRepository.ResetAsync();
await SyncLocalizedStatusTextsAsync();
await _appearanceRepository.EnsureDefaultsAsync(); await _appearanceRepository.EnsureDefaultsAsync();
await ApplyAsync(); await ApplyAsync();
} }
@@ -96,6 +97,26 @@ public class AppearanceService
return fallback; return fallback;
} }
public async Task SyncLocalizedStatusTextsAsync()
{
var map = await _appearanceRepository.GetMapAsync();
foreach (var key in GetStatusTextKeys())
{
var currentValue = map.TryGetValue(key, out var storedValue)
? storedValue
: string.Empty;
var normalized = LocalizationService.NormalizeStatusTextForCulture(
key,
currentValue,
LocalizationService.GetCurrentCulture());
if (!string.Equals((currentValue ?? string.Empty).Trim(), normalized, StringComparison.Ordinal))
await _appearanceRepository.SaveAsync(key, normalized);
}
}
private static void ApplyValue(ResourceDictionary resources, string key, string value, string fallback) private static void ApplyValue(ResourceDictionary resources, string key, string value, string fallback)
{ {
if (IsColorKey(key)) if (IsColorKey(key))
@@ -138,4 +159,12 @@ public class AppearanceService
_ => false _ => false
}; };
}
private static IEnumerable<string> GetStatusTextKeys()
{
yield return AppearanceKeys.StatusGreenText;
yield return AppearanceKeys.StatusYellowText;
yield return AppearanceKeys.StatusRedText;
yield return AppearanceKeys.StatusGrayText;
}
}
+16 -12
View File
@@ -1,29 +1,33 @@
namespace cfs_tracker.Services; namespace cfs_tracker.Services;
public static class ExportUiHelper public static class ExportUiHelper
{ {
public static async Task ShowExportSavedActionsAsync(ExportResult result) public static async Task ShowExportSavedActionsAsync(ExportResult result)
{ {
var action = await Shell.Current.DisplayActionSheetAsync( var closeText = LocalizationService.Translate("Options_Export_ActionClose");
$"Export gespeichert:\n{result.FileName}", var openText = LocalizationService.Translate("Options_Export_ActionOpen");
"Schließen", var shareText = LocalizationService.Translate("Options_Export_ActionShare");
null,
"Öffnen",
"Teilen");
if (action == "Öffnen") var action = await Shell.Current.DisplayActionSheetAsync(
LocalizationService.Format("Options_Export_ActionsTitle", result.FileName),
closeText,
null,
openText,
shareText);
if (action == openText)
{ {
await Launcher.Default.OpenAsync(new OpenFileRequest( await Launcher.Default.OpenAsync(new OpenFileRequest(
"Export öffnen", LocalizationService.Translate("Options_Export_OpenTitle"),
new ReadOnlyFile(result.FilePath))); new ReadOnlyFile(result.FilePath)));
} }
else if (action == "Teilen") else if (action == shareText)
{ {
await Share.Default.RequestAsync(new ShareFileRequest await Share.Default.RequestAsync(new ShareFileRequest
{ {
Title = "Export teilen", Title = LocalizationService.Translate("Options_Export_ShareTitle"),
File = new ShareFile(result.FilePath) File = new ShareFile(result.FilePath)
}); });
} }
} }
} }
+269
View File
@@ -0,0 +1,269 @@
using cfs_tracker.Helpers;
using System.ComponentModel;
using System.Globalization;
using System.Resources;
namespace cfs_tracker.Services;
public sealed class LocalizationService : INotifyPropertyChanged
{
public const string SystemLanguageCode = "system";
public const string GermanLanguageCode = "de";
public const string EnglishLanguageCode = "en";
private const string LanguagePreferenceKey = "app_language";
private static readonly ResourceManager ResourceManager =
new("cfs_tracker.Resources.Localization.AppStrings", typeof(LocalizationService).Assembly);
private static readonly CultureInfo GermanCulture = new("de-DE");
private static readonly CultureInfo EnglishCulture = new("en-GB");
private readonly CultureInfo _systemCulture;
private string _selectedLanguageCode = SystemLanguageCode;
private CultureInfo _effectiveCulture;
public static LocalizationService? Current { get; private set; }
public event PropertyChangedEventHandler? PropertyChanged;
public event EventHandler? LanguageChanged;
public LocalizationService()
{
Current ??= this;
_systemCulture = CaptureSystemCulture();
_effectiveCulture = ResolveEffectiveCulture(SystemLanguageCode);
}
public string SelectedLanguageCode => _selectedLanguageCode;
public CultureInfo EffectiveCulture => _effectiveCulture;
public string EffectiveLanguageCode => NormalizeLanguageCode(_effectiveCulture.TwoLetterISOLanguageName);
public void Initialize()
{
ApplyLanguage(Preferences.Default.Get(LanguagePreferenceKey, SystemLanguageCode), persistSelection: false);
}
public bool SetSelectedLanguage(string? languageCode)
{
var normalized = NormalizeLanguageCode(languageCode);
return ApplyLanguage(normalized, persistSelection: true);
}
public CultureInfo GetCultureForSelection(string? languageCode)
{
return ResolveEffectiveCulture(NormalizeLanguageCode(languageCode));
}
public string GetString(string key) => GetString(key, _effectiveCulture);
public string GetLanguageDisplayName(string? languageCode)
{
var normalized = NormalizeLanguageCode(languageCode);
return normalized switch
{
GermanLanguageCode => GetString("Language_Name_German"),
EnglishLanguageCode => GetString("Language_Name_English"),
_ => string.Format(
_effectiveCulture,
GetString("Language_SystemOption"),
GetLanguageDisplayNameForCulture(ResolveEffectiveSystemCulture(), _effectiveCulture))
};
}
public string GetSystemLanguageDisplayName()
{
return GetLanguageDisplayNameForCulture(ResolveEffectiveSystemCulture(), _effectiveCulture);
}
public static string Translate(string key)
{
return Current?.GetString(key) ?? GetString(key, ResolveFallbackCulture());
}
public static string Format(string key, params object[] args)
{
var culture = GetCurrentCulture();
return string.Format(culture, Translate(key), args);
}
public static CultureInfo GetCurrentCulture()
{
return Current?.EffectiveCulture ?? ResolveFallbackCulture();
}
public static string GetString(string key, CultureInfo culture)
{
if (string.IsNullOrWhiteSpace(key))
return string.Empty;
return ResourceManager.GetString(key, culture)
?? ResourceManager.GetString(key, GermanCulture)
?? key;
}
public static string NormalizeLanguageCode(string? languageCode)
{
var normalized = (languageCode ?? string.Empty).Trim().ToLowerInvariant();
return normalized switch
{
GermanLanguageCode => GermanLanguageCode,
EnglishLanguageCode => EnglishLanguageCode,
_ => SystemLanguageCode
};
}
public static string GetDefaultStatusText(string appearanceKey, CultureInfo? culture = null)
{
var resourceKey = appearanceKey switch
{
AppearanceKeys.StatusGreenText => "Status_Default_Green",
AppearanceKeys.StatusYellowText => "Status_Default_Yellow",
AppearanceKeys.StatusRedText => "Status_Default_Red",
AppearanceKeys.StatusGrayText => "Status_Default_Gray",
_ => string.Empty
};
if (string.IsNullOrWhiteSpace(resourceKey))
return string.Empty;
return GetString(resourceKey, culture ?? GetCurrentCulture());
}
public static string NormalizeStatusTextForCulture(string appearanceKey, string? currentValue, CultureInfo targetCulture)
{
if (IsKnownDefaultStatusText(appearanceKey, currentValue))
return GetDefaultStatusText(appearanceKey, targetCulture);
return (currentValue ?? string.Empty).Trim();
}
public static bool IsKnownDefaultStatusText(string appearanceKey, string? value)
{
if (string.IsNullOrWhiteSpace(value))
return true;
var trimmed = value.Trim();
foreach (var culture in GetSupportedCultures())
{
if (string.Equals(trimmed, GetDefaultStatusText(appearanceKey, culture), StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}
public static bool IsKnownTranslation(string key, string? value)
{
if (string.IsNullOrWhiteSpace(value))
return false;
var trimmed = value.Trim();
foreach (var culture in GetSupportedCultures())
{
if (string.Equals(trimmed, GetString(key, culture), StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}
public static bool IsNoActivityLabel(string? value) => IsKnownTranslation("Activity_None", value);
private bool ApplyLanguage(string? languageCode, bool persistSelection)
{
var normalized = NormalizeLanguageCode(languageCode);
var nextCulture = ResolveEffectiveCulture(normalized);
if (persistSelection)
Preferences.Default.Set(LanguagePreferenceKey, normalized);
var selectionChanged = !string.Equals(_selectedLanguageCode, normalized, StringComparison.OrdinalIgnoreCase);
var cultureChanged = !string.Equals(_effectiveCulture.Name, nextCulture.Name, StringComparison.OrdinalIgnoreCase);
_selectedLanguageCode = normalized;
_effectiveCulture = nextCulture;
ApplyCulture(nextCulture);
if (selectionChanged)
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedLanguageCode)));
if (selectionChanged || cultureChanged)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(EffectiveCulture)));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(EffectiveLanguageCode)));
LanguageChanged?.Invoke(this, EventArgs.Empty);
}
return cultureChanged;
}
private CultureInfo ResolveEffectiveCulture(string normalizedLanguageCode)
{
return normalizedLanguageCode switch
{
GermanLanguageCode => GermanCulture,
EnglishLanguageCode => EnglishCulture,
_ => ResolveEffectiveSystemCulture()
};
}
private CultureInfo ResolveEffectiveSystemCulture()
{
return _systemCulture.TwoLetterISOLanguageName.ToLowerInvariant() switch
{
GermanLanguageCode => _systemCulture,
EnglishLanguageCode => _systemCulture,
_ => EnglishCulture
};
}
private static string GetLanguageDisplayNameForCulture(CultureInfo culture, CultureInfo uiCulture)
{
return culture.TwoLetterISOLanguageName.ToLowerInvariant() switch
{
GermanLanguageCode => GetString("Language_Name_German", uiCulture),
_ => GetString("Language_Name_English", uiCulture)
};
}
private static void ApplyCulture(CultureInfo culture)
{
CultureInfo.CurrentCulture = culture;
CultureInfo.CurrentUICulture = culture;
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
}
private static CultureInfo CaptureSystemCulture()
{
var current = CultureInfo.CurrentUICulture;
return string.IsNullOrWhiteSpace(current.Name)
? GermanCulture
: current;
}
private static CultureInfo ResolveFallbackCulture()
{
var current = CultureInfo.CurrentUICulture;
return current.TwoLetterISOLanguageName.ToLowerInvariant() switch
{
GermanLanguageCode => current,
EnglishLanguageCode => current,
_ => EnglishCulture
};
}
private static IEnumerable<CultureInfo> GetSupportedCultures()
{
yield return GermanCulture;
yield return EnglishCulture;
}
}
+3 -2
View File
@@ -1,3 +1,4 @@
using cfs_tracker.Services;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
namespace cfs_tracker.ViewModels; namespace cfs_tracker.ViewModels;
@@ -15,6 +16,6 @@ public partial class ActivityManageItemViewModel : ObservableObject
public bool IsUsed { get; init; } public bool IsUsed { get; init; }
public string UsageHint => IsUsed public string UsageHint => IsUsed
? "Bereits verwendet – kann nur deaktiviert werden." ? LocalizationService.Translate("Options_UsageHint_Used")
: "Kann gelöscht werden, solange unbenutzt."; : LocalizationService.Translate("Options_UsageHint_Unused");
} }
+8 -2
View File
@@ -1,3 +1,4 @@
using cfs_tracker.Services;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
@@ -20,7 +21,12 @@ public partial class DayEntryItemViewModel : ObservableObject
public bool HasDuration => !string.IsNullOrWhiteSpace(DurationText); public bool HasDuration => !string.IsNullOrWhiteSpace(DurationText);
public bool HasSymptoms => !string.IsNullOrWhiteSpace(SymptomsText); public bool HasSymptoms => !string.IsNullOrWhiteSpace(SymptomsText);
public bool HasDetails => HasActivity || HasDuration || HasSymptoms; public bool HasDetails => HasActivity || HasDuration || HasSymptoms;
public string DetailsButtonText => IsExpanded ? "Details ausblenden" : "Details anzeigen"; public string DetailsButtonText => IsExpanded
? LocalizationService.Translate("DayPage_DetailsHide")
: LocalizationService.Translate("DayPage_DetailsShow");
public string ActivitySummaryText => LocalizationService.Format("DayPage_ActivityFormat", ActivityText);
public string DurationSummaryText => LocalizationService.Format("DayPage_DurationFormat", DurationText);
public string SymptomsSummaryText => LocalizationService.Format("DayPage_SymptomsFormat", SymptomsText);
[ObservableProperty] [ObservableProperty]
private bool isExpanded; private bool isExpanded;
@@ -44,4 +50,4 @@ public partial class DayEntryItemViewModel : ObservableObject
IsExpanded = !IsExpanded; IsExpanded = !IsExpanded;
} }
} }
+31 -20
View File
@@ -46,16 +46,16 @@ public partial class DayViewModel : ObservableObject
private int grayCount; private int grayCount;
[ObservableProperty] [ObservableProperty]
private string greenStatusText = "Grün"; private string greenStatusText = "Green";
[ObservableProperty] [ObservableProperty]
private string yellowStatusText = "Gelb"; private string yellowStatusText = "Yellow";
[ObservableProperty] [ObservableProperty]
private string redStatusText = "Rot"; private string redStatusText = "Red";
[ObservableProperty] [ObservableProperty]
private string grayStatusText = "Schwarz"; private string grayStatusText = "Black";
[ObservableProperty] [ObservableProperty]
private Color greenStateColor = Color.FromArgb("#4E8B69"); private Color greenStateColor = Color.FromArgb("#4E8B69");
@@ -82,15 +82,18 @@ public partial class DayViewModel : ObservableObject
public string RedCounterText => BuildCounterText(RedStatusText, RedCount); public string RedCounterText => BuildCounterText(RedStatusText, RedCount);
public string GrayCounterText => BuildCounterText(GrayStatusText, GrayCount); public string GrayCounterText => BuildCounterText(GrayStatusText, GrayCount);
public string AddEntryButtonText => IsPastDate ? "+ Nachtrag" : "+ Eintrag"; public string AddEntryButtonText => IsPastDate
? LocalizationService.Translate("DayPage_AddBackfillButton")
: LocalizationService.Translate("DayPage_AddEntryButton");
public bool CanAddEntry => !IsFutureDate; public bool CanAddEntry => !IsFutureDate;
public bool HasNoEntries => !HasEntries; public bool HasNoEntries => !HasEntries;
public string DayHintText => IsToday public string DayHintText => IsToday
? "Heute kannst du Schnellstatus oder einen Eintrag mit Tätigkeit und Symptomen setzen." ? LocalizationService.Translate("DayPage_HintToday")
: IsPastDate : IsPastDate
? "Für vergangene Tage legst du einen Nachtrag für Vormittag oder Nachmittag an." ? LocalizationService.Translate("DayPage_HintPast")
: "Für zukünftige Tage sind keine Einträge möglich."; : LocalizationService.Translate("DayPage_HintFuture");
public IAsyncRelayCommand PreviousDayCommand { get; } public IAsyncRelayCommand PreviousDayCommand { get; }
public IAsyncRelayCommand NextDayCommand { get; } public IAsyncRelayCommand NextDayCommand { get; }
@@ -181,15 +184,15 @@ public partial class DayViewModel : ObservableObject
{ {
var slotText = entry.DayPart switch var slotText = entry.DayPart switch
{ {
DayPart.Morning => "Vormittag", DayPart.Morning => LocalizationService.Translate("Common_Morning"),
DayPart.Afternoon => "Nachmittag", DayPart.Afternoon => LocalizationService.Translate("Common_Afternoon"),
_ => entry.Timestamp.ToString("HH:mm", CultureInfo.InvariantCulture) _ => entry.Timestamp.ToString("HH:mm", CultureInfo.InvariantCulture)
}; };
var activityText = string.Empty; var activityText = string.Empty;
if (entry.ActivityId.HasValue && if (entry.ActivityId.HasValue &&
activityMap.TryGetValue(entry.ActivityId.Value, out var activityName) && activityMap.TryGetValue(entry.ActivityId.Value, out var activityName) &&
!string.Equals(activityName, "Keine Tätigkeit", StringComparison.OrdinalIgnoreCase)) !LocalizationService.IsNoActivityLabel(activityName))
{ {
activityText = activityName; activityText = activityName;
} }
@@ -267,10 +270,10 @@ public partial class DayViewModel : ObservableObject
return; return;
var accepted = await Application.Current!.Windows[0].Page!.DisplayAlertAsync( var accepted = await Application.Current!.Windows[0].Page!.DisplayAlertAsync(
"Eintrag löschen", LocalizationService.Translate("DayPage_DeleteAlert_Title"),
"Soll dieser Eintrag wirklich gelöscht werden?", LocalizationService.Translate("DayPage_DeleteAlert_Message"),
"Ja", LocalizationService.Translate("Common_Yes"),
"Nein"); LocalizationService.Translate("Common_No"));
if (!accepted) if (!accepted)
return; return;
@@ -324,10 +327,18 @@ public partial class DayViewModel : ObservableObject
private void LoadAppearance() private void LoadAppearance()
{ {
GreenStatusText = _appearanceService.GetText(AppearanceKeys.StatusGreenText, "Grün"); GreenStatusText = _appearanceService.GetText(
YellowStatusText = _appearanceService.GetText(AppearanceKeys.StatusYellowText, "Gelb"); AppearanceKeys.StatusGreenText,
RedStatusText = _appearanceService.GetText(AppearanceKeys.StatusRedText, "Rot"); LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusGreenText));
GrayStatusText = _appearanceService.GetText(AppearanceKeys.StatusGrayText, "Schwarz"); YellowStatusText = _appearanceService.GetText(
AppearanceKeys.StatusYellowText,
LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusYellowText));
RedStatusText = _appearanceService.GetText(
AppearanceKeys.StatusRedText,
LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusRedText));
GrayStatusText = _appearanceService.GetText(
AppearanceKeys.StatusGrayText,
LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusGrayText));
GreenStateColor = _appearanceService.GetColor(AppearanceKeys.StateGreen, "#4E8B69"); GreenStateColor = _appearanceService.GetColor(AppearanceKeys.StateGreen, "#4E8B69");
YellowStateColor = _appearanceService.GetColor(AppearanceKeys.StateYellow, "#B89A42"); YellowStateColor = _appearanceService.GetColor(AppearanceKeys.StateYellow, "#B89A42");
@@ -352,4 +363,4 @@ public partial class DayViewModel : ObservableObject
} }
private static string BuildCounterText(string label, int count) => $"{label}\n{count}"; private static string BuildCounterText(string label, int count) => $"{label}\n{count}";
} }
@@ -0,0 +1,8 @@
namespace cfs_tracker.ViewModels;
public class LanguageOptionItemViewModel
{
public string Code { get; init; } = string.Empty;
public string DisplayName { get; init; } = string.Empty;
}
+27 -2
View File
@@ -1,9 +1,34 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
namespace cfs_tracker.ViewModels; namespace cfs_tracker.ViewModels;
public class MonthSectionViewModel public partial class MonthSectionViewModel : ObservableObject
{ {
public string Title { get; init; } = string.Empty; private string _title = string.Empty;
private bool _isLoading = true;
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}
public bool IsLoading
{
get => _isLoading;
set => SetProperty(ref _isLoading, value);
}
public ObservableCollection<MonthCellViewModel> Cells { get; } = new(); public ObservableCollection<MonthCellViewModel> Cells { get; } = new();
public void ReplaceCells(IEnumerable<MonthCellViewModel> cells)
{
Cells.Clear();
foreach (var cell in cells)
Cells.Add(cell);
IsLoading = false;
}
} }
+1 -1
View File
@@ -204,4 +204,4 @@ public partial class MonthViewModel : ObservableObject
BorderColor = Colors.Transparent BorderColor = Colors.Transparent
}; };
} }
} }
@@ -1,4 +1,5 @@
using cfs_tracker.Models; using cfs_tracker.Models;
using cfs_tracker.Services;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
@@ -35,7 +36,9 @@ public partial class NotificationScheduleItemViewModel : ObservableObject
[ObservableProperty] [ObservableProperty]
private bool sunday; private bool sunday;
public string IsEnabledButtonText => IsEnabled ? "Aktiv" : "Inaktiv"; public string IsEnabledButtonText => IsEnabled
? LocalizationService.Translate("Common_Active")
: LocalizationService.Translate("Common_Inactive");
public IRelayCommand ToggleIsEnabledCommand { get; } public IRelayCommand ToggleIsEnabledCommand { get; }
public IRelayCommand ToggleMondayCommand { get; } public IRelayCommand ToggleMondayCommand { get; }
@@ -90,4 +93,4 @@ public partial class NotificationScheduleItemViewModel : ObservableObject
Saturday = flags.HasFlag(NotificationWeekdays.Saturday); Saturday = flags.HasFlag(NotificationWeekdays.Saturday);
Sunday = flags.HasFlag(NotificationWeekdays.Sunday); Sunday = flags.HasFlag(NotificationWeekdays.Sunday);
} }
} }
+223 -83
View File
@@ -6,6 +6,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using System.Globalization;
namespace cfs_tracker.ViewModels; namespace cfs_tracker.ViewModels;
@@ -14,6 +15,7 @@ public partial class OptionsViewModel : ObservableObject
private readonly HealthEntryRepository _healthEntryRepository; private readonly HealthEntryRepository _healthEntryRepository;
private readonly AppearanceRepository _appearanceRepository; private readonly AppearanceRepository _appearanceRepository;
private readonly AppearanceService _appearanceService; private readonly AppearanceService _appearanceService;
private readonly LocalizationService _localizationService;
private readonly ActivityRepository _activityRepository; private readonly ActivityRepository _activityRepository;
private readonly SymptomRepository _symptomRepository; private readonly SymptomRepository _symptomRepository;
private readonly NotificationScheduleRepository _notificationScheduleRepository; private readonly NotificationScheduleRepository _notificationScheduleRepository;
@@ -64,8 +66,15 @@ public partial class OptionsViewModel : ObservableObject
[ObservableProperty] [ObservableProperty]
private bool isExportSymptomFilterExpanded; private bool isExportSymptomFilterExpanded;
[ObservableProperty]
private LanguageOptionItemViewModel? selectedLanguageOption;
[ObservableProperty]
private bool requiresShellReload;
public ObservableCollection<AppearanceColorItemViewModel> AppearanceColors { get; } = new(); public ObservableCollection<AppearanceColorItemViewModel> AppearanceColors { get; } = new();
public ObservableCollection<AppearanceTextItemViewModel> StatusTexts { get; } = new(); public ObservableCollection<AppearanceTextItemViewModel> StatusTexts { get; } = new();
public ObservableCollection<LanguageOptionItemViewModel> LanguageOptions { get; } = new();
public ObservableCollection<ActivityManageItemViewModel> Activities { get; } = new(); public ObservableCollection<ActivityManageItemViewModel> Activities { get; } = new();
public ObservableCollection<SymptomManageItemViewModel> Symptoms { get; } = new(); public ObservableCollection<SymptomManageItemViewModel> Symptoms { get; } = new();
public ObservableCollection<NotificationScheduleItemViewModel> NotificationSchedules { get; } = new(); public ObservableCollection<NotificationScheduleItemViewModel> NotificationSchedules { get; } = new();
@@ -78,7 +87,18 @@ public partial class OptionsViewModel : ObservableObject
public bool IsExportTabSelected => SelectedTab == OptionsTab.Export; public bool IsExportTabSelected => SelectedTab == OptionsTab.Export;
public bool IsLegalTabSelected => SelectedTab == OptionsTab.Legal; public bool IsLegalTabSelected => SelectedTab == OptionsTab.Legal;
public string NotificationVibrationButtonText => NotificationVibrationEnabled ? "Aktiv" : "Inaktiv"; public string NotificationVibrationButtonText => NotificationVibrationEnabled
? LocalizationService.Translate("Common_Active")
: LocalizationService.Translate("Common_Inactive");
public string CurrentDatabasePathText => LocalizationService.Format("Options_Database_CurrentPathFormat", CurrentDatabasePath);
public string SelectedLanguageDescription => SelectedLanguageOption?.Code == LocalizationService.SystemLanguageCode
? LocalizationService.Format("Options_Language_SystemHint", _localizationService.GetSystemLanguageDisplayName())
: LocalizationService.Format(
"Options_Language_SelectedHint",
SelectedLanguageOption?.DisplayName ?? _localizationService.GetLanguageDisplayName(_localizationService.SelectedLanguageCode));
public bool IsDayViewExportLayoutSelected => SelectedExportLayout == ExportLayout.DayView; public bool IsDayViewExportLayoutSelected => SelectedExportLayout == ExportLayout.DayView;
public bool IsWeekBlockExportLayoutSelected => SelectedExportLayout == ExportLayout.WeekBlock; public bool IsWeekBlockExportLayoutSelected => SelectedExportLayout == ExportLayout.WeekBlock;
public bool IsDaySummaryExportLayoutSelected => SelectedExportLayout == ExportLayout.DaySummary; public bool IsDaySummaryExportLayoutSelected => SelectedExportLayout == ExportLayout.DaySummary;
@@ -92,16 +112,16 @@ public partial class OptionsViewModel : ObservableObject
var totalDays = (end - start).Days + 1; var totalDays = (end - start).Days + 1;
return totalDays == 1 return totalDays == 1
? $"1 Tag ausgewählt: {start:dd.MM.yyyy}" ? LocalizationService.Format("Options_Export_RangeSingleFormat", FormatShortDate(start))
: $"{totalDays} Tage ausgewählt: {start:dd.MM.yyyy} bis {end:dd.MM.yyyy}"; : LocalizationService.Format("Options_Export_RangeMultipleFormat", totalDays, FormatShortDate(start), FormatShortDate(end));
} }
} }
public string SelectedExportLayoutDescription => SelectedExportLayout switch public string SelectedExportLayoutDescription => SelectedExportLayout switch
{ {
ExportLayout.DayView => "Tagesansicht: Jeder Tag wird mit allen einzelnen Einträgen, Tätigkeiten, Dauer und Symptomen exportiert.", ExportLayout.DayView => LocalizationService.Translate("Options_Export_LayoutDescription_DayView"),
ExportLayout.WeekBlock => "Wochenblock: Pro Tag werden Vormittag und Nachmittag mit Status, T\u00e4tigkeiten, Gesamtdauer und Symptomen dargestellt.", ExportLayout.WeekBlock => LocalizationService.Translate("Options_Export_LayoutDescription_WeekBlock"),
_ => "Tageszusammenfassung: Jeder Tag erscheint kompakt in einer Zeile, ähnlich wie bei Monats- und Jahresexporten." _ => LocalizationService.Translate("Options_Export_LayoutDescription_DaySummary")
}; };
public string ExportFilterSummary public string ExportFilterSummary
@@ -111,7 +131,7 @@ public partial class OptionsViewModel : ObservableObject
var parts = new List<string>(); var parts = new List<string>();
if (SelectedExportActivity?.Id is int) if (SelectedExportActivity?.Id is int)
parts.Add($"T\u00e4tigkeit: {SelectedExportActivity.Name}"); parts.Add(LocalizationService.Format("Options_Export_Filter_ActivityFormat", SelectedExportActivity.Name));
var selectedSymptoms = ExportSymptoms var selectedSymptoms = ExportSymptoms
.Where(x => x.IsSelected) .Where(x => x.IsSelected)
@@ -120,11 +140,11 @@ public partial class OptionsViewModel : ObservableObject
.ToList(); .ToList();
if (selectedSymptoms.Count > 0) if (selectedSymptoms.Count > 0)
parts.Add($"Symptome: {string.Join(", ", selectedSymptoms)}"); parts.Add(LocalizationService.Format("Options_Export_Filter_SymptomsFormat", string.Join(", ", selectedSymptoms)));
return parts.Count > 0 return parts.Count > 0
? string.Join(" | ", parts) ? string.Join(" | ", parts)
: "Keine Filter aktiv."; : LocalizationService.Translate("Options_Export_Filter_None");
} }
} }
@@ -133,13 +153,14 @@ public partial class OptionsViewModel : ObservableObject
get get
{ {
var selectedCount = ExportSymptoms.Count(x => x.IsSelected); var selectedCount = ExportSymptoms.Count(x => x.IsSelected);
var countSuffix = selectedCount > 0
? $" ({selectedCount} ausgewählt)"
: string.Empty;
return IsExportSymptomFilterExpanded return (IsExportSymptomFilterExpanded, selectedCount > 0) switch
? $"Symptome ausblenden{countSuffix}" {
: $"Symptome auswählen{countSuffix}"; (true, true) => LocalizationService.Format("Options_Export_SymptomsHideWithCount", selectedCount),
(true, false) => LocalizationService.Translate("Options_Export_SymptomsHide"),
(false, true) => LocalizationService.Format("Options_Export_SymptomsSelectWithCount", selectedCount),
_ => LocalizationService.Translate("Options_Export_SymptomsSelect")
};
} }
} }
@@ -176,6 +197,7 @@ public partial class OptionsViewModel : ObservableObject
HealthEntryRepository healthEntryRepository, HealthEntryRepository healthEntryRepository,
AppearanceRepository appearanceRepository, AppearanceRepository appearanceRepository,
AppearanceService appearanceService, AppearanceService appearanceService,
LocalizationService localizationService,
ActivityRepository activityRepository, ActivityRepository activityRepository,
SymptomRepository symptomRepository, SymptomRepository symptomRepository,
NotificationScheduleRepository notificationScheduleRepository, NotificationScheduleRepository notificationScheduleRepository,
@@ -187,6 +209,7 @@ public partial class OptionsViewModel : ObservableObject
_healthEntryRepository = healthEntryRepository; _healthEntryRepository = healthEntryRepository;
_appearanceRepository = appearanceRepository; _appearanceRepository = appearanceRepository;
_appearanceService = appearanceService; _appearanceService = appearanceService;
_localizationService = localizationService;
_activityRepository = activityRepository; _activityRepository = activityRepository;
_symptomRepository = symptomRepository; _symptomRepository = symptomRepository;
_notificationScheduleRepository = notificationScheduleRepository; _notificationScheduleRepository = notificationScheduleRepository;
@@ -250,6 +273,16 @@ public partial class OptionsViewModel : ObservableObject
OnPropertyChanged(nameof(NotificationVibrationButtonText)); OnPropertyChanged(nameof(NotificationVibrationButtonText));
} }
partial void OnCurrentDatabasePathChanged(string value)
{
OnPropertyChanged(nameof(CurrentDatabasePathText));
}
partial void OnSelectedLanguageOptionChanged(LanguageOptionItemViewModel? value)
{
OnPropertyChanged(nameof(SelectedLanguageDescription));
}
partial void OnExportStartDateChanged(DateTime value) partial void OnExportStartDateChanged(DateTime value)
{ {
if (ExportEndDate.Date < value.Date) if (ExportEndDate.Date < value.Date)
@@ -287,6 +320,7 @@ public partial class OptionsViewModel : ObservableObject
public async Task LoadAsync() public async Task LoadAsync()
{ {
await LoadAppearanceAsync(); await LoadAppearanceAsync();
LoadLanguageOptions();
await LoadActivitiesAsync(); await LoadActivitiesAsync();
await LoadSymptomsAsync(); await LoadSymptomsAsync();
await LoadSchedulesAsync(); await LoadSchedulesAsync();
@@ -296,16 +330,22 @@ public partial class OptionsViewModel : ObservableObject
ExternalDatabasePath = _databaseLocationService.ExternalDatabasePath; ExternalDatabasePath = _databaseLocationService.ExternalDatabasePath;
CurrentDatabasePath = _appDatabase.CurrentPath; CurrentDatabasePath = _appDatabase.CurrentPath;
StatusText = string.Empty; StatusText = string.Empty;
RequiresShellReload = false;
}
public void ClearShellReloadFlag()
{
RequiresShellReload = false;
} }
private bool CanDeleteAllData() => private bool CanDeleteAllData() =>
string.Equals(DeleteConfirmationText?.Trim(), "löschen", StringComparison.OrdinalIgnoreCase); LocalizationService.IsKnownTranslation("Options_Data_DeleteConfirmationKeyword", DeleteConfirmationText);
private async Task DeleteAllDataAsync() private async Task DeleteAllDataAsync()
{ {
await _healthEntryRepository.DeleteAllAsync(); await _healthEntryRepository.DeleteAllAsync();
DeleteConfirmationText = string.Empty; DeleteConfirmationText = string.Empty;
StatusText = "Alle Einträge wurden gelöscht."; StatusText = LocalizationService.Translate("Options_Status_AllDataDeleted");
} }
private async Task LoadAppearanceAsync() private async Task LoadAppearanceAsync()
@@ -315,39 +355,39 @@ public partial class OptionsViewModel : ObservableObject
var map = await _appearanceRepository.GetMapAsync(); var map = await _appearanceRepository.GetMapAsync();
AddColor(AppearanceKeys.AppBackground, "App-Hintergrund"); AddColor(AppearanceKeys.AppBackground);
AddColor(AppearanceKeys.SurfaceBackground, "Karten-Hintergrund"); AddColor(AppearanceKeys.SurfaceBackground);
AddColor(AppearanceKeys.SurfaceBackgroundAlt, "Sekundäre Fläche"); AddColor(AppearanceKeys.SurfaceBackgroundAlt);
AddColor(AppearanceKeys.Border, "Rahmen"); AddColor(AppearanceKeys.Border);
AddColor(AppearanceKeys.TextPrimary, "Haupttext"); AddColor(AppearanceKeys.TextPrimary);
AddColor(AppearanceKeys.TextMuted, "Nebentext"); AddColor(AppearanceKeys.TextMuted);
AddColor(AppearanceKeys.StateGreen, "Statusfarbe Grün"); AddColor(AppearanceKeys.StateGreen);
AddColor(AppearanceKeys.StateYellow, "Statusfarbe Gelb"); AddColor(AppearanceKeys.StateYellow);
AddColor(AppearanceKeys.StateRed, "Statusfarbe Rot"); AddColor(AppearanceKeys.StateRed);
AddColor(AppearanceKeys.StateGray, "Statusfarbe Schwarz / Grau"); AddColor(AppearanceKeys.StateGray);
AddColor(AppearanceKeys.ButtonPrimaryBackground, "Button Primär Hintergrund"); AddColor(AppearanceKeys.ButtonPrimaryBackground);
AddColor(AppearanceKeys.ButtonPrimaryText, "Button Primär Text"); AddColor(AppearanceKeys.ButtonPrimaryText);
AddColor(AppearanceKeys.ButtonSecondaryBackground, "Button Sekundär Hintergrund"); AddColor(AppearanceKeys.ButtonSecondaryBackground);
AddColor(AppearanceKeys.ButtonSecondaryText, "Button Sekundär Text"); AddColor(AppearanceKeys.ButtonSecondaryText);
AddColor(AppearanceKeys.ShellBackground, "App-Leiste Hintergrund"); AddColor(AppearanceKeys.ShellBackground);
AddColor(AppearanceKeys.ShellForeground, "App-Leiste Vordergrund"); AddColor(AppearanceKeys.ShellForeground);
AddColor(AppearanceKeys.ShellTitle, "App-Leiste Titel"); AddColor(AppearanceKeys.ShellTitle);
AddColor(AppearanceKeys.ShellUnselected, "App-Leiste Inaktiv"); AddColor(AppearanceKeys.ShellUnselected);
AddColor(AppearanceKeys.TabBarBackground, "Tableiste Hintergrund"); AddColor(AppearanceKeys.TabBarBackground);
AddColor(AppearanceKeys.TabBarForeground, "Tableiste Aktiv"); AddColor(AppearanceKeys.TabBarForeground);
AddColor(AppearanceKeys.TabBarTitle, "Tableiste Titel"); AddColor(AppearanceKeys.TabBarTitle);
AddColor(AppearanceKeys.TabBarUnselected, "Tableiste Inaktiv"); AddColor(AppearanceKeys.TabBarUnselected);
AddText(AppearanceKeys.StatusGreenText, "Text für Grün"); AddText(AppearanceKeys.StatusGreenText);
AddText(AppearanceKeys.StatusYellowText, "Text für Gelb"); AddText(AppearanceKeys.StatusYellowText);
AddText(AppearanceKeys.StatusRedText, "Text für Rot"); AddText(AppearanceKeys.StatusRedText);
AddText(AppearanceKeys.StatusGrayText, "Text für Schwarz / Grau"); AddText(AppearanceKeys.StatusGrayText);
void AddColor(string key, string title) void AddColor(string key)
{ {
var fallback = AppearanceDefaults.All[key]; var fallback = AppearanceDefaults.All[key];
var value = map.TryGetValue(key, out var stored) ? stored : fallback; var value = map.TryGetValue(key, out var stored) ? stored : fallback;
@@ -356,27 +396,57 @@ public partial class OptionsViewModel : ObservableObject
AppearanceColors.Add(new AppearanceColorItemViewModel AppearanceColors.Add(new AppearanceColorItemViewModel
{ {
Key = key, Key = key,
Title = title, Title = GetAppearanceColorTitle(key),
Fallback = fallback, Fallback = fallback,
Value = ToHex(preview), Value = ToHex(preview),
PreviewColor = preview PreviewColor = preview
}); });
} }
void AddText(string key, string title) void AddText(string key)
{ {
var fallback = AppearanceDefaults.All[key]; var fallback = LocalizationService.GetDefaultStatusText(key);
if (string.IsNullOrWhiteSpace(fallback))
fallback = AppearanceDefaults.All[key];
var value = map.TryGetValue(key, out var stored) ? stored : fallback; var value = map.TryGetValue(key, out var stored) ? stored : fallback;
StatusTexts.Add(new AppearanceTextItemViewModel StatusTexts.Add(new AppearanceTextItemViewModel
{ {
Key = key, Key = key,
Title = title, Title = GetAppearanceTextTitle(key),
Value = value Value = value
}); });
} }
} }
private void LoadLanguageOptions()
{
var currentCode = _localizationService.SelectedLanguageCode;
LanguageOptions.Clear();
LanguageOptions.Add(new LanguageOptionItemViewModel
{
Code = LocalizationService.SystemLanguageCode,
DisplayName = _localizationService.GetLanguageDisplayName(LocalizationService.SystemLanguageCode)
});
LanguageOptions.Add(new LanguageOptionItemViewModel
{
Code = LocalizationService.GermanLanguageCode,
DisplayName = _localizationService.GetLanguageDisplayName(LocalizationService.GermanLanguageCode)
});
LanguageOptions.Add(new LanguageOptionItemViewModel
{
Code = LocalizationService.EnglishLanguageCode,
DisplayName = _localizationService.GetLanguageDisplayName(LocalizationService.EnglishLanguageCode)
});
SelectedLanguageOption = LanguageOptions.FirstOrDefault(x => x.Code == currentCode)
?? LanguageOptions.FirstOrDefault();
OnPropertyChanged(nameof(SelectedLanguageDescription));
}
private async Task LoadActivitiesAsync() private async Task LoadActivitiesAsync()
{ {
var selectedExportActivityId = SelectedExportActivity?.Id; var selectedExportActivityId = SelectedExportActivity?.Id;
@@ -447,6 +517,14 @@ public partial class OptionsViewModel : ObservableObject
private async Task SaveAppearanceAsync() private async Task SaveAppearanceAsync()
{ {
RequiresShellReload = false;
var targetLanguageCode = SelectedLanguageOption?.Code ?? _localizationService.SelectedLanguageCode;
var targetCulture = _localizationService.GetCultureForSelection(targetLanguageCode);
foreach (var item in StatusTexts)
item.Value = LocalizationService.NormalizeStatusTextForCulture(item.Key, item.Value, targetCulture);
foreach (var item in AppearanceColors) foreach (var item in AppearanceColors)
{ {
var normalized = ToHex(ColorUtility.ParseColor(item.Value, item.Fallback)); var normalized = ToHex(ColorUtility.ParseColor(item.Value, item.Fallback));
@@ -458,23 +536,30 @@ public partial class OptionsViewModel : ObservableObject
foreach (var item in StatusTexts) foreach (var item in StatusTexts)
await _appearanceService.SaveTextAsync(item.Key, item.Value); await _appearanceService.SaveTextAsync(item.Key, item.Value);
var languageChanged = _localizationService.SetSelectedLanguage(targetLanguageCode);
await _appearanceService.ApplyAsync();
await LoadAppearanceAsync();
LoadLanguageOptions();
await _notificationScheduler.SyncAsync(); await _notificationScheduler.SyncAsync();
StatusText = "Aussehen gespeichert."; RequiresShellReload = languageChanged;
StatusText = LocalizationService.Translate("Options_Status_AppearanceSaved");
} }
private async Task ResetAppearanceAsync() private async Task ResetAppearanceAsync()
{ {
await _appearanceService.ResetAsync(); await _appearanceService.ResetAsync();
await LoadAppearanceAsync(); await LoadAppearanceAsync();
LoadLanguageOptions();
await _notificationScheduler.SyncAsync(); await _notificationScheduler.SyncAsync();
StatusText = "Aussehen auf Standard zurückgesetzt."; StatusText = LocalizationService.Translate("Options_Status_AppearanceReset");
} }
private async Task AddActivityAsync() private async Task AddActivityAsync()
{ {
if (string.IsNullOrWhiteSpace(NewActivityName)) if (string.IsNullOrWhiteSpace(NewActivityName))
{ {
StatusText = "Bitte zuerst einen Tätigkeitsnamen eingeben."; StatusText = LocalizationService.Translate("Options_Status_ActivityNameRequired");
return; return;
} }
@@ -483,7 +568,7 @@ public partial class OptionsViewModel : ObservableObject
await _activityRepository.AddAsync(NewActivityName); await _activityRepository.AddAsync(NewActivityName);
NewActivityName = string.Empty; NewActivityName = string.Empty;
await LoadActivitiesAsync(); await LoadActivitiesAsync();
StatusText = "Tätigkeit hinzugefügt."; StatusText = LocalizationService.Translate("Options_Status_ActivityAdded");
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -500,7 +585,7 @@ public partial class OptionsViewModel : ObservableObject
{ {
await _activityRepository.RenameAsync(item.Id, item.Name); await _activityRepository.RenameAsync(item.Id, item.Name);
await LoadActivitiesAsync(); await LoadActivitiesAsync();
StatusText = "Tätigkeit gespeichert."; StatusText = LocalizationService.Translate("Options_Status_ActivitySaved");
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -515,7 +600,7 @@ public partial class OptionsViewModel : ObservableObject
await _activityRepository.SetActiveAsync(item.Id, !item.IsActive); await _activityRepository.SetActiveAsync(item.Id, !item.IsActive);
await LoadActivitiesAsync(); await LoadActivitiesAsync();
StatusText = "Tätigkeit aktualisiert."; StatusText = LocalizationService.Translate("Options_Status_ActivityUpdated");
} }
private async Task DeleteActivityAsync(ActivityManageItemViewModel? item) private async Task DeleteActivityAsync(ActivityManageItemViewModel? item)
@@ -525,14 +610,17 @@ public partial class OptionsViewModel : ObservableObject
await _activityRepository.DeleteOrDeactivateAsync(item.Id); await _activityRepository.DeleteOrDeactivateAsync(item.Id);
await LoadActivitiesAsync(); await LoadActivitiesAsync();
StatusText = item.IsUsed ? "Tätigkeit wurde deaktiviert." : "Tätigkeit wurde gelöscht."; StatusText = LocalizationService.Translate(
item.IsUsed
? "Options_Status_ActivityDisabled"
: "Options_Status_ActivityDeleted");
} }
private async Task AddSymptomAsync() private async Task AddSymptomAsync()
{ {
if (string.IsNullOrWhiteSpace(NewSymptomName)) if (string.IsNullOrWhiteSpace(NewSymptomName))
{ {
StatusText = "Bitte zuerst einen Symptomnamen eingeben."; StatusText = LocalizationService.Translate("Options_Status_SymptomNameRequired");
return; return;
} }
@@ -541,7 +629,7 @@ public partial class OptionsViewModel : ObservableObject
await _symptomRepository.AddAsync(NewSymptomName); await _symptomRepository.AddAsync(NewSymptomName);
NewSymptomName = string.Empty; NewSymptomName = string.Empty;
await LoadSymptomsAsync(); await LoadSymptomsAsync();
StatusText = "Symptom hinzugefügt."; StatusText = LocalizationService.Translate("Options_Status_SymptomAdded");
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -558,7 +646,7 @@ public partial class OptionsViewModel : ObservableObject
{ {
await _symptomRepository.RenameAsync(item.Id, item.Name); await _symptomRepository.RenameAsync(item.Id, item.Name);
await LoadSymptomsAsync(); await LoadSymptomsAsync();
StatusText = "Symptom gespeichert."; StatusText = LocalizationService.Translate("Options_Status_SymptomSaved");
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -573,7 +661,7 @@ public partial class OptionsViewModel : ObservableObject
await _symptomRepository.SetActiveAsync(item.Id, !item.IsActive); await _symptomRepository.SetActiveAsync(item.Id, !item.IsActive);
await LoadSymptomsAsync(); await LoadSymptomsAsync();
StatusText = "Symptom aktualisiert."; StatusText = LocalizationService.Translate("Options_Status_SymptomUpdated");
} }
private async Task DeleteSymptomAsync(SymptomManageItemViewModel? item) private async Task DeleteSymptomAsync(SymptomManageItemViewModel? item)
@@ -583,7 +671,10 @@ public partial class OptionsViewModel : ObservableObject
await _symptomRepository.DeleteOrDeactivateAsync(item.Id); await _symptomRepository.DeleteOrDeactivateAsync(item.Id);
await LoadSymptomsAsync(); await LoadSymptomsAsync();
StatusText = item.IsUsed ? "Symptom wurde deaktiviert." : "Symptom wurde gelöscht."; StatusText = LocalizationService.Translate(
item.IsUsed
? "Options_Status_SymptomDisabled"
: "Options_Status_SymptomDeleted");
} }
private Task AddScheduleAsync() private Task AddScheduleAsync()
@@ -599,7 +690,7 @@ public partial class OptionsViewModel : ObservableObject
Friday = true Friday = true
}); });
StatusText = "Benachrichtigungszeit hinzugefügt."; StatusText = LocalizationService.Translate("Options_Status_NotificationAdded");
return Task.CompletedTask; return Task.CompletedTask;
} }
@@ -610,16 +701,17 @@ public partial class OptionsViewModel : ObservableObject
var granted = await _notificationScheduler.EnsurePermissionAsync(); var granted = await _notificationScheduler.EnsurePermissionAsync();
if (!granted) if (!granted)
{ {
StatusText = OperatingSystem.IsAndroidVersionAtLeast(31) StatusText = LocalizationService.Translate(
? "Bitte Benachrichtigungen, Push-Nachrichten und Alarme erlauben und danach erneut speichern." OperatingSystem.IsAndroidVersionAtLeast(31)
: "Bitte Benachrichtigungen und Push-Nachrichten erlauben und danach erneut speichern."; ? "Options_Status_NotificationPermissionAndroid31"
: "Options_Status_NotificationPermissionLegacy");
return; return;
} }
if (NotificationSchedules.Any(x => x.ToWeekdayMask() == 0)) if (NotificationSchedules.Any(x => x.ToWeekdayMask() == 0))
{ {
StatusText = "Bitte pro Benachrichtigungszeit mindestens einen Wochentag auswählen."; StatusText = LocalizationService.Translate("Options_Status_NotificationWeekdayRequired");
return; return;
} }
@@ -636,9 +728,10 @@ public partial class OptionsViewModel : ObservableObject
await _notificationScheduler.SyncAsync(); await _notificationScheduler.SyncAsync();
await LoadSchedulesAsync(); await LoadSchedulesAsync();
StatusText = NotificationVibrationEnabled StatusText = LocalizationService.Translate(
? "Benachrichtigungszeiten gespeichert. Vibration ist aktiv." NotificationVibrationEnabled
: "Benachrichtigungszeiten gespeichert. Vibration ist aus."; ? "Options_Status_NotificationsSavedActive"
: "Options_Status_NotificationsSavedInactive");
} }
private Task DeleteScheduleAsync(NotificationScheduleItemViewModel? item) private Task DeleteScheduleAsync(NotificationScheduleItemViewModel? item)
@@ -646,7 +739,7 @@ public partial class OptionsViewModel : ObservableObject
if (item is not null) if (item is not null)
NotificationSchedules.Remove(item); NotificationSchedules.Remove(item);
StatusText = "Benachrichtigungszeit entfernt."; StatusText = LocalizationService.Translate("Options_Status_NotificationRemoved");
return Task.CompletedTask; return Task.CompletedTask;
} }
@@ -655,7 +748,7 @@ public partial class OptionsViewModel : ObservableObject
_databaseLocationService.UseExternalDatabase = UseExternalDatabase; _databaseLocationService.UseExternalDatabase = UseExternalDatabase;
_databaseLocationService.ExternalDatabasePath = ExternalDatabasePath?.Trim() ?? string.Empty; _databaseLocationService.ExternalDatabasePath = ExternalDatabasePath?.Trim() ?? string.Empty;
CurrentDatabasePath = _databaseLocationService.ResolveDatabasePath(); CurrentDatabasePath = _databaseLocationService.ResolveDatabasePath();
StatusText = "Datenbankpfad gespeichert. Bitte App neu starten, damit der Pfad aktiv wird."; StatusText = LocalizationService.Translate("Options_Status_DatabaseSaved");
return Task.CompletedTask; return Task.CompletedTask;
} }
@@ -670,7 +763,7 @@ public partial class OptionsViewModel : ObservableObject
SelectedExportActivity?.Id, SelectedExportActivity?.Id,
ExportSymptoms.Where(x => x.IsSelected).Select(x => x.Id).ToList()); ExportSymptoms.Where(x => x.IsSelected).Select(x => x.Id).ToList());
StatusText = $"Export erstellt: {result.FileName}"; StatusText = LocalizationService.Format("Options_Status_ExportCreated", result.FileName);
await ExportUiHelper.ShowExportSavedActionsAsync(result); await ExportUiHelper.ShowExportSavedActionsAsync(result);
} }
catch (Exception ex) catch (Exception ex)
@@ -686,15 +779,17 @@ public partial class OptionsViewModel : ObservableObject
ExportActivities.Add(new ActivityPickerItemViewModel ExportActivities.Add(new ActivityPickerItemViewModel
{ {
Id = null, Id = null,
Name = "Alle T\u00e4tigkeiten" Name = LocalizationService.Translate("Options_Export_AllActivities")
}); });
foreach (var item in activities.Where(x => !string.Equals(x.Name, "Keine T\u00e4tigkeit", StringComparison.OrdinalIgnoreCase))) foreach (var item in activities.Where(x => !LocalizationService.IsNoActivityLabel(x.Name)))
{ {
ExportActivities.Add(new ActivityPickerItemViewModel ExportActivities.Add(new ActivityPickerItemViewModel
{ {
Id = item.Id, Id = item.Id,
Name = item.IsActive ? item.Name : $"{item.Name} (inaktiv)" Name = item.IsActive
? item.Name
: LocalizationService.Format("Common_InactiveSuffix", item.Name)
}); });
} }
@@ -711,7 +806,9 @@ public partial class OptionsViewModel : ObservableObject
var exportItem = new SelectableSymptomItemViewModel var exportItem = new SelectableSymptomItemViewModel
{ {
Id = item.Id, Id = item.Id,
Name = item.IsActive ? item.Name : $"{item.Name} (inaktiv)", Name = item.IsActive
? item.Name
: LocalizationService.Format("Common_InactiveSuffix", item.Name),
IsSelected = selectedSymptomIds.Contains(item.Id) IsSelected = selectedSymptomIds.Contains(item.Id)
}; };
@@ -747,10 +844,10 @@ public partial class OptionsViewModel : ObservableObject
private async Task ClearExportsAsync() private async Task ClearExportsAsync()
{ {
var confirm = await Shell.Current.DisplayAlertAsync( var confirm = await Shell.Current.DisplayAlertAsync(
"Export entleeren", LocalizationService.Translate("Options_Export_Clear"),
"Möchtest du wirklich alle lokal gespeicherten Exporte löschen?", LocalizationService.Translate("Options_Export_Clear_Confirm"),
"Ja", LocalizationService.Translate("Common_Yes"),
"Nein"); LocalizationService.Translate("Common_No"));
if (!confirm) if (!confirm)
return; return;
@@ -758,11 +855,54 @@ public partial class OptionsViewModel : ObservableObject
var deleted = await _pdfExportService.ClearExportsAsync(); var deleted = await _pdfExportService.ClearExportsAsync();
await Shell.Current.DisplayAlertAsync( await Shell.Current.DisplayAlertAsync(
"Export entleeren", LocalizationService.Translate("Options_Export_Clear"),
deleted > 0 deleted > 0
? $"{deleted} Export-Datei(en) wurden gelöscht." ? LocalizationService.Format("Options_Export_Clear_ResultDeletedFormat", deleted)
: "Es waren keine Export-Dateien vorhanden.", : LocalizationService.Translate("Options_Export_Clear_ResultEmpty"),
"OK"); LocalizationService.Translate("Common_OK"));
}
private static string GetAppearanceColorTitle(string key) => LocalizationService.Translate(key switch
{
AppearanceKeys.AppBackground => "Options_Appearance_Color_AppBackground",
AppearanceKeys.SurfaceBackground => "Options_Appearance_Color_SurfaceBackground",
AppearanceKeys.SurfaceBackgroundAlt => "Options_Appearance_Color_SurfaceBackgroundAlt",
AppearanceKeys.Border => "Options_Appearance_Color_Border",
AppearanceKeys.TextPrimary => "Options_Appearance_Color_TextPrimary",
AppearanceKeys.TextMuted => "Options_Appearance_Color_TextMuted",
AppearanceKeys.StateGreen => "Options_Appearance_Color_StateGreen",
AppearanceKeys.StateYellow => "Options_Appearance_Color_StateYellow",
AppearanceKeys.StateRed => "Options_Appearance_Color_StateRed",
AppearanceKeys.StateGray => "Options_Appearance_Color_StateGray",
AppearanceKeys.ButtonPrimaryBackground => "Options_Appearance_Color_ButtonPrimaryBackground",
AppearanceKeys.ButtonPrimaryText => "Options_Appearance_Color_ButtonPrimaryText",
AppearanceKeys.ButtonSecondaryBackground => "Options_Appearance_Color_ButtonSecondaryBackground",
AppearanceKeys.ButtonSecondaryText => "Options_Appearance_Color_ButtonSecondaryText",
AppearanceKeys.ShellBackground => "Options_Appearance_Color_ShellBackground",
AppearanceKeys.ShellForeground => "Options_Appearance_Color_ShellForeground",
AppearanceKeys.ShellTitle => "Options_Appearance_Color_ShellTitle",
AppearanceKeys.ShellUnselected => "Options_Appearance_Color_ShellUnselected",
AppearanceKeys.TabBarBackground => "Options_Appearance_Color_TabBarBackground",
AppearanceKeys.TabBarForeground => "Options_Appearance_Color_TabBarForeground",
AppearanceKeys.TabBarTitle => "Options_Appearance_Color_TabBarTitle",
AppearanceKeys.TabBarUnselected => "Options_Appearance_Color_TabBarUnselected",
_ => key
});
private static string GetAppearanceTextTitle(string key) => LocalizationService.Translate(key switch
{
AppearanceKeys.StatusGreenText => "Options_Appearance_Text_Green",
AppearanceKeys.StatusYellowText => "Options_Appearance_Text_Yellow",
AppearanceKeys.StatusRedText => "Options_Appearance_Text_Red",
AppearanceKeys.StatusGrayText => "Options_Appearance_Text_Gray",
_ => key
});
private static string FormatShortDate(DateTime date)
{
var culture = LocalizationService.GetCurrentCulture();
var format = LocalizationService.Translate("Date_ShortNumericFormat");
return date.ToString(format, culture);
} }
private static string ToHex(Color color) private static string ToHex(Color color)
+25 -16
View File
@@ -41,16 +41,16 @@ public partial class QuickEntryViewModel : ObservableObject
private bool isEditing; private bool isEditing;
[ObservableProperty] [ObservableProperty]
private string greenStatusText = "Grün"; private string greenStatusText = "Green";
[ObservableProperty] [ObservableProperty]
private string yellowStatusText = "Gelb"; private string yellowStatusText = "Yellow";
[ObservableProperty] [ObservableProperty]
private string redStatusText = "Rot"; private string redStatusText = "Red";
[ObservableProperty] [ObservableProperty]
private string grayStatusText = "Schwarz"; private string grayStatusText = "Black";
[ObservableProperty] [ObservableProperty]
private Color greenStateColor = Color.FromArgb("#4E8B69"); private Color greenStateColor = Color.FromArgb("#4E8B69");
@@ -81,7 +81,7 @@ public partial class QuickEntryViewModel : ObservableObject
public ObservableCollection<DayPartOptionItemViewModel> Parts { get; } = new(); public ObservableCollection<DayPartOptionItemViewModel> Parts { get; } = new();
public string ModeText => IsFutureDate public string ModeText => IsFutureDate
? "Zukünftige Tage können nicht gespeichert werden." ? LocalizationService.Translate("QuickEntry_FutureDateMessage")
: string.Empty; : string.Empty;
public bool CanSave => !IsFutureDate; public bool CanSave => !IsFutureDate;
@@ -89,8 +89,8 @@ public partial class QuickEntryViewModel : ObservableObject
public bool CanExplicitSave => IsEditing && SelectedState.HasValue && !IsFutureDate; public bool CanExplicitSave => IsEditing && SelectedState.HasValue && !IsFutureDate;
public string SelectedStateSummaryText => SelectedState.HasValue public string SelectedStateSummaryText => SelectedState.HasValue
? $"Gewählter Status: {GetStateText(SelectedState.Value)}" ? LocalizationService.Format("QuickEntry_SelectedStatusFormat", GetStateText(SelectedState.Value))
: "Bitte Status wählen"; : LocalizationService.Translate("QuickEntry_SelectStatusPrompt");
public IAsyncRelayCommand SaveGreenCommand { get; } public IAsyncRelayCommand SaveGreenCommand { get; }
public IAsyncRelayCommand SaveYellowCommand { get; } public IAsyncRelayCommand SaveYellowCommand { get; }
@@ -214,11 +214,11 @@ public partial class QuickEntryViewModel : ObservableObject
Activities.Add(new ActivityPickerItemViewModel Activities.Add(new ActivityPickerItemViewModel
{ {
Id = null, Id = null,
Name = "Keine Tätigkeit" Name = LocalizationService.Translate("Activity_None")
}); });
var items = await _activityRepository.GetActiveAsync(); var items = await _activityRepository.GetActiveAsync();
foreach (var item in items.Where(x => !string.Equals(x.Name, "Keine Tätigkeit", StringComparison.OrdinalIgnoreCase))) foreach (var item in items.Where(x => !LocalizationService.IsNoActivityLabel(x.Name)))
{ {
Activities.Add(new ActivityPickerItemViewModel Activities.Add(new ActivityPickerItemViewModel
{ {
@@ -251,13 +251,13 @@ public partial class QuickEntryViewModel : ObservableObject
Parts.Add(new DayPartOptionItemViewModel Parts.Add(new DayPartOptionItemViewModel
{ {
Value = DayPart.Morning, Value = DayPart.Morning,
Name = "Vormittag" Name = LocalizationService.Translate("Common_Morning")
}); });
Parts.Add(new DayPartOptionItemViewModel Parts.Add(new DayPartOptionItemViewModel
{ {
Value = DayPart.Afternoon, Value = DayPart.Afternoon,
Name = "Nachmittag" Name = LocalizationService.Translate("Common_Afternoon")
}); });
} }
@@ -366,10 +366,18 @@ public partial class QuickEntryViewModel : ObservableObject
private void LoadAppearance() private void LoadAppearance()
{ {
GreenStatusText = _appearanceService.GetText(AppearanceKeys.StatusGreenText, "Grün"); GreenStatusText = _appearanceService.GetText(
YellowStatusText = _appearanceService.GetText(AppearanceKeys.StatusYellowText, "Gelb"); AppearanceKeys.StatusGreenText,
RedStatusText = _appearanceService.GetText(AppearanceKeys.StatusRedText, "Rot"); LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusGreenText));
GrayStatusText = _appearanceService.GetText(AppearanceKeys.StatusGrayText, "Schwarz"); YellowStatusText = _appearanceService.GetText(
AppearanceKeys.StatusYellowText,
LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusYellowText));
RedStatusText = _appearanceService.GetText(
AppearanceKeys.StatusRedText,
LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusRedText));
GrayStatusText = _appearanceService.GetText(
AppearanceKeys.StatusGrayText,
LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusGrayText));
GreenStateColor = _appearanceService.GetColor(AppearanceKeys.StateGreen, "#4E8B69"); GreenStateColor = _appearanceService.GetColor(AppearanceKeys.StateGreen, "#4E8B69");
YellowStateColor = _appearanceService.GetColor(AppearanceKeys.StateYellow, "#B89A42"); YellowStateColor = _appearanceService.GetColor(AppearanceKeys.StateYellow, "#B89A42");
@@ -417,6 +425,7 @@ public partial class QuickEntryViewModel : ObservableObject
case "gray": case "gray":
case "grey": case "grey":
case "black":
case "grau": case "grau":
case "schwarz": case "schwarz":
state = HealthState.Gray; state = HealthState.Gray;
@@ -441,4 +450,4 @@ public partial class QuickEntryViewModel : ObservableObject
item.IsSelected = !item.IsSelected; item.IsSelected = !item.IsSelected;
} }
} }
+3 -2
View File
@@ -1,3 +1,4 @@
using cfs_tracker.Services;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
namespace cfs_tracker.ViewModels; namespace cfs_tracker.ViewModels;
@@ -15,6 +16,6 @@ public partial class SymptomManageItemViewModel : ObservableObject
public bool IsUsed { get; init; } public bool IsUsed { get; init; }
public string UsageHint => IsUsed public string UsageHint => IsUsed
? "Bereits verwendet – kann nur deaktiviert werden." ? LocalizationService.Translate("Options_UsageHint_Used")
: "Kann gelöscht werden, solange unbenutzt."; : LocalizationService.Translate("Options_UsageHint_Unused");
} }
+6 -1
View File
@@ -1,3 +1,4 @@
using cfs_tracker.Services;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input; using CommunityToolkit.Mvvm.Input;
@@ -16,7 +17,11 @@ public partial class WeekDaySummaryViewModel : ObservableObject
public bool HasDetails => !string.IsNullOrWhiteSpace(ActivitiesText) || !string.IsNullOrWhiteSpace(SymptomsText); public bool HasDetails => !string.IsNullOrWhiteSpace(ActivitiesText) || !string.IsNullOrWhiteSpace(SymptomsText);
public bool HasActivities => !string.IsNullOrWhiteSpace(ActivitiesText); public bool HasActivities => !string.IsNullOrWhiteSpace(ActivitiesText);
public bool HasSymptoms => !string.IsNullOrWhiteSpace(SymptomsText); public bool HasSymptoms => !string.IsNullOrWhiteSpace(SymptomsText);
public string DetailsButtonText => IsExpanded ? "Zusammenfassung ausblenden" : "Zusammenfassung anzeigen"; public string DetailsButtonText => IsExpanded
? LocalizationService.Translate("WeekPage_SummaryHide")
: LocalizationService.Translate("WeekPage_SummaryShow");
public string ActivitiesSummaryText => LocalizationService.Format("WeekPage_ActivitiesFormat", ActivitiesText);
public string SymptomsSummaryText => LocalizationService.Format("WeekPage_SymptomsFormat", SymptomsText);
[ObservableProperty] [ObservableProperty]
private bool isExpanded; private bool isExpanded;
+9 -6
View File
@@ -108,7 +108,10 @@ public partial class WeekViewModel : ObservableObject
private void UpdateHeader() private void UpdateHeader()
{ {
WeekStart = DateHelper.StartOfWeekMonday(SelectedDate.Date); WeekStart = DateHelper.StartOfWeekMonday(SelectedDate.Date);
HeaderText = $"Woche {WeekStart:dd.MM.yyyy} - {WeekStart.AddDays(6):dd.MM.yyyy}"; HeaderText = LocalizationService.Format(
"WeekPage_HeaderFormat",
WeekStart.ToString(LocalizationService.Translate("Date_ShortNumericFormat"), LocalizationService.GetCurrentCulture()),
WeekStart.AddDays(6).ToString(LocalizationService.Translate("Date_ShortNumericFormat"), LocalizationService.GetCurrentCulture()));
} }
private async Task OpenDayAsync(WeekDaySummaryViewModel? item) private async Task OpenDayAsync(WeekDaySummaryViewModel? item)
@@ -160,10 +163,10 @@ public partial class WeekViewModel : ObservableObject
private string GetStateText(HealthState? state) => state switch private string GetStateText(HealthState? state) => state switch
{ {
HealthState.Green => _appearanceService.GetText(AppearanceKeys.StatusGreenText, "Grün"), HealthState.Green => _appearanceService.GetText(AppearanceKeys.StatusGreenText, LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusGreenText)),
HealthState.Yellow => _appearanceService.GetText(AppearanceKeys.StatusYellowText, "Gelb"), HealthState.Yellow => _appearanceService.GetText(AppearanceKeys.StatusYellowText, LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusYellowText)),
HealthState.Red => _appearanceService.GetText(AppearanceKeys.StatusRedText, "Rot"), HealthState.Red => _appearanceService.GetText(AppearanceKeys.StatusRedText, LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusRedText)),
HealthState.Gray => _appearanceService.GetText(AppearanceKeys.StatusGrayText, "Schwarz"), HealthState.Gray => _appearanceService.GetText(AppearanceKeys.StatusGrayText, LocalizationService.GetDefaultStatusText(AppearanceKeys.StatusGrayText)),
_ => "-" _ => "-"
}; };
@@ -190,4 +193,4 @@ public partial class WeekViewModel : ObservableObject
return HealthState.Green; return HealthState.Green;
} }
} }
+125 -43
View File
@@ -15,6 +15,7 @@ public partial class YearViewModel : ObservableObject
private readonly AppearanceService _appearanceService; private readonly AppearanceService _appearanceService;
private readonly CalendarStateService _calendarStateService; private readonly CalendarStateService _calendarStateService;
private readonly IPdfExportService _pdfExportService; private readonly IPdfExportService _pdfExportService;
private CancellationTokenSource? _refreshCancellationTokenSource;
[ObservableProperty] [ObservableProperty]
private DateTime selectedDate; private DateTime selectedDate;
@@ -59,60 +60,44 @@ public partial class YearViewModel : ObservableObject
public async Task RefreshAsync() public async Task RefreshAsync()
{ {
var refreshCancellationTokenSource = BeginRefresh();
var cancellationToken = refreshCancellationTokenSource.Token;
SelectedDate = _calendarStateService.SelectedDate.Date; SelectedDate = _calendarStateService.SelectedDate.Date;
UpdateHeader(); UpdateHeader();
var yearStart = new DateTime(SelectedDate.Year, 1, 1); try
var yearEnd = yearStart.AddYears(1);
var entries = await _healthEntryRepository.GetEntriesBetweenAsync(yearStart, yearEnd);
Months.Clear();
for (var monthNumber = 1; monthNumber <= 12; monthNumber++)
{ {
var monthStart = new DateTime(SelectedDate.Year, monthNumber, 1); var selectedYear = SelectedDate.Year;
var daysInMonth = DateTime.DaysInMonth(monthStart.Year, monthStart.Month); var sections = CreateMonthSections(selectedYear);
var section = new MonthSectionViewModel Months.Clear();
foreach (var section in sections)
Months.Add(section);
for (var monthNumber = 1; monthNumber <= sections.Count; monthNumber++)
{ {
Title = monthStart.ToString("MMMM") cancellationToken.ThrowIfCancellationRequested();
}; await LoadMonthSectionAsync(
sections[monthNumber - 1],
var leadingEmptyCells = GetMondayBasedColumnIndex(monthStart.DayOfWeek); selectedYear,
for (var i = 0; i < leadingEmptyCells; i++) monthNumber,
section.Cells.Add(CreatePlaceholderCell()); cancellationToken);
for (var day = 1; day <= daysInMonth; day++)
{
var date = new DateTime(monthStart.Year, monthStart.Month, day);
var dayEntries = entries.Where(x => x.EntryDate.Date == date.Date).ToList();
var worstState = CalculateWorstState(dayEntries);
section.Cells.Add(new MonthCellViewModel
{
Date = date,
DayNumberText = date.Day.ToString(),
IsCurrentMonth = true,
IsToday = date.Date == DateTime.Today,
HasEntries = dayEntries.Count > 0,
BackgroundColor = GetCellBackgroundColor(worstState),
TextColor = GetCellTextColor(worstState),
BorderColor = date.Date == DateTime.Today
? _appearanceService.GetColor(AppearanceKeys.StateYellow, "#B89A42")
: _appearanceService.GetColor(AppearanceKeys.Border, "#2A3E55")
});
} }
}
while (section.Cells.Count % 7 != 0) catch (OperationCanceledException)
section.Cells.Add(CreatePlaceholderCell()); {
// Ein neueres Refresh hat diese Aktualisierung ersetzt.
Months.Add(section); }
finally
{
EndRefresh(refreshCancellationTokenSource);
} }
} }
private void UpdateHeader() private void UpdateHeader()
{ {
HeaderText = SelectedDate.Year.ToString(); HeaderText = DateHelper.ToGermanYear(SelectedDate);
} }
private async Task OpenDayAsync(MonthCellViewModel? item) private async Task OpenDayAsync(MonthCellViewModel? item)
@@ -157,11 +142,108 @@ public partial class YearViewModel : ObservableObject
{ {
MainThread.BeginInvokeOnMainThread(async () => MainThread.BeginInvokeOnMainThread(async () =>
{ {
if (SelectedDate.Date == date.Date)
return;
SelectedDate = date.Date; SelectedDate = date.Date;
await RefreshAsync(); await RefreshAsync();
}); });
} }
private CancellationTokenSource BeginRefresh()
{
var refreshCancellationTokenSource = new CancellationTokenSource();
var previousRefresh = Interlocked.Exchange(ref _refreshCancellationTokenSource, refreshCancellationTokenSource);
previousRefresh?.Cancel();
previousRefresh?.Dispose();
return refreshCancellationTokenSource;
}
private void EndRefresh(CancellationTokenSource refreshCancellationTokenSource)
{
if (ReferenceEquals(_refreshCancellationTokenSource, refreshCancellationTokenSource))
_refreshCancellationTokenSource = null;
refreshCancellationTokenSource.Dispose();
}
private List<MonthSectionViewModel> CreateMonthSections(int year)
{
return Enumerable.Range(1, 12)
.Select(monthNumber => new MonthSectionViewModel
{
Title = new DateTime(year, monthNumber, 1).ToString("MMMM", LocalizationService.GetCurrentCulture()),
IsLoading = true
})
.ToList();
}
private async Task LoadMonthSectionAsync(
MonthSectionViewModel section,
int year,
int monthNumber,
CancellationToken cancellationToken)
{
var monthStart = new DateTime(year, monthNumber, 1);
var monthEnd = monthStart.AddMonths(1);
var entries = await _healthEntryRepository.GetEntriesBetweenAsync(monthStart, monthEnd);
cancellationToken.ThrowIfCancellationRequested();
var cells = BuildMonthCells(monthStart, entries);
await MainThread.InvokeOnMainThreadAsync(() =>
{
if (cancellationToken.IsCancellationRequested)
return;
section.ReplaceCells(cells);
});
}
private List<MonthCellViewModel> BuildMonthCells(DateTime monthStart, IReadOnlyList<HealthEntry> entries)
{
var cells = new List<MonthCellViewModel>();
var daysInMonth = DateTime.DaysInMonth(monthStart.Year, monthStart.Month);
var entriesByDay = entries
.GroupBy(x => x.EntryDate.Date)
.ToDictionary(group => group.Key, group => (IReadOnlyCollection<HealthEntry>)group.ToList());
var leadingEmptyCells = GetMondayBasedColumnIndex(monthStart.DayOfWeek);
for (var i = 0; i < leadingEmptyCells; i++)
cells.Add(CreatePlaceholderCell());
for (var day = 1; day <= daysInMonth; day++)
{
var date = new DateTime(monthStart.Year, monthStart.Month, day);
var dayEntries = entriesByDay.TryGetValue(date.Date, out var matches)
? matches
: Array.Empty<HealthEntry>();
var worstState = CalculateWorstState(dayEntries);
cells.Add(new MonthCellViewModel
{
Date = date,
DayNumberText = date.Day.ToString(),
IsCurrentMonth = true,
IsToday = date.Date == DateTime.Today,
HasEntries = dayEntries.Count > 0,
BackgroundColor = GetCellBackgroundColor(worstState),
TextColor = GetCellTextColor(worstState),
BorderColor = date.Date == DateTime.Today
? _appearanceService.GetColor(AppearanceKeys.StateYellow, "#B89A42")
: _appearanceService.GetColor(AppearanceKeys.Border, "#2A3E55")
});
}
while (cells.Count % 7 != 0)
cells.Add(CreatePlaceholderCell());
return cells;
}
private Color GetCellBackgroundColor(HealthState? state) => state switch private Color GetCellBackgroundColor(HealthState? state) => state switch
{ {
HealthState.Green => _appearanceService.GetColor(AppearanceKeys.StateGreen, "#4E8B69"), HealthState.Green => _appearanceService.GetColor(AppearanceKeys.StateGreen, "#4E8B69"),
@@ -216,4 +298,4 @@ public partial class YearViewModel : ObservableObject
BorderColor = Colors.Transparent BorderColor = Colors.Transparent
}; };
} }
} }
+11 -10
View File
@@ -3,9 +3,10 @@
x:Name="RootPage" x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels" xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:DayViewModel" x:DataType="viewModels:DayViewModel"
Title="Tag" Title="{loc:Translate Tab_Day}"
BackgroundColor="{DynamicResource AppBackground}"> BackgroundColor="{DynamicResource AppBackground}">
<ScrollView> <ScrollView>
@@ -30,11 +31,11 @@
<Grid ColumnDefinitions="*,*" <Grid ColumnDefinitions="*,*"
ColumnSpacing="12"> ColumnSpacing="12">
<Button Text="Heute" <Button Text="{loc:Translate Common_Today}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" /> Command="{Binding TodayCommand}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Export" Text="{loc:Translate Common_Export}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" /> Command="{Binding ExportPdfCommand}" />
</Grid> </Grid>
@@ -81,7 +82,7 @@
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
IsEnabled="{Binding CanAddEntry}" /> IsEnabled="{Binding CanAddEntry}" />
<Label Text="Noch keine Einträge vorhanden." <Label Text="{loc:Translate DayPage_NoEntries}"
IsVisible="{Binding HasNoEntries}" IsVisible="{Binding HasNoEntries}"
HorizontalTextAlignment="Center" HorizontalTextAlignment="Center"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
@@ -109,13 +110,13 @@
</VerticalStackLayout> </VerticalStackLayout>
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Bearbeiten" Text="{loc:Translate Common_Edit}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:DayViewModel}}, Path=EditEntryCommand, x:DataType='viewModels:DayViewModel'}" Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:DayViewModel}}, Path=EditEntryCommand, x:DataType='viewModels:DayViewModel'}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
<Button Grid.Column="2" <Button Grid.Column="2"
Text="Löschen" Text="{loc:Translate Common_Delete}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:DayViewModel}}, Path=DeleteEntryCommand, x:DataType='viewModels:DayViewModel'}" Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:DayViewModel}}, Path=DeleteEntryCommand, x:DataType='viewModels:DayViewModel'}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
@@ -137,13 +138,13 @@
<VerticalStackLayout IsVisible="{Binding IsExpanded}" <VerticalStackLayout IsVisible="{Binding IsExpanded}"
Spacing="6"> Spacing="6">
<Label Text="{Binding ActivityText, StringFormat='Tätigkeit: {0}'}" <Label Text="{Binding ActivitySummaryText}"
IsVisible="{Binding HasActivity}" IsVisible="{Binding HasActivity}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding DurationText, StringFormat='Dauer: {0}'}" <Label Text="{Binding DurationSummaryText}"
IsVisible="{Binding HasDuration}" IsVisible="{Binding HasDuration}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding SymptomsText, StringFormat='Symptome: {0}'}" <Label Text="{Binding SymptomsSummaryText}"
IsVisible="{Binding HasSymptoms}" IsVisible="{Binding HasSymptoms}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout> </VerticalStackLayout>
@@ -154,4 +155,4 @@
</CollectionView> </CollectionView>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>
+11 -10
View File
@@ -3,10 +3,11 @@
x:Name="RootPage" x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:views="clr-namespace:cfs_tracker.Views" xmlns:views="clr-namespace:cfs_tracker.Views"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels" xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:MonthViewModel" x:DataType="viewModels:MonthViewModel"
Title="Monat" Title="{loc:Translate Tab_Month}"
BackgroundColor="{DynamicResource AppBackground}"> BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,Auto,Auto,*" <Grid RowDefinitions="Auto,Auto,Auto,*"
@@ -37,11 +38,11 @@
<Grid Grid.Row="1" <Grid Grid.Row="1"
ColumnDefinitions="*,*" ColumnDefinitions="*,*"
ColumnSpacing="12"> ColumnSpacing="12">
<Button Text="Heute" <Button Text="{loc:Translate Common_Today}"
Command="{Binding TodayCommand}" Command="{Binding TodayCommand}"
Style="{StaticResource SecondaryButtonStyle}" /> Style="{StaticResource SecondaryButtonStyle}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Export" Text="{loc:Translate Common_Export}"
Command="{Binding ExportPdfCommand}" Command="{Binding ExportPdfCommand}"
Style="{StaticResource PrimaryButtonStyle}" /> Style="{StaticResource PrimaryButtonStyle}" />
</Grid> </Grid>
@@ -50,13 +51,13 @@
ColumnDefinitions="*,*,*,*,*,*,*" ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="6" ColumnSpacing="6"
Padding="2,0"> Padding="2,0">
<Label Text="Mo" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" /> <Label Text="{loc:Translate Common_Weekday_Mon}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="1" Text="{loc:Translate Common_Weekday_Tue}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="2" Text="{loc:Translate Common_Weekday_Wed}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="3" Text="{loc:Translate Common_Weekday_Thu}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="4" Text="{loc:Translate Common_Weekday_Fri}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="5" Text="{loc:Translate Common_Weekday_Sat}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="6" Text="{loc:Translate Common_Weekday_Sun}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
</Grid> </Grid>
<CollectionView Grid.Row="3" <CollectionView Grid.Row="3"
+100 -86
View File
@@ -3,10 +3,11 @@
x:Name="RootPage" x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:views="clr-namespace:cfs_tracker.Views" xmlns:views="clr-namespace:cfs_tracker.Views"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels" xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:OptionsViewModel" x:DataType="viewModels:OptionsViewModel"
Title="Optionen" Title="{loc:Translate Tab_Options}"
BackgroundColor="{DynamicResource AppBackground}"> BackgroundColor="{DynamicResource AppBackground}">
<ContentPage.Resources> <ContentPage.Resources>
@@ -33,7 +34,7 @@
<Grid> <Grid>
<ScrollView> <ScrollView>
<VerticalStackLayout Padding="16" Spacing="16"> <VerticalStackLayout Padding="16" Spacing="16">
<Label Text="Optionen" <Label Text="{loc:Translate Tab_Options}"
FontSize="28" FontSize="28"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
@@ -48,7 +49,7 @@
Wrap="Wrap" Wrap="Wrap"
AlignItems="Start" AlignItems="Start"
JustifyContent="Start"> JustifyContent="Start">
<Button Text="Aussehen" <Button Text="{loc:Translate Options_Tab_Appearance}"
Style="{StaticResource OptionsTabButtonStyle}" Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowAppearanceTabCommand}"> Command="{Binding ShowAppearanceTabCommand}">
<Button.Triggers> <Button.Triggers>
@@ -63,7 +64,7 @@
</Button.Triggers> </Button.Triggers>
</Button> </Button>
<Button Text="Push-Nachrichten" <Button Text="{loc:Translate Options_Tab_Notifications}"
Style="{StaticResource OptionsTabButtonStyle}" Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowNotificationsTabCommand}"> Command="{Binding ShowNotificationsTabCommand}">
<Button.Triggers> <Button.Triggers>
@@ -78,7 +79,7 @@
</Button.Triggers> </Button.Triggers>
</Button> </Button>
<Button Text="Datenverwaltung" <Button Text="{loc:Translate Options_Tab_Data}"
Style="{StaticResource OptionsTabButtonStyle}" Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowDataManagementTabCommand}"> Command="{Binding ShowDataManagementTabCommand}">
<Button.Triggers> <Button.Triggers>
@@ -93,7 +94,7 @@
</Button.Triggers> </Button.Triggers>
</Button> </Button>
<Button Text="Export" <Button Text="{loc:Translate Common_Export}"
Style="{StaticResource OptionsTabButtonStyle}" Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowExportTabCommand}"> Command="{Binding ShowExportTabCommand}">
<Button.Triggers> <Button.Triggers>
@@ -108,7 +109,7 @@
</Button.Triggers> </Button.Triggers>
</Button> </Button>
<Button Text="Rechtliches" <Button Text="{loc:Translate Options_Tab_Legal}"
Style="{StaticResource OptionsTabButtonStyle}" Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowLegalTabCommand}"> Command="{Binding ShowLegalTabCommand}">
<Button.Triggers> <Button.Triggers>
@@ -131,16 +132,26 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Aussehen" <Label Text="{loc:Translate Options_Appearance_Title}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Pro Farbe wird nur noch Vorschau und Dialog-Button angezeigt. Der eigentliche Farbwert wird erst im Farbdialog bearbeitet." <Label Text="{loc:Translate Options_Appearance_Description}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<VerticalStackLayout x:Name="AppearanceColorsHost" <VerticalStackLayout Spacing="4"
Spacing="10" /> Padding="0,6">
<Label Text="{loc:Translate Options_Appearance_LanguageLabel}"
TextColor="{DynamicResource TextPrimary}" />
<Picker Title="{loc:Translate Options_Appearance_LanguagePicker}"
ItemsSource="{Binding LanguageOptions}"
ItemDisplayBinding="{Binding DisplayName, x:DataType=viewModels:LanguageOptionItemViewModel}"
SelectedItem="{Binding SelectedLanguageOption}" />
<Label Text="{Binding SelectedLanguageDescription}"
FontSize="12"
TextColor="{DynamicResource TextMuted}" />
</VerticalStackLayout>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding StatusTexts}" <VerticalStackLayout BindableLayout.ItemsSource="{Binding StatusTexts}"
Spacing="10"> Spacing="10">
@@ -156,13 +167,16 @@
</BindableLayout.ItemTemplate> </BindableLayout.ItemTemplate>
</VerticalStackLayout> </VerticalStackLayout>
<VerticalStackLayout x:Name="AppearanceColorsHost"
Spacing="10" />
<Grid ColumnDefinitions="*,*" <Grid ColumnDefinitions="*,*"
ColumnSpacing="12"> ColumnSpacing="12">
<Button Text="Speichern" <Button Text="{loc:Translate Common_Save}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveAppearanceCommand}" /> Command="{Binding SaveAppearanceCommand}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Zurücksetzen" Text="{loc:Translate Common_Reset}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ResetAppearanceCommand}" /> Command="{Binding ResetAppearanceCommand}" />
</Grid> </Grid>
@@ -176,12 +190,12 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Push-Benachrichtigungen" <Label Text="{loc:Translate Options_Notifications_Title}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Ein Zeitblock kann auf mehreren Wochentagen aktiv sein." <Label Text="{loc:Translate Options_Notifications_Description}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="Auto,*" <Grid ColumnDefinitions="Auto,*"
@@ -204,16 +218,16 @@
<VerticalStackLayout Grid.Column="1" <VerticalStackLayout Grid.Column="1"
Spacing="2"> Spacing="2">
<Label Text="Vibration für Push-Nachrichten" <Label Text="{loc:Translate Options_Notifications_VibrationLabel}"
VerticalOptions="Center" VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Auf Android wird dafür automatisch der passende Benachrichtigungskanal verwendet." <Label Text="{loc:Translate Options_Notifications_VibrationHint}"
FontSize="12" FontSize="12"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
</VerticalStackLayout> </VerticalStackLayout>
</Grid> </Grid>
<Button Text="Zeit hinzufügen" <Button Text="{loc:Translate Options_Notifications_AddTime}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddScheduleCommand}" /> Command="{Binding AddScheduleCommand}" />
@@ -249,7 +263,7 @@
<Grid ColumnDefinitions="*,*,*,*,*,*,*" <Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="6"> ColumnSpacing="6">
<Button Text="Mo" <Button Text="{loc:Translate Common_Weekday_Mon}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleMondayCommand}"> Command="{Binding ToggleMondayCommand}">
<Button.Triggers> <Button.Triggers>
@@ -265,7 +279,7 @@
</Button> </Button>
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Di" Text="{loc:Translate Common_Weekday_Tue}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleTuesdayCommand}"> Command="{Binding ToggleTuesdayCommand}">
<Button.Triggers> <Button.Triggers>
@@ -281,7 +295,7 @@
</Button> </Button>
<Button Grid.Column="2" <Button Grid.Column="2"
Text="Mi" Text="{loc:Translate Common_Weekday_Wed}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleWednesdayCommand}"> Command="{Binding ToggleWednesdayCommand}">
<Button.Triggers> <Button.Triggers>
@@ -297,7 +311,7 @@
</Button> </Button>
<Button Grid.Column="3" <Button Grid.Column="3"
Text="Do" Text="{loc:Translate Common_Weekday_Thu}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleThursdayCommand}"> Command="{Binding ToggleThursdayCommand}">
<Button.Triggers> <Button.Triggers>
@@ -313,7 +327,7 @@
</Button> </Button>
<Button Grid.Column="4" <Button Grid.Column="4"
Text="Fr" Text="{loc:Translate Common_Weekday_Fri}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleFridayCommand}"> Command="{Binding ToggleFridayCommand}">
<Button.Triggers> <Button.Triggers>
@@ -329,7 +343,7 @@
</Button> </Button>
<Button Grid.Column="5" <Button Grid.Column="5"
Text="Sa" Text="{loc:Translate Common_Weekday_Sat}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleSaturdayCommand}"> Command="{Binding ToggleSaturdayCommand}">
<Button.Triggers> <Button.Triggers>
@@ -345,7 +359,7 @@
</Button> </Button>
<Button Grid.Column="6" <Button Grid.Column="6"
Text="So" Text="{loc:Translate Common_Weekday_Sun}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleSundayCommand}"> Command="{Binding ToggleSundayCommand}">
<Button.Triggers> <Button.Triggers>
@@ -361,7 +375,7 @@
</Button> </Button>
</Grid> </Grid>
<Button Text="Entfernen" <Button Text="{loc:Translate Common_Delete}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteScheduleCommand, x:DataType=views:OptionsPage}" Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteScheduleCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
@@ -371,7 +385,7 @@
</BindableLayout.ItemTemplate> </BindableLayout.ItemTemplate>
</VerticalStackLayout> </VerticalStackLayout>
<Button Text="Benachrichtigungszeiten speichern" <Button Text="{loc:Translate Options_Notifications_Save}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveSchedulesCommand}" /> Command="{Binding SaveSchedulesCommand}" />
</VerticalStackLayout> </VerticalStackLayout>
@@ -384,18 +398,18 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Export" <Label Text="{loc:Translate Options_Export_Title}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Lege Zeitraum und Darstellung fest. Nach dem Erstellen kannst du den Export direkt öffnen oder teilen." <Label Text="{loc:Translate Options_Export_Description}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*" <Grid ColumnDefinitions="*,*"
ColumnSpacing="12"> ColumnSpacing="12">
<VerticalStackLayout Spacing="4"> <VerticalStackLayout Spacing="4">
<Label Text="Von" <Label Text="{loc:Translate Common_From}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<DatePicker Date="{Binding ExportStartDate}" <DatePicker Date="{Binding ExportStartDate}"
MaximumDate="{Binding ExportEndDate}" /> MaximumDate="{Binding ExportEndDate}" />
@@ -403,7 +417,7 @@
<VerticalStackLayout Grid.Column="1" <VerticalStackLayout Grid.Column="1"
Spacing="4"> Spacing="4">
<Label Text="Bis" <Label Text="{loc:Translate Common_To}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<DatePicker Date="{Binding ExportEndDate}" <DatePicker Date="{Binding ExportEndDate}"
MinimumDate="{Binding ExportStartDate}" /> MinimumDate="{Binding ExportStartDate}" />
@@ -413,12 +427,12 @@
<Label Text="{Binding ExportRangeSummary}" <Label Text="{Binding ExportRangeSummary}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Label Text="Filter (optional)" <Label Text="{loc:Translate Options_Export_FilterTitle}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<VerticalStackLayout Spacing="4"> <VerticalStackLayout Spacing="4">
<Label Text="Tätigkeit" <Label Text="{loc:Translate QuickEntry_ActivityLabel}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Picker ItemsSource="{Binding ExportActivities}" <Picker ItemsSource="{Binding ExportActivities}"
ItemDisplayBinding="{Binding Name, x:DataType=viewModels:ActivityPickerItemViewModel}" ItemDisplayBinding="{Binding Name, x:DataType=viewModels:ActivityPickerItemViewModel}"
@@ -426,9 +440,9 @@
</VerticalStackLayout> </VerticalStackLayout>
<VerticalStackLayout Spacing="6"> <VerticalStackLayout Spacing="6">
<Label Text="Symptome" <Label Text="{loc:Translate QuickEntry_SymptomsLabel}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Mehrfachauswahl möglich." <Label Text="{loc:Translate Options_Export_SymptomsHint}"
FontSize="12" FontSize="12"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
@@ -461,11 +475,11 @@
<Label Text="{Binding ExportFilterSummary}" <Label Text="{Binding ExportFilterSummary}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Button Text="Filter zurücksetzen" <Button Text="{loc:Translate Options_Export_ResetFilters}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ResetExportFiltersCommand}" /> Command="{Binding ResetExportFiltersCommand}" />
<Label Text="Exportmodus" <Label Text="{loc:Translate Options_Export_ModeTitle}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
@@ -473,7 +487,7 @@
Wrap="Wrap" Wrap="Wrap"
AlignItems="Start" AlignItems="Start"
JustifyContent="Start"> JustifyContent="Start">
<Button Text="Tagesansicht" <Button Text="{loc:Translate Options_Export_Mode_DayView}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Margin="0,0,10,10" Margin="0,0,10,10"
Command="{Binding SelectDayViewExportLayoutCommand}"> Command="{Binding SelectDayViewExportLayoutCommand}">
@@ -489,7 +503,7 @@
</Button.Triggers> </Button.Triggers>
</Button> </Button>
<Button Text="Wochenblock" <Button Text="{loc:Translate Options_Export_Mode_WeekBlock}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Margin="0,0,10,10" Margin="0,0,10,10"
Command="{Binding SelectWeekBlockExportLayoutCommand}"> Command="{Binding SelectWeekBlockExportLayoutCommand}">
@@ -505,7 +519,7 @@
</Button.Triggers> </Button.Triggers>
</Button> </Button>
<Button Text="Tageszusammenfassung" <Button Text="{loc:Translate Options_Export_Mode_DaySummary}"
Style="{StaticResource DayToggleButtonStyle}" Style="{StaticResource DayToggleButtonStyle}"
Margin="0,0,10,10" Margin="0,0,10,10"
Command="{Binding SelectDaySummaryExportLayoutCommand}"> Command="{Binding SelectDaySummaryExportLayoutCommand}">
@@ -525,11 +539,11 @@
<Label Text="{Binding SelectedExportLayoutDescription}" <Label Text="{Binding SelectedExportLayoutDescription}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Button Text="Export erstellen" <Button Text="{loc:Translate Options_Export_Create}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportSelectedRangeCommand}" /> Command="{Binding ExportSelectedRangeCommand}" />
<Button Text="Export entleeren" <Button Text="{loc:Translate Options_Export_Clear}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ClearExportsCommand}" /> Command="{Binding ClearExportsCommand}" />
</VerticalStackLayout> </VerticalStackLayout>
@@ -542,7 +556,7 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Tätigkeiten" <Label Text="{loc:Translate Options_Data_ActivitiesTitle}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
@@ -550,9 +564,9 @@
<Grid ColumnDefinitions="*,Auto" <Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10"> ColumnSpacing="10">
<Entry Text="{Binding NewActivityName}" <Entry Text="{Binding NewActivityName}"
Placeholder="Neue Tätigkeit" /> Placeholder="{loc:Translate Options_Data_NewActivityPlaceholder}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Hinzufügen" Text="{loc:Translate Common_Add}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddActivityCommand}" /> Command="{Binding AddActivityCommand}" />
</Grid> </Grid>
@@ -571,17 +585,17 @@
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*" <Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8"> ColumnSpacing="8">
<Button Text="Speichern" <Button Text="{loc:Translate Common_Save}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.SaveActivityCommand, x:DataType=views:OptionsPage}" Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.SaveActivityCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Aktiv/Inaktiv" Text="{loc:Translate Options_Data_ToggleActive}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleActivityActiveCommand, x:DataType=views:OptionsPage}" Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleActivityActiveCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
<Button Grid.Column="2" <Button Grid.Column="2"
Text="Entfernen" Text="{loc:Translate Common_Delete}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteActivityCommand, x:DataType=views:OptionsPage}" Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteActivityCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
@@ -598,7 +612,7 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Symptome" <Label Text="{loc:Translate Options_Data_SymptomsTitle}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
@@ -606,9 +620,9 @@
<Grid ColumnDefinitions="*,Auto" <Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10"> ColumnSpacing="10">
<Entry Text="{Binding NewSymptomName}" <Entry Text="{Binding NewSymptomName}"
Placeholder="Neues Symptom" /> Placeholder="{loc:Translate Options_Data_NewSymptomPlaceholder}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Hinzufügen" Text="{loc:Translate Common_Add}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddSymptomCommand}" /> Command="{Binding AddSymptomCommand}" />
</Grid> </Grid>
@@ -627,17 +641,17 @@
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*" <Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8"> ColumnSpacing="8">
<Button Text="Speichern" <Button Text="{loc:Translate Common_Save}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.SaveSymptomCommand, x:DataType=views:OptionsPage}" Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.SaveSymptomCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Aktiv/Inaktiv" Text="{loc:Translate Options_Data_ToggleActive}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleSymptomActiveCommand, x:DataType=views:OptionsPage}" Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleSymptomActiveCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
<Button Grid.Column="2" <Button Grid.Column="2"
Text="Entfernen" Text="{loc:Translate Common_Delete}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteSymptomCommand, x:DataType=views:OptionsPage}" Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteSymptomCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" /> CommandParameter="{Binding .}" />
@@ -654,30 +668,30 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Datenbank" <Label Text="{loc:Translate Options_Database_Title}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding CurrentDatabasePath, StringFormat='Aktiver Pfad: {0}'}" <Label Text="{Binding CurrentDatabasePathText}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="Auto,*" <Grid ColumnDefinitions="Auto,*"
ColumnSpacing="8"> ColumnSpacing="8">
<CheckBox IsChecked="{Binding UseExternalDatabase}" /> <CheckBox IsChecked="{Binding UseExternalDatabase}" />
<Label Grid.Column="1" <Label Grid.Column="1"
Text="Externe Datenbank verwenden" Text="{loc:Translate Options_Database_UseExternal}"
VerticalOptions="Center" VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
</Grid> </Grid>
<Entry Text="{Binding ExternalDatabasePath}" <Entry Text="{Binding ExternalDatabasePath}"
Placeholder="Ordner oder Dateipfad für externe DB" /> Placeholder="{loc:Translate Options_Database_ExternalPathPlaceholder}" />
<Label Text="Für SQLite ist ein externer Dateipfad sinnvoll. Für echte Mehrbenutzer-Synchronisierung ist später eher ein eigener Server oder eine API-Schicht besser geeignet." <Label Text="{loc:Translate Options_Database_Hint}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Button Text="Datenbankpfad speichern" <Button Text="{loc:Translate Options_Database_Save}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveDatabaseLocationCommand}" /> Command="{Binding SaveDatabaseLocationCommand}" />
</VerticalStackLayout> </VerticalStackLayout>
@@ -687,49 +701,49 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Alle Einträge löschen" <Label Text="{loc:Translate Options_Data_DeleteAllTitle}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Zum Bestätigen 'löschen' eingeben." <Label Text="{loc:Translate Options_Data_DeleteAllDescription}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Entry Text="{Binding DeleteConfirmationText}" <Entry Text="{Binding DeleteConfirmationText}"
Placeholder="löschen" /> Placeholder="{loc:Translate Options_Data_DeleteConfirmationKeyword}" />
<Button Text="Alles löschen" <Button Text="{loc:Translate Options_Data_DeleteAllButton}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding DeleteAllDataCommand}" /> Command="{Binding DeleteAllDataCommand}" />
</VerticalStackLayout> </VerticalStackLayout>
</Border> </Border>
</VerticalStackLayout> </VerticalStackLayout>
<VerticalStackLayout IsVisible="{Binding IsLegalTabSelected}" <VerticalStackLayout IsVisible="{Binding IsLegalTabSelected}"
Spacing="16"> Spacing="16">
<Border Padding="12" <Border Padding="12"
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Datenschutzerklaerung" <Label Text="{loc:Translate Options_Legal_PrivacyTitle}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Stand: 03.04.2026" <Label Text="{loc:Translate Options_Legal_PrivacyDate}"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Label Text="Diese App verarbeitet deine Angaben ausschliesslich fuer die Nutzung auf deinem Geraet. Es werden keine Nutzerdaten automatisch an mich oder an Dritte uebermittelt, verkauft oder fuer Werbezwecke weitergegeben." <Label Text="{loc:Translate Options_Legal_PrivacyBody1}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Gespeichert werden Eintraege, Auswahllisten, Benachrichtigungszeiten, Darstellungseinstellungen und bei Bedarf lokal erzeugte Exportdateien. Eine Cloud-Synchronisierung oder ein automatischer Hintergrund-Upload findet durch diese App nicht statt." <Label Text="{loc:Translate Options_Legal_PrivacyBody2}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Die Speicherung erfolgt lokal im internen App-Bereich beziehungsweise in einem von dir selbst gewaehlten Speicherort. Die Daten liegen dort in technischer App-Struktur und sind nicht fuer eine unmittelbar oeffentliche Darstellung bestimmt. Bei direktem technischem Zugriff auf das Geraet oder auf Dateien kann jedoch nicht vollstaendig ausgeschlossen werden, dass fachkundige Personen Rueckschluesse auf Art und Inhalt der gespeicherten Daten ziehen koennen." <Label Text="{loc:Translate Options_Legal_PrivacyBody3}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Wenn du Exportdateien bewusst teilst oder einen externen Datenbankpfad verwendest, entscheidest du selbst ueber diesen Speicher- oder Weitergabeweg." <Label Text="{loc:Translate Options_Legal_PrivacyBody4}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout> </VerticalStackLayout>
@@ -739,16 +753,16 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Haftungshinweis" <Label Text="{loc:Translate Options_Legal_DisclaimerTitle}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Die Nutzung der App erfolgt auf eigenes Risiko. Soweit gesetzlich zulaessig, uebernehme ich keine Gewaehr oder Haftung fuer Aktualitaet, Richtigkeit, Vollstaendigkeit, technische Verfuegbarkeit, Datenverlust oder dafuer, dass die App fuer einen bestimmten Zweck geeignet ist." <Label Text="{loc:Translate Options_Legal_DisclaimerBody1}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Die App ersetzt keine medizinische, therapeutische, pflegerische, rechtliche oder technische Fachberatung." <Label Text="{loc:Translate Options_Legal_DisclaimerBody2}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout> </VerticalStackLayout>
@@ -758,16 +772,16 @@
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"> BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12"> <VerticalStackLayout Spacing="12">
<Label Text="Persoenlicher Hinweis" <Label Text="{loc:Translate Options_Legal_PersonalTitle}"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Diese App wurde nicht von einem Fachinformatiker entwickelt. Ich bin selbst Betroffener mit ME/CFS und habe die Anwendung aus eigener Perspektive und Erfahrung heraus erstellt." <Label Text="{loc:Translate Options_Legal_PersonalBody1}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="Gerade deshalb soll die App im Alltag helfen, sie ist aber ein persoenliches Projekt und kein professionell zertifiziertes Medizin- oder Softwareprodukt." <Label Text="{loc:Translate Options_Legal_PersonalBody2}"
LineBreakMode="WordWrap" LineBreakMode="WordWrap"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout> </VerticalStackLayout>
@@ -789,7 +803,7 @@
MaximumWidthRequest="560"> MaximumWidthRequest="560">
<VerticalStackLayout Spacing="14"> <VerticalStackLayout Spacing="14">
<Label x:Name="ColorDialogTitleLabel" <Label x:Name="ColorDialogTitleLabel"
Text="Farbe bearbeiten" Text="{loc:Translate Options_ColorDialog_EditTitle}"
FontSize="22" FontSize="22"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
@@ -818,7 +832,7 @@
<Grid ColumnDefinitions="80,*,56" <Grid ColumnDefinitions="80,*,56"
ColumnSpacing="10"> ColumnSpacing="10">
<Label Text="Rot" <Label Text="{loc:Translate Options_ColorDialog_Red}"
VerticalOptions="Center" VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Slider x:Name="DialogRedSlider" <Slider x:Name="DialogRedSlider"
@@ -836,7 +850,7 @@
<Grid ColumnDefinitions="80,*,56" <Grid ColumnDefinitions="80,*,56"
ColumnSpacing="10"> ColumnSpacing="10">
<Label Text="Grün" <Label Text="{loc:Translate Options_ColorDialog_Green}"
VerticalOptions="Center" VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Slider x:Name="DialogGreenSlider" <Slider x:Name="DialogGreenSlider"
@@ -854,7 +868,7 @@
<Grid ColumnDefinitions="80,*,56" <Grid ColumnDefinitions="80,*,56"
ColumnSpacing="10"> ColumnSpacing="10">
<Label Text="Blau" <Label Text="{loc:Translate Options_ColorDialog_Blue}"
VerticalOptions="Center" VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Slider x:Name="DialogBlueSlider" <Slider x:Name="DialogBlueSlider"
@@ -872,7 +886,7 @@
<Grid ColumnDefinitions="80,*,56" <Grid ColumnDefinitions="80,*,56"
ColumnSpacing="10"> ColumnSpacing="10">
<Label Text="Hell" <Label Text="{loc:Translate Options_ColorDialog_Brightness}"
VerticalOptions="Center" VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Slider x:Name="DialogBrightnessSlider" <Slider x:Name="DialogBrightnessSlider"
@@ -889,21 +903,21 @@
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
</Grid> </Grid>
<Label Text="Zurücksetzen lädt nur den Standardwert in den Dialog. Erst Übernehmen speichert die Änderung. Abbrechen verwirft alles aus diesem Dialog wieder." <Label Text="{loc:Translate Options_ColorDialog_Hint}"
FontSize="12" FontSize="12"
TextColor="{DynamicResource TextMuted}" /> TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*" <Grid ColumnDefinitions="*,*,*"
ColumnSpacing="10"> ColumnSpacing="10">
<Button Text="Zurücksetzen" <Button Text="{loc:Translate Common_Reset}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Clicked="OnResetColorDialogClicked" /> Clicked="OnResetColorDialogClicked" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Abbrechen" Text="{loc:Translate Common_Cancel}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
Clicked="OnCancelColorDialogClicked" /> Clicked="OnCancelColorDialogClicked" />
<Button Grid.Column="2" <Button Grid.Column="2"
Text="Übernehmen" Text="{loc:Translate Common_Apply}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Clicked="OnApplyColorDialogClicked" /> Clicked="OnApplyColorDialogClicked" />
</Grid> </Grid>
+14 -2
View File
@@ -1,4 +1,5 @@
using cfs_tracker.Helpers; using cfs_tracker.Helpers;
using cfs_tracker.Services;
using cfs_tracker.ViewModels; using cfs_tracker.ViewModels;
using Microsoft.Maui.Layouts; using Microsoft.Maui.Layouts;
using System.Collections.Specialized; using System.Collections.Specialized;
@@ -66,6 +67,16 @@ public partial class OptionsPage : ContentPage
{ {
if (e.PropertyName == nameof(OptionsViewModel.SelectedTab)) if (e.PropertyName == nameof(OptionsViewModel.SelectedTab))
Dispatcher.Dispatch(EnsureAppearanceEditorsIfNeeded); Dispatcher.Dispatch(EnsureAppearanceEditorsIfNeeded);
if (e.PropertyName == nameof(OptionsViewModel.RequiresShellReload) && _viewModel.RequiresShellReload)
{
_viewModel.ClearShellReloadFlag();
Dispatcher.Dispatch(async () =>
{
if (Application.Current is App app)
await app.ReloadShellAsync("//options", OptionsViewModel.OptionsTab.Appearance);
});
}
} }
private void EnsureAppearanceEditorsIfNeeded() private void EnsureAppearanceEditorsIfNeeded()
@@ -112,7 +123,7 @@ public partial class OptionsPage : ContentPage
var defaultLabel = new Label var defaultLabel = new Label
{ {
Text = $"Standard: {NormalizeHex(item.Fallback, item.Fallback)}", Text = $"{LocalizationService.Translate("Common_Default")}: {NormalizeHex(item.Fallback, item.Fallback)}",
FontSize = 12 FontSize = 12
}; };
defaultLabel.SetDynamicResource(Label.TextColorProperty, "TextMuted"); defaultLabel.SetDynamicResource(Label.TextColorProperty, "TextMuted");
@@ -137,6 +148,7 @@ public partial class OptionsPage : ContentPage
VerticalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center,
Margin = new Thickness(0, 0, 0, 10) Margin = new Thickness(0, 0, 0, 10)
}; };
chooseButton.Text = LocalizationService.Translate("Options_Appearance_ChooseColor");
chooseButton.SetDynamicResource(Button.BackgroundColorProperty, "ButtonSecondaryBackground"); chooseButton.SetDynamicResource(Button.BackgroundColorProperty, "ButtonSecondaryBackground");
chooseButton.SetDynamicResource(Button.TextColorProperty, "ButtonSecondaryText"); chooseButton.SetDynamicResource(Button.TextColorProperty, "ButtonSecondaryText");
chooseButton.Clicked += (_, _) => OpenColorDialog(item); chooseButton.Clicked += (_, _) => OpenColorDialog(item);
@@ -184,7 +196,7 @@ public partial class OptionsPage : ContentPage
_dialogWorkingHex = _dialogInitialHex; _dialogWorkingHex = _dialogInitialHex;
ColorDialogTitleLabel.Text = item.Title; ColorDialogTitleLabel.Text = item.Title;
ColorDialogDefaultLabel.Text = $"Standardwert: {NormalizeHex(item.Fallback, item.Fallback)}"; ColorDialogDefaultLabel.Text = $"{LocalizationService.Translate("Common_DefaultValue")}: {NormalizeHex(item.Fallback, item.Fallback)}";
ApplyDialogHex(_dialogWorkingHex, resetBrightness: true); ApplyDialogHex(_dialogWorkingHex, resetBrightness: true);
ColorDialogOverlay.IsVisible = true; ColorDialogOverlay.IsVisible = true;
+35 -35
View File
@@ -4,10 +4,11 @@
x:Name="RootPage" x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:views="clr-namespace:cfs_tracker.Views" xmlns:views="clr-namespace:cfs_tracker.Views"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels" xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:QuickEntryViewModel" x:DataType="viewModels:QuickEntryViewModel"
Title="Eintrag" Title="{loc:Translate QuickEntry_Title}"
BackgroundColor="{DynamicResource AppBackground}"> BackgroundColor="{DynamicResource AppBackground}">
<ScrollView> <ScrollView>
@@ -30,10 +31,10 @@
StrokeShape="RoundRectangle 14" StrokeShape="RoundRectangle 14"
IsVisible="{Binding IsPastDate}"> IsVisible="{Binding IsPastDate}">
<VerticalStackLayout Spacing="8"> <VerticalStackLayout Spacing="8">
<Label Text="Nachtrag" <Label Text="{loc:Translate QuickEntry_BackfillTitle}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Picker Title="Tageszeit" <Picker Title="{loc:Translate QuickEntry_DayPartPicker}"
ItemsSource="{Binding Parts}" ItemsSource="{Binding Parts}"
ItemDisplayBinding="{Binding Name, x:DataType=viewModels:DayPartOptionItemViewModel}" ItemDisplayBinding="{Binding Name, x:DataType=viewModels:DayPartOptionItemViewModel}"
SelectedItem="{Binding SelectedPart}" /> SelectedItem="{Binding SelectedPart}" />
@@ -45,15 +46,15 @@
BackgroundColor="{DynamicResource SurfaceBackground}" BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14"> StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="8"> <VerticalStackLayout Spacing="8">
<Label Text="Tätigkeit" <Label Text="{loc:Translate QuickEntry_ActivityLabel}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Picker Title="Tätigkeit" <Picker Title="{loc:Translate QuickEntry_ActivityPicker}"
ItemsSource="{Binding Activities}" ItemsSource="{Binding Activities}"
ItemDisplayBinding="{Binding Name, x:DataType=viewModels:ActivityPickerItemViewModel}" ItemDisplayBinding="{Binding Name, x:DataType=viewModels:ActivityPickerItemViewModel}"
SelectedItem="{Binding SelectedActivity}" /> SelectedItem="{Binding SelectedActivity}" />
<Label Text="Dauer (HH:mm)" <Label Text="{loc:Translate QuickEntry_DurationLabel}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<TimePicker Time="{Binding ActivityDuration}" <TimePicker Time="{Binding ActivityDuration}"
@@ -62,55 +63,54 @@
</Border> </Border>
<Border Padding="12" <Border Padding="12"
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}" BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14"> StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="8"> <VerticalStackLayout Spacing="8">
<Label Text="Symptome" <Label Text="{loc:Translate QuickEntry_SymptomsLabel}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Symptoms}" <VerticalStackLayout BindableLayout.ItemsSource="{Binding Symptoms}"
Spacing="8"> Spacing="8">
<BindableLayout.ItemTemplate> <BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:SelectableSymptomItemViewModel"> <DataTemplate x:DataType="viewModels:SelectableSymptomItemViewModel">
<Border Padding="12,10" <Border Padding="12,10"
StrokeThickness="1" StrokeThickness="1"
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
StrokeShape="RoundRectangle 12" StrokeShape="RoundRectangle 12"
BackgroundColor="{DynamicResource ButtonPrimaryBackground}"> BackgroundColor="{DynamicResource ButtonPrimaryBackground}">
<Border.GestureRecognizers> <Border.GestureRecognizers>
<TapGestureRecognizer <TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleSymptomCommand, x:DataType=views:QuickEntryPage}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleSymptomCommand, x:DataType=views:QuickEntryPage}" CommandParameter="{Binding .}" />
CommandParameter="{Binding .}" />
</Border.GestureRecognizers> </Border.GestureRecognizers>
<Border.Triggers> <Border.Triggers>
<DataTrigger TargetType="Border" <DataTrigger TargetType="Border"
Binding="{Binding IsSelected}" Binding="{Binding IsSelected}"
Value="True"> Value="True">
<Setter Property="BackgroundColor" <Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" /> Value="{DynamicResource ButtonSecondaryBackground}" />
</DataTrigger> </DataTrigger>
</Border.Triggers> </Border.Triggers>
<Grid ColumnDefinitions="Auto,*" <Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12"> ColumnSpacing="12">
<CheckBox IsChecked="{Binding IsSelected}" <CheckBox IsChecked="{Binding IsSelected}"
InputTransparent="True" InputTransparent="True"
Color="White" Color="White"
VerticalOptions="Center" /> VerticalOptions="Center" />
<Label Grid.Column="1" <Label Grid.Column="1"
Text="{Binding Name}" Text="{Binding Name}"
VerticalOptions="Center" VerticalOptions="Center"
TextColor="{DynamicResource ButtonPrimaryText}"> TextColor="{DynamicResource ButtonPrimaryText}">
<Label.Triggers> <Label.Triggers>
<DataTrigger TargetType="Label" <DataTrigger TargetType="Label"
Binding="{Binding IsSelected}" Binding="{Binding IsSelected}"
Value="True"> Value="True">
<Setter Property="TextColor" <Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" /> Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger> </DataTrigger>
</Label.Triggers> </Label.Triggers>
</Label> </Label>
@@ -181,7 +181,7 @@
HorizontalTextAlignment="Center" HorizontalTextAlignment="Center"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Button Text="Eintrag speichern" <Button Text="{loc:Translate QuickEntry_SaveButton}"
Command="{Binding SaveCommand}" Command="{Binding SaveCommand}"
IsEnabled="{Binding CanExplicitSave}" IsEnabled="{Binding CanExplicitSave}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
@@ -189,7 +189,7 @@
</VerticalStackLayout> </VerticalStackLayout>
</Border> </Border>
<Button Text="Abbrechen" <Button Text="{loc:Translate Common_Cancel}"
Command="{Binding CancelCommand}" Command="{Binding CancelCommand}"
Style="{StaticResource SecondaryButtonStyle}" Style="{StaticResource SecondaryButtonStyle}"
HorizontalOptions="Fill" /> HorizontalOptions="Fill" />
+24 -24
View File
@@ -3,9 +3,10 @@
x:Name="RootPage" x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels" xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:WeekViewModel" x:DataType="viewModels:WeekViewModel"
Title="Woche" Title="{loc:Translate Tab_Week}"
BackgroundColor="{DynamicResource AppBackground}"> BackgroundColor="{DynamicResource AppBackground}">
<ScrollView> <ScrollView>
@@ -16,12 +17,12 @@
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousWeekCommand}" /> Command="{Binding PreviousWeekCommand}" />
<Label Grid.Column="1" <Label Grid.Column="1"
Text="{Binding HeaderText}" Text="{Binding HeaderText}"
HorizontalTextAlignment="Center" HorizontalTextAlignment="Center"
VerticalTextAlignment="Center" VerticalTextAlignment="Center"
FontSize="20" FontSize="20"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="2" <Button Grid.Column="2"
Text="→" Text="→"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
@@ -30,11 +31,11 @@
<Grid ColumnDefinitions="*,*" <Grid ColumnDefinitions="*,*"
ColumnSpacing="12"> ColumnSpacing="12">
<Button Text="Heute" <Button Text="{loc:Translate Common_Today}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" /> Command="{Binding TodayCommand}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Export" Text="{loc:Translate Common_Export}"
Style="{StaticResource PrimaryButtonStyle}" Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" /> Command="{Binding ExportPdfCommand}" />
</Grid> </Grid>
@@ -44,23 +45,22 @@
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:WeekDaySummaryViewModel"> <DataTemplate x:DataType="viewModels:WeekDaySummaryViewModel">
<Border Margin="0,0,0,12" <Border Margin="0,0,0,12"
Padding="12" Padding="12"
Stroke="{DynamicResource Border}" Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}" BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14"> StrokeShape="RoundRectangle 14">
<Border.GestureRecognizers> <Border.GestureRecognizers>
<TapGestureRecognizer <TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:WeekViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:WeekViewModel'}"
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:WeekViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:WeekViewModel'}" CommandParameter="{Binding .}" />
CommandParameter="{Binding .}" />
</Border.GestureRecognizers> </Border.GestureRecognizers>
<VerticalStackLayout Spacing="10"> <VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*" <Grid ColumnDefinitions="*"
ColumnSpacing="10"> ColumnSpacing="10">
<Label Text="{Binding DateText}" <Label Text="{Binding DateText}"
FontAttributes="Bold" FontAttributes="Bold"
FontSize="18" FontSize="18"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
</Grid> </Grid>
<Grid ColumnDefinitions="*,*" <Grid ColumnDefinitions="*,*"
@@ -70,7 +70,7 @@
StrokeShape="RoundRectangle 10" StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding MorningColor}"> BackgroundColor="{Binding MorningColor}">
<VerticalStackLayout Spacing="4"> <VerticalStackLayout Spacing="4">
<Label Text="Vormittag" <Label Text="{loc:Translate Common_Morning}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="White" /> TextColor="White" />
<Label Text="{Binding MorningText}" <Label Text="{Binding MorningText}"
@@ -84,7 +84,7 @@
StrokeShape="RoundRectangle 10" StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding AfternoonColor}"> BackgroundColor="{Binding AfternoonColor}">
<VerticalStackLayout Spacing="4"> <VerticalStackLayout Spacing="4">
<Label Text="Nachmittag" <Label Text="{loc:Translate Common_Afternoon}"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="White" /> TextColor="White" />
<Label Text="{Binding AfternoonText}" <Label Text="{Binding AfternoonText}"
@@ -100,10 +100,10 @@
<VerticalStackLayout IsVisible="{Binding IsExpanded}" <VerticalStackLayout IsVisible="{Binding IsExpanded}"
Spacing="6"> Spacing="6">
<Label Text="{Binding ActivitiesText, StringFormat='Tätigkeiten: {0}'}" <Label Text="{Binding ActivitiesSummaryText}"
IsVisible="{Binding HasActivities}" IsVisible="{Binding HasActivities}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding SymptomsText, StringFormat='Symptome: {0}'}" <Label Text="{Binding SymptomsSummaryText}"
IsVisible="{Binding HasSymptoms}" IsVisible="{Binding HasSymptoms}"
TextColor="{DynamicResource TextPrimary}" /> TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout> </VerticalStackLayout>
+23 -14
View File
@@ -3,10 +3,11 @@
x:Name="RootPage" x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:views="clr-namespace:cfs_tracker.Views" xmlns:views="clr-namespace:cfs_tracker.Views"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels" xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:YearViewModel" x:DataType="viewModels:YearViewModel"
Title="Jahr" Title="{loc:Translate Tab_Year}"
BackgroundColor="{DynamicResource AppBackground}"> BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,Auto,*" <Grid RowDefinitions="Auto,Auto,*"
@@ -37,11 +38,11 @@
<Grid Grid.Row="1" <Grid Grid.Row="1"
ColumnDefinitions="*,*" ColumnDefinitions="*,*"
ColumnSpacing="12"> ColumnSpacing="12">
<Button Text="Heute" <Button Text="{loc:Translate Common_Today}"
Command="{Binding TodayCommand}" Command="{Binding TodayCommand}"
Style="{StaticResource SecondaryButtonStyle}" /> Style="{StaticResource SecondaryButtonStyle}" />
<Button Grid.Column="1" <Button Grid.Column="1"
Text="Export" Text="{loc:Translate Common_Export}"
Command="{Binding ExportPdfCommand}" Command="{Binding ExportPdfCommand}"
Style="{StaticResource PrimaryButtonStyle}" /> Style="{StaticResource PrimaryButtonStyle}" />
</Grid> </Grid>
@@ -56,20 +57,28 @@
StrokeShape="RoundRectangle 12" StrokeShape="RoundRectangle 12"
Padding="10"> Padding="10">
<VerticalStackLayout Spacing="8"> <VerticalStackLayout Spacing="8">
<Label Text="{Binding Title}" <Grid ColumnDefinitions="*,Auto"
FontSize="18" ColumnSpacing="8">
FontAttributes="Bold" <Label Text="{Binding Title}"
TextColor="{DynamicResource TextPrimary}" /> FontSize="18"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<ActivityIndicator Grid.Column="1"
IsVisible="{Binding IsLoading}"
IsRunning="{Binding IsLoading}"
VerticalOptions="Center"
Color="{DynamicResource TextMuted}" />
</Grid>
<Grid ColumnDefinitions="*,*,*,*,*,*,*" <Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4"> ColumnSpacing="4">
<Label Text="Mo" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" /> <Label Text="{loc:Translate Common_Weekday_Mon}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="1" Text="{loc:Translate Common_Weekday_Tue}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="2" Text="{loc:Translate Common_Weekday_Wed}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="3" Text="{loc:Translate Common_Weekday_Thu}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="4" Text="{loc:Translate Common_Weekday_Fri}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="5" Text="{loc:Translate Common_Weekday_Sat}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" /> <Label Grid.Column="6" Text="{loc:Translate Common_Weekday_Sun}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
</Grid> </Grid>
<CollectionView ItemsSource="{Binding Cells}" <CollectionView ItemsSource="{Binding Cells}"
+5 -1
View File
@@ -1,3 +1,4 @@
using cfs_tracker.Services;
using cfs_tracker.ViewModels; using cfs_tracker.ViewModels;
using System.Diagnostics; using System.Diagnostics;
@@ -26,7 +27,10 @@ public partial class YearPage : ContentPage
{ {
Debug.WriteLine("YearPage crash:"); Debug.WriteLine("YearPage crash:");
Debug.WriteLine(ex.ToString()); Debug.WriteLine(ex.ToString());
await DisplayAlertAsync("Fehler", ex.ToString(), "OK"); await DisplayAlertAsync(
LocalizationService.Translate("Common_Error"),
ex.ToString(),
LocalizationService.Translate("Common_OK"));
} }
} }
} }
+1 -1
View File
@@ -10,7 +10,7 @@
<ApplicationTitle>cfs-tracker</ApplicationTitle> <ApplicationTitle>cfs-tracker</ApplicationTitle>
<ApplicationId>com.companyname.cfstracker</ApplicationId> <ApplicationId>com.companyname.cfstracker</ApplicationId>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion> <ApplicationVersion>3</ApplicationVersion>
<NeutralLanguage>de-DE</NeutralLanguage> <NeutralLanguage>de-DE</NeutralLanguage>
<AppxDefaultResourceQualifiers>Language=de-DE|Contrast=standard|Scale=200|HomeRegion=001|TargetSize=256|LayoutDirection=LTR|DXFeatureLevel=DX9|Configuration=|AlternateForm=</AppxDefaultResourceQualifiers> <AppxDefaultResourceQualifiers>Language=de-DE|Contrast=standard|Scale=200|HomeRegion=001|TargetSize=256|LayoutDirection=LTR|DXFeatureLevel=DX9|Configuration=|AlternateForm=</AppxDefaultResourceQualifiers>
<WindowsPackageType>None</WindowsPackageType> <WindowsPackageType>None</WindowsPackageType>