- Fix String and adjust messages

- Adjust Margin
- Cleanup comment
This commit is contained in:
DB p 2025-04-10 00:52:34 +09:00
parent 3c49d8e730
commit d9a353b452
3 changed files with 96 additions and 96 deletions

View file

@ -118,18 +118,17 @@
<system:String x:Key="SearchDelayTimeVeryShort">Very short</system:String>
<system:String x:Key="KoreanImeTitle">Information for Korean IME user</system:String>
<system:String x:Key="KoreanImeGuide">
You're using the Korean language! The Korean input method used in Windows 11 may cause some issues in Flow Launcher.&#x0a;
If you experience any problems, you may need to enable compatibility mode for the Korean IME.&#x0a;&#x0a;
The Korean input method used in Windows 11 may cause some issues in Flow Launcher.&#x0a;
If you experience any problems, you may need to enable "Use previous version of Korean IME".&#x0a;&#x0a;
Open Setting in Windows 11 and go to:&#x0a;
Time &amp; Language &gt; Language &amp; Region &gt; Korean &gt; Language Options &gt; Keyboard - Microsoft IME &gt; Compatibility,&#x0a;
and enable "Use previous version of Microsoft IME".&#x0a;&#x0a;
You can open the relevant menu using the option below, or change the setting directly without manually opening the settings page.
</system:String>
<system:String x:Key="KoreanImeOpenLink">Open Language and Region System Settings</system:String>
<system:String x:Key="KoreanImeOpenLinkToolTIp">Opens the Korean IME setting locationKorean &gt; Language Options &gt; Keyboard - Microsoft IME &gt; Compatibility</system:String>
<system:String x:Key="KoreanImeOpenLinkToolTip">Opens the Korean IME setting location. Go to Korean &gt; Language Options &gt; Keyboard - Microsoft IME &gt; Compatibility</system:String>
<system:String x:Key="KoreanImeOpenLinkButton">Open</system:String>
<system:String x:Key="KoreanImeRegistry">Use Legacy Korean IME</system:String>
<system:String x:Key="KoreanImeRegistryTooltip">You can change the IME settings directly from here without opening a separate settings window</system:String>
<system:String x:Key="KoreanImeRegistry">Use Previous Korean IME</system:String>
<system:String x:Key="KoreanImeRegistryTooltip">You can change the Previous Korean IME settings directly from here</system:String>
<!-- Setting Plugin -->
<system:String x:Key="searchplugin">Search Plugin</system:String>

View file

