LANCommander/LANCommander.Launcher/Helpers/Localization.cs
Pat Hartl b183e4b18c Remove old launcher, rename Avalonia launcher
Also adds ARM builds for Linux + Windows launcher
2026-06-06 05:49:24 -05:00

23 lines
627 B
C#

using Avalonia;
namespace LANCommander.Launcher.Helpers;
public static class Localization
{
public static string Localize(string key, params object[] args)
{
string? s = null;
// Pass null for themeVariant so non-theme-specific resources in merged
// dictionaries are always found, regardless of which thread calls this.
var app = Application.Current;
if (app != null)
{
app.TryGetResource(key, null, out var resource);
s = resource as string;
}
s ??= key;
return args.Length == 0 ? s : string.Format(s, args);
}
}