[PTRun]Fix CultureNotFoundException Handling (#35256)

This commit is contained in:
gokcekantarci 2024-10-11 17:51:22 +03:00 committed by GitHub
parent 236d11a67b
commit 3a228cc46e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)