summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Model/InterfaceLanguage.cs8
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml.cs21
2 files changed, 25 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Model/InterfaceLanguage.cs b/win/CS/HandBrakeWPF/Model/InterfaceLanguage.cs
index 3a10b8811..7ec4c39d3 100644
--- a/win/CS/HandBrakeWPF/Model/InterfaceLanguage.cs
+++ b/win/CS/HandBrakeWPF/Model/InterfaceLanguage.cs
@@ -11,18 +11,18 @@ namespace HandBrakeWPF.Model
{
public class InterfaceLanguage
{
- public InterfaceLanguage()
- {
- }
+
- public InterfaceLanguage(string culture, string name)
+ public InterfaceLanguage(string culture, string name, bool rtl = false)
{
this.Culture = culture;
this.Name = name;
+ this.RightToLeft = rtl;
}
public string Culture { get; set; }
public string Name { get; set; }
+ public bool RightToLeft { get; set; }
protected bool Equals(InterfaceLanguage other)
{
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
index 8b6b5b30e..4e7266f8b 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
@@ -12,7 +12,9 @@ namespace HandBrakeWPF.Views
using System;
using System.ComponentModel;
using System.Drawing;
+ using System.Globalization;
using System.IO;
+ using System.Threading;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
@@ -21,12 +23,14 @@ namespace HandBrakeWPF.Views
using Caliburn.Micro;
using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Utilities;
using HandBrakeWPF.ViewModels.Interfaces;
using Application = System.Windows.Application;
using Execute = Caliburn.Micro.Execute;
+ using FlowDirection = System.Windows.FlowDirection;
/// <summary>
/// Interaction logic for ShellView.xaml
@@ -94,6 +98,23 @@ namespace HandBrakeWPF.Views
{
this.TaskbarItemInfo = Win7.WindowsTaskbar;
}
+
+ // Setup the UI Language
+ string culture = userSettingService.GetUserSetting<string>(UserSettingConstants.UiLanguage);
+ if (!string.IsNullOrEmpty(culture))
+ {
+ InterfaceLanguage language = InterfaceLanguageUtilities.FindInterfaceLanguage(culture);
+ if (language != null)
+ {
+ if (language.RightToLeft)
+ {
+ if (Application.Current.MainWindow != null)
+ {
+ Application.Current.MainWindow.FlowDirection = FlowDirection.RightToLeft;
+ }
+ }
+ }
+ }
}
/// <summary>