@ -189,128 +189,129 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
}
}
public bool LegacyKoreanIMEEnabled
{
get => IsLegacyKoreanIMEEnabled();
set
{
get => IsLegacyKoreanIMEEnabled();
set
Debug.WriteLine($"[DEBUG] LegacyKoreanIMEEnabled changed: {value}");
if (SetLegacyKoreanIMEEnabled(value))
{
Debug.WriteLine($"[DEBUG] LegacyKoreanIMEEnabled 변경: {value}");
if (SetLegacyKoreanIMEEnabled(value))
{
OnPropertyChanged(nameof(LegacyKoreanIMEEnabled));
OnPropertyChanged(nameof(KoreanIMERegistryValueIsZero));
}
else
{
Debug.WriteLine("[DEBUG] LegacyKoreanIMEEnabled 설정 실패");
}
OnPropertyChanged(nameof(LegacyKoreanIMEEnabled));
OnPropertyChanged(nameof(KoreanIMERegistryValueIsZero));
}
else
{
Debug.WriteLine("[DEBUG] Failed to set LegacyKoreanIMEEnabled");
}
}
}
public bool KoreanIMERegistryKeyExists => IsKoreanIMEExist();
public bool KoreanIMERegistryKeyExists => IsKoreanIMEExist();
public bool KoreanIMERegistryValueIsZero
{
get
{
object value = GetLegacyKoreanIMERegistryValue();
if (value is int intValue)
{
return intValue == 0;
}
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
{
return parsedValue == 0;
}
return false;
}
}
bool IsKoreanIMEExist()
{
return GetLegacyKoreanIMERegistryValue() != null;
}
bool IsLegacyKoreanIMEEnabled()
public bool KoreanIMERegistryValueIsZero
{
get
{
object value = GetLegacyKoreanIMERegistryValue();
if (value is int intValue)
{
return intValue == 1;
return intValue == 0;
}
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
{
return parsedValue == 1;
return parsedValue == 0;
}
return false;
}
}
bool SetLegacyKoreanIMEEnabled(bool enable)
bool IsKoreanIMEExist()
{
return GetLegacyKoreanIMERegistryValue() != null;
}
bool IsLegacyKoreanIMEEnabled()
{
object value = GetLegacyKoreanIMERegistryValue();
if (value is int intValue)
{
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
const string valueName = "NoTsf3Override5";
return intValue == 1;
}
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
{
return parsedValue == 1;
}
try
return false;
}
bool SetLegacyKoreanIMEEnabled(bool enable)
{
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
const string valueName = "NoTsf3Override5";
try
{
using (RegistryKey key = Registry.CurrentUser.CreateSubKey(subKeyPath))
{
using (RegistryKey key = Registry.CurrentUser.CreateSubKey(subKeyPath))
if (key != null)
{
if (key != null)
{
int value = enable ? 1 : 0;
key.SetValue(valueName, value, RegistryValueKind.DWord);
return true;
}
else
{
Debug.WriteLine($"[IME DEBUG] 레지스트리 키 생성 또는 열기 실패: {subKeyPath}");
}
int value = enable ? 1 : 0;
key.SetValue(valueName, value, RegistryValueKind.DWord);
return true;
}
else
{
Debug.WriteLine($"[IME DEBUG] Failed to create or open registry key: {subKeyPath}");
}
}
catch (Exception ex)
{
Debug.WriteLine($"[IME DEBUG] 레지스트리 설정 중 예외 발생: {ex.Message}");
}
return false;
}
catch (Exception ex)
{
Debug.WriteLine($"[IME DEBUG] Exception occurred while setting registry: {ex.Message}");
}
private object GetLegacyKoreanIMERegistryValue()
{
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
const string valueName = "NoTsf3Override5";
return false;
}
try
private object GetLegacyKoreanIMERegistryValue()
{
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
const string valueName = "NoTsf3Override5";
try
{
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(subKeyPath))
{
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(subKeyPath))
if (key != null)
{
if (key != null)
{
return key.GetValue(valueName);
}
return key.GetValue(valueName);
}
}
catch (Exception ex)
{
Debug.WriteLine($"[IME DEBUG] 예외 발생: {ex.Message}");
}
return null;
}
private void OpenImeSettings()
catch (Exception ex)
{
try
{
Process.Start(new ProcessStartInfo("ms-settings:regionlanguage") { UseShellExecute = true });
}
catch (Exception e)
{
Debug.WriteLine($"Error opening IME settings: {e.Message}");
}
Debug.WriteLine($"[IME DEBUG] Exception occurred: {ex.Message}");
}
return null;
}
private void OpenImeSettings()
{
try
{
Process.Start(new ProcessStartInfo("ms-settings:regionlanguage") { UseShellExecute = true });
}
catch (Exception e)
{
Debug.WriteLine($"Error opening IME settings: {e.Message}");
}
}
public bool ShouldUsePinyin
{
get => Settings.ShouldUsePinyin;

View file

@ -320,7 +320,7 @@
<Border Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
<cc:InfoBar
Title="{DynamicResource KoreanImeTitle}"
Margin="0 12 0 0"
Margin="0 14 0 0"
Closable="False"
DataContext="{Binding RelativeSource={RelativeSource AncestorType=Border}, Path=DataContext}"
IsIconVisible="True"
@ -329,7 +329,7 @@
Type="Warning"
Visibility="{Binding LegacyKoreanIMEEnabled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Inverted, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
</Border>
<cc:CardGroup Margin="0 4 0 0" Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
<cc:CardGroup Margin="0 14 0 0" Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
<cc:Card
Title="{DynamicResource KoreanImeRegistry}"
Icon="&#xe88b;"
@ -342,7 +342,7 @@
<cc:Card
Title="{DynamicResource KoreanImeOpenLink}"
Icon="&#xf7b9;"
Sub="{DynamicResource KoreanImeOpenLinkTooltip}">
Sub="{DynamicResource KoreanImeOpenLinkToolTip}">
<Button Command="{Binding OpenImeSettingsCommand}" Content="{DynamicResource KoreanImeOpenLinkButton}" />
</cc:Card>
</cc:CardGroup>