mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-05 13:24:51 +01:00
Added system language detection
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Styling;
|
||||
|
||||
namespace StarterNG.Services;
|
||||
|
||||
@@ -11,6 +10,8 @@ public class LocalizationService : INotifyPropertyChanged
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
|
||||
public string CurrentLanguage;
|
||||
|
||||
public string this[string key]
|
||||
{
|
||||
get
|
||||
@@ -23,9 +24,10 @@ public class LocalizationService : INotifyPropertyChanged
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLanguage(IResourceProvider provider)
|
||||
public void SetLanguage(IResourceProvider provider, string langName)
|
||||
{
|
||||
_currentProvider = provider;
|
||||
CurrentLanguage = langName;
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Item"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user