Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Link to a tool to simplify the process of localizing the title of a Windows Phone game

Link to a tool to simplify the process of localizing the title of a Windows Phone game

Rate This
  • Comments 0

A little while ago, I wrote a blog post with a list of steps that you can use to create native resource DLLs so that you can localize the title of your Windows Phone game created with XNA Game Studio 4.0.  Today, I found a blog post about a tool that automates the process of creating these native resource DLLs.  This tool provides 2 really nice benefits:

  1. It eliminates the requirement that you have to build your game from an edition of Visual Studio 2010 that supports both C# and C++ development (the VS 2010 Professional or better editions).  In other words, this allows you to build a game with a localized title in the free Visual Studio 2010 Express for Windows Phone edition.
  2. It greatly simplifies the number and complexity of the steps required to enable title localization for your game.

You can find the tool in this blog post.  Here is a set of steps that use this tool that you can use in place of the ones I posted in my earlier blog post to enable title localization for your Windows Phone game created with XNA Game Studio 4.0:

Step 0 – Create a Windows Phone game project

  1. Start Visual Studio 2010 or Visual Studio 2010 Express for Windows Phone.
  2. Click on File | New | Project..., select Visual C# | XNA Game Studio 4.0 and choose Windows Phone Game (4.0).

Step 1 – Create native resource DLLs using the Windows Phone 7 Title Localizer tool

  1. Download the Windows Phone 7 Title Localizer tool from the link at the end of the blog post at http://patrickgetzmann.wordpress.com/wp7-localize/.
  2. Run the Windows Phone 7 Title Localizer tool.
  3. Enter your language-neutral title strings.
  4. Enter your translated title strings or use the Translate button in the tool to automatically translate the strings using the Bing translator engine.
  5. Click the Save DLLs button to create native resource DLLs that contain the strings you have provided.

Step 2 – Add native resource DLLs to your Windows Phone game project

Note - the name of the native resource DLL is important in this scenario.  It must be named AppResLib.dll, and the localized versions must be named AppResLib.dll.*.mui.  If they are named differently, your game will be rejected by the Windows Phone Marketplace certification process.

  1. Right-click on your Windows Phone game project in the Visual Studio solution explorer, click Add | Existing Item...
  2. Browse to the folder that you saved the DLLs to in step 2 above, select the file named AppResLib.dll, then click the Add button.
  3. Select each of the files named AppResLib.dll.*.mui in the same folder, then click the Add button.
  4. For each of the AppResLib.dll* files that you have added to your Windows Phone game project, set the Build Action property to None and the Copy to Output Directory property to Copy if newer.  This will make sure that each of these files gets packaged into the XAP file that is created when you build your Windows Phone Game project.

Step 3 – Update your Windows Phone game to load title strings from the resource DLLs

Update the application title by doing the following:

  1. In your Windows Phone Game project, open the file Properties\AssemblyInfo.cs.
  2. Remove the AssemblyTitle entry.
  3. Add an AssemblyTitleAttribute entry that looks like this:

    [assembly: AssemblyTitleAttribute("@AppResLib.dll,-100")]

Update the tile title by doing the following:

  1. Right-click on your Windows Phone Game project in the Visual Studio solution explorer and choose Properties.
  2. Click on the XNA Game Studio tab.
  3. Change the Tile title value to look like this:

    @AppResLib.dll,-200

The tile title is the name that is displayed if you click and hold on your application/game in the Windows Phone OS and choose to pin it to the start menu.  There is some additional information about these properties and how to configure them in XNA Game Studio games in this documentation topic.  Depending on the scenarios you want to support for your game, it may not be necessary to create separate strings for your application title and tile title.  If you plan to use the same string for both, you do not need to create separate entries in the string table in each of your native resource DLLs in the instructions above.

Step 4 – Rebuild your Windows Phone game solution

Rebuild the solution that contains your Windows Phone Game project.

<update date="1/18/2011"> Added a warning about the naming of the DLL needing to exactly match what is listed in the documentation. </update>

 

Leave a Comment
  • Please add 4 and 4 and type the answer here:
  • Post