fixed comment into code

This commit is contained in:
2026-08-09 20:02:23 +05:00
parent 778fc1034b
commit 7e4e569d53
34 changed files with 332 additions and 306 deletions
@@ -4,8 +4,8 @@ using CursorLang.Models;
namespace CursorLang.ViewModels;
/// <summary>
/// Содержимое подсказки у курсора. Внешний вид берётся прямо из настроек,
/// поэтому их правка применяется без перезапуска.
/// The content of the popup at the cursor. The look is taken straight from the
/// settings, so editing them applies without a restart.
/// </summary>
public sealed partial class LayoutPopupViewModel : ObservableObject
{
+10 -10
View File
@@ -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}"];
}