CPKreuz 2 rokov pred
rodič
commit
449551d02d
26 zmenil súbory, kde vykonal 169 pridanie a 48 odobranie
  1. 1 0
      src/PixiEditor/Data/Localization/Languages/en.json
  2. 24 23
      src/PixiEditor/Data/Localization/LocalizationData.json
  3. 45 0
      src/PixiEditor/Helpers/LocalizationExtension.cs
  4. 1 1
      src/PixiEditor/Localization/ILocalizationProvider.cs
  5. 22 1
      src/PixiEditor/Localization/Language.cs
  6. 1 0
      src/PixiEditor/Localization/LanguageData.cs
  7. 3 3
      src/PixiEditor/Localization/LocalizationProvider.cs
  8. 15 1
      src/PixiEditor/ViewModels/SubViewModels/Main/DebugViewModel.cs
  9. 3 1
      src/PixiEditor/Views/Dialogs/AboutPopup.xaml
  10. 3 1
      src/PixiEditor/Views/Dialogs/CommandDebugPopup.xaml
  11. 3 1
      src/PixiEditor/Views/Dialogs/ConfirmationPopup.xaml
  12. 3 1
      src/PixiEditor/Views/Dialogs/ExportFilePopup.xaml
  13. 3 1
      src/PixiEditor/Views/Dialogs/HelloTherePopup.xaml
  14. 3 1
      src/PixiEditor/Views/Dialogs/ImportFilePopup.xaml
  15. 3 1
      src/PixiEditor/Views/Dialogs/ImportShortcutTemplatePopup.xaml
  16. 8 3
      src/PixiEditor/Views/Dialogs/LocalizationDebugWindow.xaml
  17. 3 1
      src/PixiEditor/Views/Dialogs/LocalizationDebugWindow.xaml.cs
  18. 3 1
      src/PixiEditor/Views/Dialogs/NewFilePopup.xaml
  19. 3 1
      src/PixiEditor/Views/Dialogs/NoticePopup.xaml
  20. 3 1
      src/PixiEditor/Views/Dialogs/OptionsPopup.xaml
  21. 3 1
      src/PixiEditor/Views/Dialogs/PalettesBrowser.xaml
  22. 2 1
      src/PixiEditor/Views/Dialogs/ResizeCanvasPopup.xaml
  23. 3 1
      src/PixiEditor/Views/Dialogs/ResizeDocumentPopup.xaml
  24. 3 1
      src/PixiEditor/Views/Dialogs/SettingsWindow.xaml
  25. 2 0
      src/PixiEditor/Views/Dialogs/ShortcutPopup.xaml
  26. 3 1
      src/PixiEditor/Views/MainWindow.xaml

+ 1 - 0
src/PixiEditor/Data/Localization/Languages/en.json

@@ -573,6 +573,7 @@
   "DONATE": "Donate",
   
   "OPEN_LOCALIZATION_DEBUG_WINDOW": "Open Localization Debug Window",
+  "FORCE_OTHER_FLOW_DIRECTION": "Force other flow direction",
   "API_KEY": "API Key",
   "LOCALIZATION_VIEW_TYPE": "Localization View Type",
   "LOAD_LANGUAGE_FROM_FILE": "Load language from file",

+ 24 - 23
src/PixiEditor/Data/Localization/LocalizationData.json

