2023-03-03 19:25:33 +00:00
|
|
|
/* LocaleCollection.cs
|
|
|
|
* License: NCSA Open Source License
|
|
|
|
*
|
2024-05-21 20:15:19 +01:00
|
|
|
* Copyright: SPT
|
2023-03-03 19:25:33 +00:00
|
|
|
* AUTHORS:
|
|
|
|
* waffle.lord
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2024-05-21 20:15:19 +01:00
|
|
|
using SPT.Launcher.Helpers;
|
2023-03-03 19:25:33 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.ComponentModel;
|
2024-09-02 07:53:58 +00:00
|
|
|
using SPT.Launcher.Utilities;
|
2023-03-03 19:25:33 +00:00
|
|
|
|
2024-05-21 20:15:19 +01:00
|
|
|
namespace SPT.Launcher.Models.Launcher
|
2023-03-03 19:25:33 +00:00
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
public class LocaleCollection : NotifyPropertyChangedBase
|
2023-03-03 19:25:33 +00:00
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
private string _selectedLocale;
|
2023-03-03 19:25:33 +00:00
|
|
|
public string SelectedLocale
|
|
|
|
{
|
2024-09-02 07:53:58 +00:00
|
|
|
get => _selectedLocale;
|
|
|
|
set => SetProperty(ref _selectedLocale, value, () => LocalizationProvider.LoadLocalByName(value));
|
2023-03-03 19:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public ObservableCollection<string> AvailableLocales { get; set; } = LocalizationProvider.GetAvailableLocales();
|
|
|
|
|
|
|
|
public LocaleCollection()
|
|
|
|
{
|
|
|
|
SelectedLocale = LocalizationProvider.LocaleNameDictionary.GetValueOrDefault(LauncherSettingsProvider.Instance.DefaultLocale, "English");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|