mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-24 04:12:32 +08:00
[PTRun]Fix CultureNotFoundException Handling (#35256)
This commit is contained in:
parent
236d11a67b
commit
3a228cc46e
@ -1197,9 +1197,17 @@ namespace PowerLauncher.ViewModel
|
|||||||
|
|
||||||
public static FlowDirection GetLanguageFlowDirection()
|
public static FlowDirection GetLanguageFlowDirection()
|
||||||
{
|
{
|
||||||
bool isCurrentLanguageRightToLeft = System.Windows.Input.InputLanguageManager.Current.CurrentInputLanguage.TextInfo.IsRightToLeft;
|
try
|
||||||
|
{
|
||||||
|
bool isCurrentLanguageRightToLeft = System.Windows.Input.InputLanguageManager.Current.CurrentInputLanguage.TextInfo.IsRightToLeft;
|
||||||
|
|
||||||
return isCurrentLanguageRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
|
return isCurrentLanguageRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
|
||||||
|
}
|
||||||
|
catch (CultureNotFoundException ex)
|
||||||
|
{
|
||||||
|
Log.Exception($"CultureNotFoundException: {ex.Message}", ex, MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
return FlowDirection.LeftToRight; // default FlowDirection.LeftToRight
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Dispose(bool disposing)
|
protected virtual void Dispose(bool disposing)
|
||||||
|
Loading…
Reference in New Issue
Block a user