@@ -8,27 +8,27 @@
     },
     {
       "name": "Polski",
-        "code": "pl",
-        "localeFileName": "pl.json",
-        "iconFileName": "pl.png"
+      "code": "pl",
+      "localeFileName": "pl.json",
+      "iconFileName": "pl.png"
     },
     {
-        "name": "Deutsch",
-        "code": "de",
-        "localeFileName": "de.json",
-        "iconFileName": "de.png"
+      "name": "Deutsch",
+      "code": "de",
+      "localeFileName": "de.json",
+      "iconFileName": "de.png"
     },
     {
-        "name": "Español",
-        "code": "es",
-        "localeFileName": "es.json",
-        "iconFileName": "es.png"
+      "name": "Español",
+      "code": "es",
+      "localeFileName": "es.json",
+      "iconFileName": "es.png"
     },
     {
-        "name": "Русский",
-        "code": "ru",
-        "localeFileName": "ru.json",
-        "iconFileName": "ru.png"
+      "name": "Русский",
+      "code": "ru",
+      "localeFileName": "ru.json",
+      "iconFileName": "ru.png"
     },
     {
       "name": "Українська",
@@ -37,16 +37,17 @@
       "iconFileName": "ua.png"
     },
     {
-        "name": "عربي",
-        "code": "ar",
-        "localeFileName": "ar.json",
-        "iconFileName": "ar.png"
+      "name": "عربي",
+      "code": "ar",
+      "localeFileName": "ar.json",
+      "iconFileName": "ar.png",
+      "rightToLeft": true
     },
     {
-        "name": "Čeština",
-        "code": "cz",
-        "localeFileName": "cz.json",
-        "iconFileName": "cz.png"
+      "name": "Čeština",
+      "code": "cz",
+      "localeFileName": "cz.json",
+      "iconFileName": "cz.png"
     }
   ]
 }

+ 45 - 0
src/PixiEditor/Helpers/LocalizationExtension.cs

@@ -0,0 +1,45 @@
+using System.Windows;
+using System.Windows.Data;
+using System.Windows.Markup;
+
+namespace PixiEditor.Helpers;
+
+public class LocalizationExtension : MarkupExtension
+{
+    private LocalizationExtensionToProvide toProvide;
+    private static Binding flowDirectionBinding;
+
+    public LocalizationExtension(LocalizationExtensionToProvide toProvide)
+    {
+        
+    }
+    
+    public override object ProvideValue(IServiceProvider serviceProvider)
+    {
+        switch (toProvide)
+        {
+            case LocalizationExtensionToProvide.FlowDirection:
+                return GetFlowDirectionBinding(serviceProvider);
+        }
+
+        throw new NotImplementedException();
+    }
+
+    private object GetFlowDirectionBinding(IServiceProvider serviceProvider)
+    {
+        flowDirectionBinding = new Binding("CurrentLanguage.FlowDirection");
+        flowDirectionBinding.Source = ViewModelMain.Current.LocalizationProvider;
+        flowDirectionBinding.Mode = BindingMode.OneWay;
+
+        var expression = (BindingExpression)flowDirectionBinding.ProvideValue(serviceProvider);
+
+        ViewModelMain.Current.LocalizationProvider.OnLanguageChanged += _ => expression.UpdateTarget();
+
+        return expression;
+    }
+}
+
+public enum LocalizationExtensionToProvide
+{
+    FlowDirection
+}

+ 1 - 1
src/PixiEditor/Localization/ILocalizationProvider.cs

@@ -16,7 +16,7 @@ public interface ILocalizationProvider
     /// </summary>
     public void LoadData();
     public void LoadLanguage(LanguageData languageData);
-    public void LoadDebugKeys(Dictionary<string, string> languageKeys);
+    public void LoadDebugKeys(Dictionary<string, string> languageKeys, bool rightToLeft);
     public void ReloadLanguage();
     public Language DefaultLanguage { get; }
 }

+ 22 - 1
src/PixiEditor/Localization/Language.cs

@@ -1,16 +1,37 @@
 using System.Diagnostics;
+using System.Windows;
 
 namespace PixiEditor.Localization;
 
 [DebuggerDisplay("{LanguageData.Name}, strings: {Locale.Count}")]
 public class Language
 {
+    private FlowDirection flowDirection;
+    
     public LanguageData LanguageData { get; }
     public IReadOnlyDictionary<string, string> Locale { get; }
+
+    public FlowDirection FlowDirection
+    {
+        get
+        {
+            if (ViewModelMain.Current.DebugSubViewModel.ForceOtherFlowDirection)
+            {
+                return flowDirection switch
+                {
+                    FlowDirection.RightToLeft => FlowDirection.LeftToRight,
+                    FlowDirection.LeftToRight => FlowDirection.RightToLeft
+                };
+            }
+
+            return flowDirection;
+        }
+    }
     
-    public Language(LanguageData languageData, Dictionary<string, string> locale)
+    public Language(LanguageData languageData, Dictionary<string, string> locale, bool isRightToLeft)
     {
         LanguageData = languageData;
         Locale = locale;
+        flowDirection = isRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
     }
 }

