Introduced `TermHelper.Translate` to centralize string mappings for `InteractionType`, reducing duplication across components. Updated related code to leverage this utility and streamline interaction row implementation by removing the `Caption` parameter. Minor UI adjustments were also made to align button positioning and styling.
38 lines
1.5 KiB
C#
38 lines
1.5 KiB
C#
#nullable enable
|
|
|
|
using FoodsharingSiegen.Contracts.Entity;
|
|
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 prüfen",
|
|
InteractionType.PrintPass => "FS-Ausweis (Print)",
|
|
InteractionType.PdfPass => "FS-Ausweis (PDF)",
|
|
InteractionType.Verify => "Verifizieren",
|
|
InteractionType.Complete => "Fertig",
|
|
InteractionType.StepInBriefing => appSettings.Terms.StepInName ?? "StepIn",
|
|
InteractionType.ReleasedForVerification => "Freigabe zur Verifizierung",
|
|
_ => type.ToString()
|
|
};
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |