fixed comment into code
This commit is contained in:
@@ -8,9 +8,9 @@ using CursorLang.Services;
|
||||
namespace CursorLang.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// Вариант выбора в списке. Подпись меняется вместе с языком, а сам объект
|
||||
/// живёт всё время работы окна: если пересоздавать элементы списка,
|
||||
/// ComboBox сбрасывает выбранное значение.
|
||||
/// An option in a list. The caption changes together with the language, while the
|
||||
/// object itself lives for as long as the window does: recreating the list items
|
||||
/// makes the ComboBox drop the selected value.
|
||||
/// </summary>
|
||||
public sealed class EnumOption<T> : ObservableObject where T : struct, Enum
|
||||
{
|
||||
@@ -30,13 +30,13 @@ public sealed class EnumOption<T> : ObservableObject where T : struct, Enum
|
||||
set => SetProperty(ref _display, value);
|
||||
}
|
||||
|
||||
// Средства доступности берут имя элемента списка отсюда
|
||||
// Accessibility tools take the name of the list item from here
|
||||
public override string ToString() => Display;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Окно настроек. Значения правятся прямо в <see cref="AppSettings"/>,
|
||||
/// поэтому подсказка подхватывает их сразу, без кнопки «Применить».
|
||||
/// The settings window. The values are edited right in <see cref="AppSettings"/>,
|
||||
/// so the popup picks them up at once, without an "Apply" button.
|
||||
/// </summary>
|
||||
public sealed partial class SettingsViewModel : ObservableObject, IDisposable
|
||||
{
|
||||
@@ -69,7 +69,7 @@ public sealed partial class SettingsViewModel : ObservableObject, IDisposable
|
||||
Settings = settings;
|
||||
Localization = localization;
|
||||
|
||||
// Язык интерфейса — такая же настройка, как остальные, и хранится там же
|
||||
// The interface language is a setting like any other and is stored in the same place
|
||||
Localization.CurrentLanguage = settings.Language;
|
||||
Settings.PropertyChanged += OnSettingsChanged;
|
||||
Localization.PropertyChanged += OnLocalizationChanged;
|
||||
@@ -110,8 +110,8 @@ public sealed partial class SettingsViewModel : ObservableObject, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
// Подписи вариантов приходят из ресурсов, поэтому при смене языка
|
||||
// обновляем только текст — сами элементы списков остаются прежними
|
||||
// The option captions come from the resources, so on a language change we update
|
||||
// only the text — the list items themselves stay the same
|
||||
private void OnLocalizationChanged(object? sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName != Binding.IndexerName)
|
||||
@@ -136,7 +136,7 @@ public sealed partial class SettingsViewModel : ObservableObject, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
// Ключ ресурса собирается из имени типа и значения: PopupPlacementMode_AtCursor
|
||||
// The resource key is built from the type name and the value: PopupPlacementMode_AtCursor
|
||||
private string GetDisplayName<T>(T value) where T : struct, Enum =>
|
||||
Localization[$"{typeof(T).Name}_{value}"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user