+ 1 - 0
src/PixiEditor/Localization/LanguageData.cs

@@ -9,6 +9,7 @@ public class LanguageData
     // https://icons8.com/icon/set/flags/color
     public string IconFileName { get; set; }
     public string IconPath => $"pack://application:,,,/PixiEditor;component/Images/LanguageFlags/{IconFileName}";
+    public bool RightToLeft { get; set; }
     
     public override string ToString()
     {

+ 3 - 3
src/PixiEditor/Localization/LocalizationProvider.cs

@@ -76,14 +76,14 @@ internal class LocalizationProvider : ILocalizationProvider
         }
     }
 
-    public void LoadDebugKeys(Dictionary<string, string> languageKeys)
+    public void LoadDebugKeys(Dictionary<string, string> languageKeys, bool rightToLeft)
     {
         debugLanguage = new Language(
             new LanguageData
         {
             Code = "debug",
             Name = "Debug"
-        }, languageKeys);
+        }, languageKeys, rightToLeft);
 
         CurrentLanguage = debugLanguage;
         
@@ -109,6 +109,6 @@ internal class LocalizationProvider : ILocalizationProvider
             throw new InvalidDataException("Locale is null.");
         }
 
-        return new(languageData, locale);
+        return new(languageData, locale, languageData.RightToLeft);
     }
 }

+ 15 - 1
src/PixiEditor/ViewModels/SubViewModels/Main/DebugViewModel.cs

@@ -44,6 +44,20 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
         }
     }
 
+    private bool forceOtherFlowDirection;
+    
+    public bool ForceOtherFlowDirection
+    {
+        get => forceOtherFlowDirection;
+        set
+        {
+            if (SetProperty(ref forceOtherFlowDirection, value))
+            {
+                Owner.LocalizationProvider.ReloadLanguage();
+            }
+        }
+    }
+
     public DebugViewModel(ViewModelMain owner, IPreferences preferences)
         : base(owner)
     {
@@ -177,7 +191,7 @@ internal class DebugViewModel : SubViewModel<ViewModelMain>
         if (file.ShowDialog().GetValueOrDefault())
         {
             Owner.LocalizationProvider.LoadDebugKeys(
-                JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(file.FileName)));
+                JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(file.FileName)), false);
         }
     }
 

+ 3 - 1
src/PixiEditor/Views/Dialogs/AboutPopup.xaml

@@ -9,9 +9,11 @@
         xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML"
         xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
         xmlns:views="clr-namespace:PixiEditor.Views"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d" WindowStyle="None"
         Title="About" WindowStartupLocation="CenterScreen"
-        Height="510" Width="400" Name="aboutPopup" MinWidth="100" MinHeight="100">
+        Height="510" Width="400" Name="aboutPopup" MinWidth="100" MinHeight="100"
+        FlowDirection="{helpers:Localization FlowDirection}">
     <Window.CommandBindings>
         <CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute"
                         Executed="CommandBinding_Executed_Close" />

+ 3 - 1
src/PixiEditor/Views/Dialogs/CommandDebugPopup.xaml

@@ -8,11 +8,13 @@
         xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
         xmlns:command="clr-namespace:PixiEditor.Models.Commands"
         xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         WindowStyle="None"
         mc:Ignorable="d"
         x:Name="uc"
         Foreground="White"
-        Title="Command Debug" Height="450" Width="800">
+        Title="Command Debug" Height="450" Width="800"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <Window.CommandBindings>
         <CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute"

+ 3 - 1
src/PixiEditor/Views/Dialogs/ConfirmationPopup.xaml

@@ -9,10 +9,12 @@
         xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:views="clr-namespace:PixiEditor.Views"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d" d:Title="Unsaved changes"
         Name="popup" WindowStartupLocation="CenterScreen" 
         Height="180" Width="400" MinHeight="180" MinWidth="400"
-        WindowStyle="None">
+        WindowStyle="None"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"

+ 3 - 1
src/PixiEditor/Views/Dialogs/ExportFilePopup.xaml

@@ -9,9 +9,11 @@
         xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d" BorderBrush="Black" BorderThickness="1"
         Title="SaveFilePopup" WindowStyle="None" Height="330" Width="310" MinHeight="330" MinWidth="310"
-        WindowStartupLocation="CenterScreen" Name="saveFilePopup">
+        WindowStartupLocation="CenterScreen" Name="saveFilePopup"
+        FlowDirection="{helpers:Localization FlowDirection}">
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
                       ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />

+ 3 - 1
src/PixiEditor/Views/Dialogs/HelloTherePopup.xaml

@@ -11,10 +11,12 @@
         xmlns:local="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:models="clr-namespace:PixiEditor.Models"
         xmlns:views="clr-namespace:PixiEditor.Views"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d" ShowInTaskbar="False"
         Title="Hello there!" Height="662" Width="632" MinHeight="500" MinWidth="500"
         d:DataContext="{d:DesignInstance local:HelloTherePopup}"
-        WindowStyle="None" WindowStartupLocation="CenterScreen">
+        WindowStyle="None" WindowStartupLocation="CenterScreen"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <Window.Resources>
         <Style TargetType="TextBlock">

+ 3 - 1
src/PixiEditor/Views/Dialogs/ImportFilePopup.xaml

@@ -10,13 +10,15 @@
         xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours" 
         xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
         xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d" BorderBrush="Black" BorderThickness="1"
         Title="ImportFilePopup" ShowInTaskbar="False" 
         MinHeight="250" MinWidth="300" Height="250" Width="300" 
         WindowStyle="None" 
         WindowStartupLocation="CenterScreen" 
         Name="importFilePopup"
-        DataContext="{DynamicResource ImportFilePopupViewModel}">
+        DataContext="{DynamicResource ImportFilePopupViewModel}"
+        FlowDirection="{helpers:Localization FlowDirection}">
     <Window.Resources>
         <vm:ImportFilePopupViewModel x:Key="ImportFilePopupViewModel" />
     </Window.Resources>

+ 3 - 1
src/PixiEditor/Views/Dialogs/ImportShortcutTemplatePopup.xaml

@@ -7,13 +7,15 @@
         xmlns:diag="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:xaml="clr-namespace:PixiEditor.Models.Commands.XAML"
         xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d"
         Title="Import from template" Foreground="White"
         WindowStartupLocation="CenterOwner"
         MinWidth="580"
         SizeToContent="WidthAndHeight" WindowStyle="None"
         Background="{StaticResource AccentColor}"
-        x:Name="window">
+        x:Name="window"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <Window.CommandBindings>
         <CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute"

+ 8 - 3
src/PixiEditor/Views/Dialogs/LocalizationDebugWindow.xaml

@@ -15,8 +15,9 @@
         mc:Ignorable="d"
         Foreground="White"
         Title="LocalizationDebugWindow" 
-        MinHeight="210" MinWidth="480"
-        Height="240" Width="500">
+        MinHeight="240" MinWidth="480"
+        Height="250" Width="500"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
@@ -42,10 +43,14 @@
 
         <StackPanel Grid.Row="1" Margin="5">
             <StackPanel Orientation="Horizontal" Height="25">
-                <TextBlock views:Translator.Key="LOCALIZATION_VIEW_TYPE" Margin="0,0,5,0"></TextBlock>
+                <TextBlock views:Translator.Key="LOCALIZATION_VIEW_TYPE" Margin="0,0,5,0" MinWidth="160"/>
                 <ComboBox SelectedItem="{Binding DataContext.DebugViewModel.LocalizationKeyShowMode, ElementName=popup}"
                           ItemsSource="{helpers:Enum {x:Type enums:LocalizationKeyShowMode}}"/>
             </StackPanel>
