mirror of
https://github.com/WinDurango/WinDurango.UI.git
synced 2026-01-31 00:55:24 +01:00
18 lines
599 B
C#
18 lines
599 B
C#
using System;
|
|
using WinDurango.UI.Utils;
|
|
using WinUI3Localizer;
|
|
|
|
namespace WinDurango.UI.Localization
|
|
{
|
|
public static class Locale
|
|
{
|
|
public static string GetLocalizedText(string name, params object[] args)
|
|
{
|
|
String translated = Localizer.Get().GetLocalizedString(name);
|
|
if (translated == "")
|
|
Logger.Write(LogLevel.Warning, $"String {name} not found in string resources.");
|
|
return string.Format(translated == "" ? $"LOCALIZATION ERROR: String {name} not found in string resources." : translated, args);
|
|
}
|
|
}
|
|
}
|