Namespaces
Variants
Actions

How to solve problems localizing the app name

Jump to: navigation, search

This article gives hints how to find the reason for problems localizing a Windows Phone App's title text.

WP Metro Icon UI.png
Article Metadata

Article
Created: influencer (25 Nov 2012)
Last edited: influencer (07 Dec 2012)

Contents

Introduction

Localizing an app can be a rewarding but also a complicated task. MSDN has documentation on three different aspects of the localization:

  • localizing the app resources
  • handling the application bar
  • and translating the app name and tile title.


Especially the last point presented a lot of problems to me and other developers.

Note.png
Note: I tried the localization in a WP 7.5 app but I think the tips should work in WP8, too.

Translating the app title

There's a detailed step-by-step description on MSDN about how to localize the app title of a Windows Phone app. There's also a tool by Patrick Getzmann that automates generating the necessary C++-DLLs.

In order to localize the app title it's necessary to create a resource-only C++ DLL for each language that's to be supported. The DLL contains a string table that has one text for the app title and one for the app's text when pinned to the start screen. In the app manifest the unlocalized strings are replaced by references to the DLL's resources.

  <App xmlns="" ProductID="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" Title="@AppResLib.dll,-100"
RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="Thomas Schmidt"
Description="Sample app" Publisher="Thomas Schmidt">

...

    <Tokens>
<PrimaryToken TokenID="KeyRingToken" TaskName="_default">
<TemplateType5>
<BackgroundImageURI IsRelative="true" IsResource="false">Images\appimage.png</BackgroundImageURI>
<Count>0</Count>
<Title>@AppResLib.dll,-200</Title>
</TemplateType5>
</PrimaryToken>
</Tokens>

Problem happening

I proceeded according to the documentation and began testing with the emulator and on the Lumia device. I had created my default language DLL named AppResLib.dll with German texts and an English version called AppResLib.dll.0409.mui.

Then I changed the emulator to English display language and voilà, the app had an English name. So far so good. But when I changed back to German the app kept the English name. Trying the same on the device got me the same result. I don't know how often I switched languages back and forth without effect.

Looking for advice

I searched for a while and found many reports of other developers facing the same problem. Even one of my colleagues talked about it regarding one of his apps.

The hints I found ranged from

  • using only neutral language IDs (like German - warning, in my understanding this is incorrect!) to
  • only using specific language IDs (like German-Germany - the correct way) to
  • always using English-US as default language (this is not necessary - works with DE-de in my app).
  • One other tip was to change the neutral language id in the app properties.
  • The list of supported languages in the xml representation of the VS project file is another item of discussion. This has to be done in Notepad for WP7 apps. Visual Studio has a dialog representation for this.
  • An important tip is not to forget to set the DLLs to 'Content'.
  • Some threads discussing the problem were even removed from the MSDN forums.


I tried all these tips. I experimented with the language IDs of the resources in the DLLs themselves but that didn't help either. The whole experience was very frustrating after some days.

My solution

I searched again and meanwhile the wp8 SDK was published. A new MSDN article has appeared and an accompanying sample was published. I installed the sample although I can't run it (my notebook doesn't support Hyper-V and I don't own a WP8 device yet). In the sample I saw that there were resource DLLs for each supported language with the .mui extension (including the default language) plus the DLL for the default language with the .dll extension.

I tried this approach in my app and suddenly the language switching succeeded!

Here's a list of the included resource DLLs in my app project that's localized in German and English:

  • AppResLib.dll
  • AppResLib.dll.0407.mui
  • AppResLib.dll.0409.mui
This page was last modified on 7 December 2012, at 00:12.
438 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved