Home » C# » How to use Multilingual App Toolkit in Universal App

How to use Multilingual App Toolkit in Universal App

1. Create universal app
Universal app has basically three projects:  a project for Windows 8.1, a project for Windows Phone 8.1 and a Shared project.

Capture1
By putting resource files in the shared project they will be shared by both the Windows and Windows Phone projects.

Capture2

2. Enable MAT (in this case v3.1) one time for Windows 8.1 project and second time for Windows Phone 8.1

Capture3

3. Add new translation languages for each project.

Capture5

4. New strings should be added to the resource.resw file (in shared project)
After build current solution, new string will be added automatically to each .xlf file in both the Windows and Windows Phone projects.

Capture6

5. In Windows Phone project, add pre-build event commands to copy *.xlf files from Windows Phone project to Windows project,  one command line for each .xlf file.

in my example:

COPY /Y “$(SolutionDir)HubApp4\HubApp4.WindowsPhone\MultilingualResources\HubApp4.WindowsPhone.fr.xlf” “$(SolutionDir)HubApp4\HubApp4.Windows\MultilingualResources\HubApp4.Windows.fr.xlf”

Capture8

6. Now you can translate all strings only in one project (in this example Windows Phone project).
During solution re-build, .xlf files will be update by translated version.

About

Informatics - my job & my passion.