Files
FoodsharingOnboarding/FoodsharingSiegen.Shared/Helper/TermHelper.cs
Andre Beging bf64239625 Refactor enums and update Interaction entity field
Moved enums to a dedicated namespace and updated references across the codebase. Renamed the `Info` field in the `Interaction` entity to `Info1`, including necessary migrations and UI adjustments. These changes improve the organization and consistency of the codebase.
2025-04-01 10:41:09 +02:00

38 lines
1.5 KiB
C#

#nullable enable
using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Contracts.Enums;
using FoodsharingSiegen.Contracts.Model;
namespace FoodsharingSiegen.Shared.Helper
{
public static class TermHelper
{
#region Public Method Translate
/// <summary>
/// Translates an <see cref="InteractionType" /> instance into a corresponding string representation,
/// using the provided application settings if necessary.
/// </summary>
/// <param name="type">The interaction type to translate.</param>
/// <param name="appSettings">The application settings used for custom translations.</param>
/// <returns>A string representation of the specified interaction type.</returns>
public static string Translate(this InteractionType type, AppSettings appSettings)
{
return type switch
{
InteractionType.EinAb => "Einführung",
InteractionType.Welcome => "Begrüßung",
InteractionType.IdCheck => "Perso-Check",
InteractionType.PrintPass => "FS-Ausweis",
InteractionType.Verify => "Verifizierung",
InteractionType.Complete => "Fertig",
InteractionType.StepInBriefing => appSettings.Terms.StepInName ?? "StepIn",
InteractionType.ReleasedForVerification => "Freigabe zum Freischalten",
_ => type.ToString()
};
}
#endregion
}
}