Skip to content

Commit d9a353b

Browse files
committed
- Fix String and adjust messages
- Adjust Margin - Cleanup comment
1 parent 3c49d8e commit d9a353b

File tree

3 files changed

+93
-93
lines changed

3 files changed

+93
-93
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,17 @@
118118
<system:String x:Key="SearchDelayTimeVeryShort">Very short</system:String>
119119
<system:String x:Key="KoreanImeTitle">Information for Korean IME user</system:String>
120120
<system:String x:Key="KoreanImeGuide">
121-
You're using the Korean language! The Korean input method used in Windows 11 may cause some issues in Flow Launcher.&#x0a;
122-
If you experience any problems, you may need to enable compatibility mode for the Korean IME.&#x0a;&#x0a;
121+
The Korean input method used in Windows 11 may cause some issues in Flow Launcher.&#x0a;
122+
If you experience any problems, you may need to enable "Use previous version of Korean IME".&#x0a;&#x0a;
123123
Open Setting in Windows 11 and go to:&#x0a;
124124
Time &amp; Language &gt; Language &amp; Region &gt; Korean &gt; Language Options &gt; Keyboard - Microsoft IME &gt; Compatibility,&#x0a;
125125
and enable "Use previous version of Microsoft IME".&#x0a;&#x0a;
126-
You can open the relevant menu using the option below, or change the setting directly without manually opening the settings page.
127126
</system:String>
128127
<system:String x:Key="KoreanImeOpenLink">Open Language and Region System Settings</system:String>
129-
<system:String x:Key="KoreanImeOpenLinkToolTIp">Opens the Korean IME setting locationKorean &gt; Language Options &gt; Keyboard - Microsoft IME &gt; Compatibility</system:String>
128+
<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>
130129
<system:String x:Key="KoreanImeOpenLinkButton">Open</system:String>
131-
<system:String x:Key="KoreanImeRegistry">Use Legacy Korean IME</system:String>
132-
<system:String x:Key="KoreanImeRegistryTooltip">You can change the IME settings directly from here without opening a separate settings window</system:String>
130+
<system:String x:Key="KoreanImeRegistry">Use Previous Korean IME</system:String>
131+
<system:String x:Key="KoreanImeRegistryTooltip">You can change the Previous Korean IME settings directly from here</system:String>
133132

134133
<!-- Setting Plugin -->
135134
<system:String x:Key="searchplugin">Search Plugin</system:String>

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 85 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -189,127 +189,128 @@ public string Language
189189
}
190190
}
191191
public bool LegacyKoreanIMEEnabled
192+
{
193+
get => IsLegacyKoreanIMEEnabled();
194+
set
192195
{
193-
get => IsLegacyKoreanIMEEnabled();
194-
set
196+
Debug.WriteLine($"[DEBUG] LegacyKoreanIMEEnabled changed: {value}");
197+
if (SetLegacyKoreanIMEEnabled(value))
195198
{
196-
Debug.WriteLine($"[DEBUG] LegacyKoreanIMEEnabled 변경: {value}");
197-
if (SetLegacyKoreanIMEEnabled(value))
198-
{
199-
OnPropertyChanged(nameof(LegacyKoreanIMEEnabled));
200-
OnPropertyChanged(nameof(KoreanIMERegistryValueIsZero));
201-
}
202-
else
203-
{
204-
Debug.WriteLine("[DEBUG] LegacyKoreanIMEEnabled 설정 실패");
205-
}
199+
OnPropertyChanged(nameof(LegacyKoreanIMEEnabled));
200+
OnPropertyChanged(nameof(KoreanIMERegistryValueIsZero));
206201
}
207-
}
208-
209-
public bool KoreanIMERegistryKeyExists => IsKoreanIMEExist();
210-
211-
public bool KoreanIMERegistryValueIsZero
212-
{
213-
get
202+
else
214203
{
215-
object value = GetLegacyKoreanIMERegistryValue();
216-
if (value is int intValue)
217-
{
218-
return intValue == 0;
219-
}
220-
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
221-
{
222-
return parsedValue == 0;
223-
}
224-
225-
return false;
204+
Debug.WriteLine("[DEBUG] Failed to set LegacyKoreanIMEEnabled");
226205
}
227206
}
207+
}
228208

229-
bool IsKoreanIMEExist()
230-
{
231-
return GetLegacyKoreanIMERegistryValue() != null;
232-
}
209+
public bool KoreanIMERegistryKeyExists => IsKoreanIMEExist();
233210

234-
bool IsLegacyKoreanIMEEnabled()
211+
public bool KoreanIMERegistryValueIsZero
212+
{
213+
get
235214
{
236215
object value = GetLegacyKoreanIMERegistryValue();
237-
238216
if (value is int intValue)
239217
{
240-
return intValue == 1;
218+
return intValue == 0;
241219
}
242220
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
243221
{
244-
return parsedValue == 1;
222+
return parsedValue == 0;
245223
}
246224

247225
return false;
248226
}
227+
}
228+
229+
bool IsKoreanIMEExist()
230+
{
231+
return GetLegacyKoreanIMERegistryValue() != null;
232+
}
233+
234+
bool IsLegacyKoreanIMEEnabled()
235+
{
236+
object value = GetLegacyKoreanIMERegistryValue();
249237

250-
bool SetLegacyKoreanIMEEnabled(bool enable)
238+
if (value is int intValue)
251239
{
252-
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
253-
const string valueName = "NoTsf3Override5";
240+
return intValue == 1;
241+
}
242+
else if (value != null && int.TryParse(value.ToString(), out int parsedValue))
243+
{
244+
return parsedValue == 1;
245+
}
246+
247+
return false;
248+
}
254249

