- Started adding localization resources - Implemented notifications using Notify.NET - Reworked many control styling to use overall app theme instead of controlling them individually - Adjusted display of play button in different states - Fixed cover in download queue" - Added play actions overlay - Fixed grouped view reference to bitmap converter
23 lines
636 B
C#
23 lines
636 B
C#
using Avalonia;
|
|
|
|
namespace LANCommander.Launcher.Avalonia.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);
|
|
}
|
|
}
|