Sep 272014
 
 September 27, 2014  Posted by at 10:26 am Universal Apps, WinRT  Add comments

This is part 2 of a two part series on resources and assets for localization (Universal Store Apps). Part 1 can be found here

Previous part

  • Using resource strings in XAML
  • Using resource strings in XAML for styles
  • Using resource strings in code

Covered in this part

  • Using resource images
  • Setting images for scaling
  • Localizing the app name and description

Using resource images

Add separate images under the folders under each language folder, the name of the file should be the same for both images

2014-09-26_19-20-10

Use the file in code as usual ignoring the language tag in the path

<Image Source=”../Resources/flag.png”/>

2014-09-26_19-21-42

Using resource images

resources and assets winrt24

Create a folder for each scale under a common folder, use scale-100 for 100% and so on on each folder containing scaled images. Ive changed the color of the images in this example so you can see they are changing.

2014-09-26_19-22-59

Reference the image in XAML as usual, ignoring the scale folder.

  <Image Source=”../Resources/imgForScale.png”/>

2014-09-26_19-24-12

Localizing the app name and description

Define resource string SomeName in the resource files. In each manifest file for the app set DisplayName to that prefixed with ms-resource:. Don’ forget to do this under the Packaging as well. Set both DisplayName and Description

resources and assets winrt17

This will automatically load. If the app fails to update, uninstall it from the system and run it again.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

What is 15 + 7 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)