use english menu items on german pc

Feb 16, 2011 at 9:31 AM

On my german pc the menu items of the dockable content appears localized to german. I'd like to create an english language only application that shows english labels independend of the current localization of the target device.

By the way, the ApplicationCommand.New etc. are also localized to german. How do I get rid of the german localization?

Thanks in advance for your help...

Sep 10, 2012 at 10:30 AM

Hello,

I work with the lasted version and I search for the language French.

Have you solution for the translation menu ???

Thanks in advance for you help.

Sep 27, 2012 at 12:11 PM
Edited Sep 27, 2012 at 12:23 PM

Hi romuald,

First of all, you have to put this XAML Code in a RessourceDictionnary :

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:avalonDock="clr-namespace:AvalonDock;assembly=AvalonDock">
<!--Menu contextuel des onglets de l'avalonDock-->
	<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type avalonDock:DockingManager}, ResourceId={x:Static avalonDock:ContextMenuElement.DocumentPane}}">
		<MenuItem Header="Fermer"
                      Command="avalonDock:DocumentPaneCommands.CloseThis" />
		<MenuItem Header="Fermer tout sauf cet élément"
							Command="{Binding Path=DataContext.FermerCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>

		<Separator />
		<MenuItem  Header="Nouveau groupe d'onglets horizontal" 
							 Command="avalonDock:DocumentPaneCommands.NewHorizontalTabGroup">
			<MenuItem.Icon>
				<avalonDock:ImageEx Source="/AvalonDock;component/resources/Images/HTabGroup.png" Width="13" Height="14"/>
			</MenuItem.Icon>
		</MenuItem>
		<MenuItem Header="Nouveau groupe d'onglets vertical"
            Command="avalonDock:DocumentPaneCommands.NewVerticalTabGroup">
			<MenuItem.Icon>
				<avalonDock:ImageEx Source="/AvalonDock;component/resources/Images/VTabGroup.png" Width="13"/>
			</MenuItem.Icon>
		</MenuItem>
	</ContextMenu>


<!--Menu contextuel du volet ancrable de l'avalonDock-->
	<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type avalonDock:DockingManager}, ResourceId={x:Static avalonDock:ContextMenuElement.DockablePane}}">
		<MenuItem Header="Fenêtre flottante"
			Command="avalonDock:DockableContentCommands.FloatingWindow"  />
		<MenuItem Header="Afficher"
			Command="avalonDock:ManagedContentCommands.Show" />
		<MenuItem Header="Afficher en tant que document"
			Command="avalonDock:DockableContentCommands.ShowAsDocument" />
		<MenuItem Header="Masquer"
			Command="avalonDock:DockableContentCommands.ToggleAutoHide" />
	</ContextMenu>

</ResourceDictionary>
Then, in your WPF Control, call your Ressource Dictionnary like this :
<avalonDock:DockingManager.Resources>
<ResourceDictionary Source="pack://application:,,,/Your_Project-Name;component/UI/Resources/DockingManager.xaml" />
</avalonDock:DockingManager.Resources>
For the "Close All But This" Command, i've binded the MenuItem on my own command :
		public AvalonDock.DockingManager DockManager
		{
			get
			{
				 Get_TableBackground();

				return _dockManager;
			}
			set
			{
				if ((null != value) && (_dockManager != value))
				{
					_dockManager = value;
					OnPropertyChanged("DockManager");
				}
			}
		}



		private void CloseAllButThis()
		{
			
			DockableContent listViewContent = (DockableContent)this.DockManager.ActiveDocument;

			foreach (var dockableContent in this.DockManager.DockableContents)
			{
				if (dockableContent.Title != OngletName.MenuNav && dockableContent.Title != listViewContent.Title)
					dockableContent.Close();
			}
		}
Sep 27, 2012 at 2:11 PM

 

wintermh wrote:

On my german pc the menu items of the dockable content appears localized to german. I'd like to create an english language only application that shows english labels independend of the current localization of the target device.

By the way, the ApplicationCommand.New etc. are also localized to german. How do I get rid of the german localization?

Thanks in advance for your help...


You can set the UI culture of your application to be english and then it will display in english all the time. (if i understood correctly your question)

 

romuald wrote:

Hello,

I work with the lasted version and I search for the language French.

Have you solution for the translation menu ???

Thanks in advance for you help.

 

The new version of Avalon Dock has support for the French culture. Just set your application's culture to french(fr)

Sep 28, 2012 at 8:28 PM

Hi SlickRick,

Thank you for your answer.

You say : "The new version of Avalon Dock has support for the French culture. Just set your application's culture to french(fr)"

I set the Thread.CurrentThread.CurrentUICulture before the ctor calls to InitializeComponent(), but I see always the menu in English...why ???

Can you give me the steps to take that control the language well defined, please ?

Thank you for your help.

Sep 28, 2012 at 8:42 PM

Hi Bokhari,

Thank you for your help.

I have a error on "Avalondock:ImageEx" ???

And where I insert the code "DockManager.Resources" : Top of my control I think ???

I see "Get_TableBackgroung" ??? What is it ???

Thank you

 

 

Sep 29, 2012 at 1:42 PM
Edited Sep 29, 2012 at 1:43 PM

Hi Romuald,

You have to insert "DockManager.Resources" in the top of your control as you sed !!

Like this :

 

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:avalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             Background="White"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">

	<DockPanel>
		<avalonDock:DockingManager x:Name="dockManager"
			                           DockPanel.Dock="Top">
			
			<avalonDock:DockingManager.Resources>
				<ResourceDictionary Source="pack://application:,,,/Your_Project_Name;component/UI/Resources/DockingManager.xaml" />
			</avalonDock:DockingManager.Resources>
			
		</avalonDock:DockingManager>
	</DockPanel>
</UserControl>

 

Don't care about "Get_TableBackgroung", i'm using it for something else..You can remove it.!

Mar 2, 2014 at 5:14 PM
Is it supposed to work with the latest version 2.0.2?
I have assembly not found exception on this line and cannot find the proper working assembly reference:
xmlns:avalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"

When I write
xmlns:avalonDock="clr-namespace:Xceed.Wpf.AvalonDock;assembly=Xceed.Wpf.AvalonDock"
I get "The name does not exist in the namespace"

Thanks