SystemTrayMenu/Utilities/Translate.cs
2022-11-03 22:17:23 +01:00

26 lines
645 B
C#

// <copyright file="Translate.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
//
// Copyright (c) 2022-2022 Peter Kirmeier
#nullable enable
namespace SystemTrayMenu.Utilities
{
using System;
using System.Windows.Markup;
public class Translate : MarkupExtension
{
private readonly string original;
public Translate(string original)
{
this.original = original;
}
public override object ProvideValue(IServiceProvider serviceProvider) => Translator.GetText(original) ?? original;
}
}