📜 ⬆️ ⬇️

We localize the Application Title in a WindowsPhone application: a hemorrhoids reduction guide.

Good day! Many here are developing applications that fall into the public Marketplace, AppStore or some other repository. Many of these applications are useful for users all over the world. And, so that the application was not only useful, but also slightly more attractive, it would be nice to give it a name and description in the native language of the potential user. WindowsPhone Marketplace with the task of localizing descriptions cope with a bang. However, the localization of the Application Title delivers ... some inconvenience.

In order for the application to have a multilingual AppTitle, the official Microsoft documentation offers many letters, a rather big resource resource mining tutorial for each of the required languages. The main sadness of this tutorial: you must have something to create a VisualC ++ library and a lot of unnecessary gestures.

However, there is a way to reduce hemorrhoids by more than half - a small utility called WP7Localizer, which is available here .

The main purpose of this thing is to generate the necessary resource dll. A nice addition for the lazy - you can set titles only in English, translation into other languages ​​utility will tighten with the help of Bing Translator.
')
And now let's try to get a small WindowsPhone application, with AppTitle in three languages: Russian, English and French.

Stage 1

Create a new WindowsPhone application project, call it TestApp. And immediately we climbed by some editor (for example, Notepad) into the file TestApp.csproj. This is the XML config of the application build, in which we are interested in the SupportedCultures node. Add our supported languages ​​to it:
<SupportedCultures> ru-RU,en-US,fr-FR </SupportedCultures> 


Stage 2

Generate resource dll for our multi-language Application Title. We do this by scoring on the manual from Microsoft, and using WP7TitleLocalizer:


(cut the picture in order to leave the essence, and not a bunch of empty fields)

By clicking on the “Save DLLs” button, we get a bunch of resource files - they are created, even if for some languages ​​we did not fill out anything. From all this variety we need 4 files:

Read more about language codes in the MSDN documentation .

Stage 3

We connect our language resources to the project. For this:
  1. First, create localization resources. Details of this step are beyond the scope of the topic and are in the official How-To . I can only say that for simplicity we will not create separate folders for them - we store them directly in the root folder of the project.
  2. Copy our 4 generated files to the project folder
  3. In Visual Studio, we add our freshly copied resources to the project (by right-clicking on the project in Solution Explorer -> Add Existing Item)
  4. For newly added files, set the Build Action property to Content (in the Solution Explorer, select our files and change the properties in the Properties tab)
  5. Edit the application manifest. Open the WMAppManifest.xml file and look for the Title property in the App node. Now there is something like this:

     <App xmlns="" ProductID="{product id}" Title="TestApp" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="author" Description="description" Publisher="publisher"> 


    Change the title to @ AppResLib.dll, -100. In no case do not put a space after the comma, otherwise the value is recognized as a string and this obscure entry will be visible in the Marketplace. We get:

     <App xmlns="" ... Title="@AppResLib.dll,-100" ... Publisher="publisher"> 


    Now we look at the PrimaryToken node - it has a subsidiary Title, which also needs light shamanism. We put it the value of AppResLib.dll, -200.

     <PrimaryToken TokenID="WindowsPhoneApplicationToken" TaskName="_default"> <TemplateType5> ... <Title>@AppResLib.dll,-200</Title> </TemplateType5> </PrimaryToken> 

  6. We collect application


Stage 4

Well, what did we do? That turns out, I will result on screenshots.
Here is what we see in the phone menu when changing the language used:



Here is what we see in the marketplace Dashboard:



This is how you can get a little closer to the user, so that he smiles and joy. Successes to all!

Source: https://habr.com/ru/post/149747/


All Articles