Guidelines for app resources

Applies to Windows and Windows Phone

Separating app resources, like strings and images, from code is one way to ease the process of maintaining and localizing your app. This topic describes best practices for using app resources in a Windows Store app.

For more detailed info on app resources, as well as topics that show you how to use resource management APIs, see:

Dos and don'ts

Creating resources

  • Don't put resources, such as UI strings and images, in code. Instead, put them into resource files, such as .resjson or .resw files.
  • Use qualifiers to support file and string resources that are tailored for different display scales, UI languages, or high contrast settings.
  • Set the default language in the app manifest (package.appxmanifest).
  • String resources, even those in the default language, should have a file or folder named with the language tag.
  • Add comments to your string resource for the localizer.

See How to name resources using qualifiers (HTML) or How to name resources using qualifiers (XAML) for more information on naming resources.

Referring to resources

  • Add unique resource identifiers in the code and markup to refer to resources.
  • Refer to images in markup, code, or manifest files without the qualifiers.
  • Listen for events that fire when the system changes and it begins to use a different set of qualifiers. Reprocess the document so that the correct resources can be loaded.

See Globalizing your app (HTML) or Globalizing your app (XAML) for step-by-step guidance on translating UI resources and preparing for localization. For recommendations on creating an app appropriate for global audiences, see Guidelines for globalization.

Related topics

For developers (HTML)
Resources
Resources.Core
WinJS.Resources
Defining app resources
For developers (XAML)
Resources
Resources.Core
Defining app resources

 

 

Show:
© 2014 Microsoft