255-
try
250+
bool SetLegacyKoreanIMEEnabled(bool enable)
251+
{
252+
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
253+
const string valueName = "NoTsf3Override5";
254+
255+
try
256+
{
257+
using (RegistryKey key = Registry.CurrentUser.CreateSubKey(subKeyPath))
256258
{
257-
using (RegistryKey key = Registry.CurrentUser.CreateSubKey(subKeyPath))
259+
if (key != null)
258260
{
259-
if (key != null)
260-
{
261-
int value = enable ? 1 : 0;
262-
key.SetValue(valueName, value, RegistryValueKind.DWord);
263-
return true;
264-
}
265-
else
266-
{
267-
Debug.WriteLine($"[IME DEBUG] 레지스트리 키 생성 또는 열기 실패: {subKeyPath}");
268-
}
261+
int value = enable ? 1 : 0;
262+
key.SetValue(valueName, value, RegistryValueKind.DWord);
263+
return true;
264+
}
265+
else
266+
{
267+
Debug.WriteLine($"[IME DEBUG] Failed to create or open registry key: {subKeyPath}");
269268
}
270269
}
271-
catch (Exception ex)
272-
{
273-
Debug.WriteLine($"[IME DEBUG] 레지스트리 설정 중 예외 발생: {ex.Message}");
274-
}
275-
276-
return false;
277270
}
278-
279-
private object GetLegacyKoreanIMERegistryValue()
271+
catch (Exception ex)
280272
{
281-
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
282-
const string valueName = "NoTsf3Override5";
273+
Debug.WriteLine($"[IME DEBUG] Exception occurred while setting registry: {ex.Message}");
274+
}
283275

284-
try
276+
return false;
277+
}
278+
279+
private object GetLegacyKoreanIMERegistryValue()
280+
{
281+
const string subKeyPath = @"Software\Microsoft\input\tsf\tsf3override\{A028AE76-01B1-46C2-99C4-ACD9858AE02F}";
282+
const string valueName = "NoTsf3Override5";
283+
284+
try
285+
{
286+
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(subKeyPath))
285287
{
286-
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(subKeyPath))
288+
if (key != null)
287289
{
288-
if (key != null)
289-
{
290-
return key.GetValue(valueName);
291-
}
290+
return key.GetValue(valueName);
292291
}
293292
}
294-
catch (Exception ex)
295-
{
296-
Debug.WriteLine($"[IME DEBUG] 예외 발생: {ex.Message}");
297-
}
298-
299-
return null;
300293
}
294+
catch (Exception ex)
295+
{
296+
Debug.WriteLine($"[IME DEBUG] Exception occurred: {ex.Message}");
297+
}
298+
299+
return null;
300+
}
301301

302-
private void OpenImeSettings()
302+
private void OpenImeSettings()
303+
{
304+
try
303305
{
304-
try
305-
{
306-
Process.Start(new ProcessStartInfo("ms-settings:regionlanguage") { UseShellExecute = true });
307-
}
308-
catch (Exception e)
309-
{
310-
Debug.WriteLine($"Error opening IME settings: {e.Message}");
311-
}
306+
Process.Start(new ProcessStartInfo("ms-settings:regionlanguage") { UseShellExecute = true });
312307
}
308+
catch (Exception e)
309+
{
310+
Debug.WriteLine($"Error opening IME settings: {e.Message}");
311+
}
312+
}
313+
313314

314315
public bool ShouldUsePinyin
315316
{

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@
320320
<Border Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
321321
<cc:InfoBar
322322
Title="{DynamicResource KoreanImeTitle}"
323-
Margin="0 12 0 0"
323+
Margin="0 14 0 0"
324324
Closable="False"
325325
DataContext="{Binding RelativeSource={RelativeSource AncestorType=Border}, Path=DataContext}"
326326
IsIconVisible="True"
@@ -329,7 +329,7 @@
329329
Type="Warning"
330330
Visibility="{Binding LegacyKoreanIMEEnabled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Inverted, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
331331
</Border>
332-
<cc:CardGroup Margin="0 4 0 0" Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
332+
<cc:CardGroup Margin="0 14 0 0" Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
333333
<cc:Card
334334
Title="{DynamicResource KoreanImeRegistry}"
335335
Icon="&#xe88b;"
@@ -342,7 +342,7 @@
342342
<cc:Card
343343
Title="{DynamicResource KoreanImeOpenLink}"
344344
Icon="&#xf7b9;"
345-
Sub="{DynamicResource KoreanImeOpenLinkTooltip}">
345+
Sub="{DynamicResource KoreanImeOpenLinkToolTip}">
346346
<Button Command="{Binding OpenImeSettingsCommand}" Content="{DynamicResource KoreanImeOpenLinkButton}" />
347347
</cc:Card>
348348
</cc:CardGroup>

0 commit comments

Comments
 (0)