+            <StackPanel Orientation="Horizontal" Height="25" Margin="0,5,0,0">
+                <TextBlock views:Translator.Key="FORCE_OTHER_FLOW_DIRECTION" Margin="0,0,5,0" MinWidth="160"/>
+                <CheckBox IsChecked="{Binding DataContext.DebugViewModel.ForceOtherFlowDirection, ElementName=popup}" />
+            </StackPanel>
             <Button views:Translator.Key="LOAD_LANGUAGE_FROM_FILE" Command="{xaml:Command PixiEditor.Debug.SetLanguageFromFilePicker}"
                     Style="{StaticResource DarkRoundButton}" Margin="0,5,0,0"/>
             <TextBlock Text="POEditor" FontWeight="Bold" FontSize="22" Margin="0,10,0,0"/>

+ 3 - 1
src/PixiEditor/Views/Dialogs/LocalizationDebugWindow.xaml.cs

@@ -147,7 +147,7 @@ public partial class LocalizationDebugWindow : Window
                     window.Dispatcher.Invoke(() =>
                     {
                         StatusMessage = result.Message;
-                        DebugViewModel.Owner.LocalizationProvider.LoadDebugKeys(result.Output);
+                        DebugViewModel.Owner.LocalizationProvider.LoadDebugKeys(result.Output, IsRightToLeft(SelectedLanguage));
                     });
                 }
                 catch (Exception e)
@@ -161,6 +161,8 @@ public partial class LocalizationDebugWindow : Window
             });
         }
 
