WPF: Adding Localization Menu Items

If you want to localize you WPF application you should add two menu items to your application:

  • A Localize Setup menu item that puts the application in Localize Setup mode and allows the end user to translate the application

  • A Languages menu item that launches the Languages maintenance window which allows users to add, edit and delete languages

Localize Setup Menu Item


Note: this menu item is automatically added to the MainWindow.xaml for you under the File menu, and its associated code is also added for you, so you can skip this step if you want to use the default menu item.


Here are the steps you need to take to add a Localize Setup menu item to your application.

  1. If it doesn't already exist, add a new menu item to your application with the Header text "Localize Setup", or whatever text you prefer.

  2. Check the menu item's IsCheckable check box.

  3. Add handler methods for the menu item's Checked and Unchecked events containing the following code:

    In C#:

    private void MenuItem_Checked(object sender, RoutedEventArgs e)
    {
    	mmAppWPF.LocalizeSetupMode = true;
    }
    
    private void MenuItem_Unchecked(object sender, RoutedEventArgs e)
    {
    	mmAppWPF.LocalizeSetupMode = false;
    }

    And in VB .NET:

    Private Sub MenuItem_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
            mmAppWPF.LocalizeSetupMode = True
        End Sub
    
        Private Sub MenuItem_Unchecked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
            mmAppWPF.LocalizeSetupMode = False
    End Sub

Languages Menu Item

Here are the steps you need to take to add a Languages menu bar to your application's menu:

  1. Add a new menu item to your application with the Header text "Languages" (or whatever you prefer)

  2. Create a handler method for the menu item's Clicked event. Add the following code to this method:

    In C#:

    private void LanguageMenuItem_Click(object sender, RoutedEventArgs e)
    {
    	mmAppWPF.WindowManager.Show(new LanguageWindow());
    }

    And in VB .NET:

    Private Sub LanguagesMenuItem_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
            mmAppWPF.WindowManager.Show(New LanguageWindow())
    End Sub

Now at run time, the user sees a Languages menu item that launches the Language maintenance form.


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/26/18
Comment or report problem with topic