From 6ad73eddea26f63dcf4ea874c90891afb7744df1 Mon Sep 17 00:00:00 2001 From: ema Date: Fri, 27 Jun 2025 03:33:35 +0800 Subject: [PATCH] Add option `IsSupportRTL` to control the RTL #1612 --- .../QuickLook.Plugin.TextViewer/TextViewerPanel.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/TextViewerPanel.cs b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/TextViewerPanel.cs index e18ef59..5a449f9 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/TextViewerPanel.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/TextViewerPanel.cs @@ -208,9 +208,15 @@ public partial class TextViewerPanel : TextEditor, IDisposable if (extension.Equals(".txt", StringComparison.OrdinalIgnoreCase)) { - FlowDirection = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft - ? System.Windows.FlowDirection.RightToLeft - : System.Windows.FlowDirection.LeftToRight; + if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft) + { + string isSupportRTL = TranslationHelper.Get("IsSupportRTL", + failsafe: bool.TrueString, + domain: Assembly.GetExecutingAssembly().GetName().Name); + + if (bool.TrueString.Equals(isSupportRTL, StringComparison.OrdinalIgnoreCase)) + FlowDirection = System.Windows.FlowDirection.RightToLeft; + } } context.IsBusy = false;