+        private static bool IsRightToLeft(string language) => language is "ar" or "he" or "ku" or "fa" or "ur";
+
         private static async Task<Result<string[]>>
             CheckProjectByIdAsync(string key)
         {

+ 3 - 1
src/PixiEditor/Views/Dialogs/NewFilePopup.xaml

@@ -9,6 +9,7 @@
         xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d"
         ShowInTaskbar="False"
         DataContext="{DynamicResource NewFileMenuViewModel}" 
@@ -16,7 +17,8 @@
         WindowStartupLocation="CenterScreen" 
         MinHeight="250" MinWidth="300" Height="250" Width="300" 
         Name="newFilePopup" 
-        BorderBrush="Black" BorderThickness="1">
+        BorderBrush="Black" BorderThickness="1"
+        FlowDirection="{helpers:Localization FlowDirection}">
     <Window.Resources>
         <vm:NewFileMenuViewModel x:Key="NewFileMenuViewModel" />
     </Window.Resources>

+ 3 - 1
src/PixiEditor/Views/Dialogs/NoticePopup.xaml

@@ -9,10 +9,12 @@
         xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:views="clr-namespace:PixiEditor.Views"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d" WindowStyle="None"
         d:Title="Notice" Height="180" Width="400" MinHeight="180" MinWidth="400"
         WindowStartupLocation="CenterScreen"
-        x:Name="popup">
+        x:Name="popup"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"

+ 3 - 1
src/PixiEditor/Views/Dialogs/OptionsPopup.xaml

@@ -6,11 +6,13 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:uc="clr-namespace:PixiEditor.Views.UserControls"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d"
         WindowStartupLocation="CenterScreen"
         SizeToContent="WidthAndHeight"
         x:Name="popup"
-        Background="{StaticResource AccentColor}" Foreground="White">
+        Background="{StaticResource AccentColor}" Foreground="White"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"

+ 3 - 1
src/PixiEditor/Views/Dialogs/PalettesBrowser.xaml

@@ -12,13 +12,15 @@
     xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
     xmlns:PixiEditor="clr-namespace:PixiEditor"
     xmlns:dialogs="clr-namespace:PixiEditor.Views.Dialogs"
+    xmlns:helpers="clr-namespace:PixiEditor.Helpers"
     x:Class="PixiEditor.Views.Dialogs.PalettesBrowser"
     mc:Ignorable="d"
     WindowStartupLocation="CenterScreen" 
     MinWidth="200" 
     Height="600" Width="850" 
     WindowStyle="None"
-    x:Name="palettesBrowser">
+    x:Name="palettesBrowser"
+    FlowDirection="{helpers:Localization FlowDirection}">
     <Window.Resources>
         <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
     </Window.Resources>

+ 2 - 1
src/PixiEditor/Views/Dialogs/ResizeCanvasPopup.xaml

@@ -10,12 +10,13 @@
         xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
         xmlns:base="clr-namespace:PixiEditor.Views"
         xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d" 
         x:Name="window"
         Title="ResizeCanvasPopup" ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
         Height="420" Width="320" MinHeight="420" MinWidth="320" 
         WindowStyle="None"
-        >
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"

+ 3 - 1
src/PixiEditor/Views/Dialogs/ResizeDocumentPopup.xaml

@@ -13,7 +13,9 @@
         Height="305" Width="310" MinHeight="305" MinWidth="310"
         xmlns:base="clr-namespace:PixiEditor.Views"
         xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
-        WindowStyle="None">
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
+        WindowStyle="None"
+        FlowDirection="{helpers:Localization FlowDirection}">
 
     <WindowChrome.WindowChrome>
         <WindowChrome CaptionHeight="32" GlassFrameThickness="0.1"

+ 3 - 1
src/PixiEditor/Views/Dialogs/SettingsWindow.xaml

@@ -17,6 +17,7 @@
         xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML"
         xmlns:settingGroups="clr-namespace:PixiEditor.Views.Dialogs.SettingGroups"
         xmlns:localization="clr-namespace:PixiEditor.Localization"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d"
         Title="Settings" Name="window" 
         Height="688" Width="780"
@@ -24,7 +25,8 @@
         WindowStyle="None" DataContext="{DynamicResource SettingsWindowViewModel}"
         WindowStartupLocation="CenterScreen"
         BorderBrush="Black" BorderThickness="1"
-        Background="{StaticResource AccentColor}">
+        Background="{StaticResource AccentColor}"
+        FlowDirection="{helpers:Localization FlowDirection}">
     <Window.Resources>
         <viewmodels:SettingsWindowViewModel x:Key="SettingsWindowViewModel"/>
         <BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>

+ 2 - 0
src/PixiEditor/Views/Dialogs/ShortcutPopup.xaml

@@ -12,12 +12,14 @@
         xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML"
         xmlns:commands1="clr-namespace:PixiEditor.Models.Commands.Commands"
         xmlns:views="clr-namespace:PixiEditor.Views"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d"
         WindowStartupLocation="CenterScreen"
         SizeToContent="Height"
         Title="ShortcutPopup" WindowStyle="None"
         MinHeight="780" MinWidth="620" Topmost="{Binding IsTopmost}"
         Width="950" MaxHeight="1000"
+        FlowDirection="{helpers:Localization FlowDirection}"
         KeyDown="ShortcutPopup_OnKeyDown">
     <Window.Resources>
         <BoolToVisibilityConverter x:Key="BoolToVisibility"/>

+ 3 - 1
src/PixiEditor/Views/MainWindow.xaml

@@ -27,6 +27,7 @@
     xmlns:palettes="clr-namespace:PixiEditor.Views.UserControls.Palettes"
     xmlns:views="clr-namespace:PixiEditor.Views"
     xmlns:system="clr-namespace:System;assembly=System.Runtime"
+    xmlns:helpers="clr-namespace:PixiEditor.Helpers"
     KeyDown="MainWindow_OnKeyDown"
     d:DataContext="{d:DesignInstance Type=vm:ViewModelMain}"
     mc:Ignorable="d"
@@ -38,7 +39,8 @@
     Width="1600"
     Background="{StaticResource MainColor}"
     WindowStartupLocation="CenterScreen"
-    WindowState="Maximized">
+    WindowState="Maximized"
+    FlowDirection="{helpers:Localization FlowDirection}">
     <WindowChrome.WindowChrome>
         <WindowChrome
             CaptionHeight="35"