Guidelines for app resources
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 Universal Windows Platform (UWP) app.
For more detailed info on app resources, as well as articles that show you how to use resource management APIs, see:
- 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 (XAML) for more information on naming 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 (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.