What steps are required to localise a WPF application so that right to left languages are displayed correctly?
views:
214answers:
2
A:
I have tried setting the FlowDirection attribute and changing the culture but the GUI does not seem to flip.
Thomas Bratt
2009-09-07 09:47:12
A:
I realize its an old question but I am stuck with this as well so am adding what I've done (which works partially) in the hope that someone will add more to it
In your app.cs you can do something like this
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
FrameworkElement.LanguageProperty.OverrideMetadata(
typeof(FrameworkElement),
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
FrameworkElement.FlowDirectionProperty.OverrideMetadata(
typeof(FrameworkElement),
new FrameworkPropertyMetadata(CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft
? FlowDirection.RightToLeft : FlowDirection.LeftToRight));
}
Now this flips everything all right but it also happens to flip all images which is not what you really want.
NVM
2010-06-18 19:32:44