Sunteți pe pagina 1din 9

Tool for creating multilingual projects for

Visual Studio

Table of Contents
Tool for creating multilingual projects for Visual Studio .............................................................................. 1
Overview ................................................................................................................................................... 1
Pre-requisites ............................................................................................................................................ 1
Background information ....................................................................................................................... 1
System Requirements ........................................................................................................................... 2
Installation ................................................................................................................................................ 2
Capabilities and usage of the tool............................................................................................................. 2
What the tool does at a high level ........................................................................................................ 2
Using the tool to configure parameters for your application ............................................................... 2
What is happening underneath? .......................................................................................................... 5
Making an existing application MUI enabled ........................................................................................... 8
Remarks .................................................................................................................................................... 8

Tool for creating multilingual projects for Visual Studio


Overview
You can use Visual Studio to create a multilingual application where the resources are localized prior to
building the project. This process is detailed in the following document. There are a number of steps
involved in producing a multilingual application in this way. The purpose of this document is to share
information about a tool that simplifies those steps, to make the creation of multilingual projects easier.

Pre-requisites
Background information
This document assumes that you have an understanding of how to create multilingual applications using
.mui files in Visual Studio.
For additional background information on internationalization and multilingual user interface
technology, please refer to the following sources:
Quick overview of internationalization
MUI Concepts
Using MUI to develop Win32 applications
Creating a multilingual application using Visual Studio 2008

System Requirements
 The tool will work on the following operating systems: Windows Vista, Windows 7, Windows
Server 2008 and Windows XP.
 Visual Studio 2008
 .Net Framework 3.5 or above
 For Windows XP: NLS Downlevel APIs

Installation
Just download MuiIzer.zip to your local machine. Extract all the files to the desired directory. Launch the
tool by double clicking on MuiIzer.exe.

Capabilities and usage of the tool


What the tool does at a high level
 This tool creates a new Visual Studio solution containing projects that match the target
languages for localization. You can leverage this for new applications that you want to create or
for existing projects (detailed steps at the end of this document).
 It assists in creating a configuration file, to specify resource types that are to be localized.
 It also sets appropriate command line switches and post-build tasks to split resources between
language-dependent and language-neutral binaries.

Using the tool to configure parameters for your application


The default steps discussed in this document are for creating a new application that will be localized in
multiple languages. The tool generates the required project structure for this purpose, with the required
properties set to create the necessary .mui files. Once the project structure is created, you can add the
necessary .cpp files and resources relevant to your application.

Language Tab
The Language tab of the tool allows the user to provide the basic information required to create the
solution, which will contain the project structure, in order to create .mui files. In this tab, you can also
provide the list of languages that you want your project to be localized in and set the ultimate fallback
language. Please refer to the documentation on User Interface Language Management in MUI to
understand the notion of fallback.
Figure 1 Language tab of the MuiIzer tool

Additional details about the configuration parameters supported on this tab are given below.

Language->Solution Parameters section:


“Predefined MuiIzer Project”: The tool comes with a default project template. If you use the default
project template, the project type that gets created is of type “Windows Console”. This is the default
selection and you do not need to change anything if you choose to use this setting.

“Existing User Project”: The tool offers you the flexibility of specifying a custom template. This enables
you to create the project structure within the solution with a project corresponding to the type you
choose. This is useful if you have an existing project and you want to make it multilingual. Detailed steps
are given below.

“Solution Path”: The solution will be created on this path.

“Solution Name”: The name of the solution that is created will be set to this value.

Language->Select Languages section:


“Available Languages”: This is a list of all languages to which an application can be localized. The user of
the tool can select values from this list to create the “Languages to localize in”
“Configure Primary (Ultimate Fallback) Language”: This allows you to set the “Ultimate Fallback”
language for your application

Resource Type Tab:


The Resource Type tab allows you to specify the types of resources that you want to localize. There is a
default list of resource types provided in the tool. You can also add custom resource types.

Figure 2 Resource tab of the MuiIzer tool

Resource Type->Resource Type Configuration section:


This section allows you to choose the resource types that will be localized in your application context.
You can use the “Both “button if you would like to have a resource type in both the localized and
language-neutral forms.

You can also remove a custom type that has been previously created, by using the “Remove” button.

Resource Type->Add a new Resource Type section:


This section allows you to create a custom resource type. You can specify the name and the ID for the
custom resource type you want to create.
What is happening underneath?
This section outlines what happens behind the scenes in the tool based on the settings you configure for
your application scenario:

Figure 3 Folder structure created by MuiIzer tool

 Solution is created: The tool creates a solution that has the project structure for the specified
target languages.
 Projects are created: There is a project created for each language the user specifies in the tool.
The project corresponding to the language specified as the “Ultimate Fallback language”
contains all the code (.cpp, header files) and generates an executable. The other projects
contain only resources and generate static libraries.
 Project properties are set: The project properties that need to be configured to produce the
.mui files and the necessary folder structure are set. The properties are set for the Debug and
the Release builds. (Please refer to the following documentation to understand the detailed list
of properties that have to be set.)
Additional command line options needed by the resource compiler for each project are
automatically added by the tool.
Figure 4 Command line options needed for the resource compiler

Custom properties in post-build steps to construct the folder structure required by MUI and to
copy the checksum from the language-neutral Binary (.exe) to the language-dependent binary
(.exe.mui) are set as below:
Figure 5 Custom properties in post-build steps

 Manifest file is created: The Resource Configuration Manifest file needed by the Resource
compiler is automatically generated for each target language that the application needs to be
localized in. The manifest file is present in the same folder location as the project file
corresponding to the ‘Ultimate Fallback Language’.
Figure 6 Resource Configuration Manifest

Making an existing application MUI enabled


How to make an existing application MUI enabled: Suppose you have an existing project that you
would like to make multilingual. You already have all the resource files in a specific language.

All the scenarios are not necessarily supported. However you can do the following to see if it works for
your scenario. Please make sure that you do extensive testing to ensure everything works.

1. Launch MuiIzer
2. Select “Custom Project Template”.
3. Select the project file that already exists
4. Name the solution and provide the location where it should be created
5. Specify the languages you want the project to be localized in
6. The language the project exists in is the one that will be set as ultimate fallback language in
most common scenarios.
7. Set the necessary values on the Resource Tab
8. Create “New Solution”

The new solution with the necessary projects is created. At this point the resources can be localized.
Once the resources are updated the solution can be built and the necessary mui files be created to
produce a multilingual application.

Remarks
For each resource type you can set the language of the resource in the property browser. This setting is
not used in the build however as the projects that the tool creates use the manifest files to determine
the languages of the resources. As a result, making changes to the language in the property browser will
have no effect on the output of the build.

S-ar putea să vă placă și