You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,20 +14,20 @@ You will receive a response like:
14
14
15
15
*Alternatively, you can just delete your local copy of the repo and reclone it if you don't have any active work on the repo that you are concerned with losing.
16
16
17
-
Following the rename of this repo, the content team will also be working to rename and restructure the sourcefile directories within the repo to more closely align with the structure of our live documentation. We are aiming to have this work complete by September 16, 2022.
17
+
Following the rename of this repo, the content team will also be working on renaming and restructuring the source file directories within the repo to align more closely with the structure of our live documentation. We are aiming to have this work complete by September 16, 2022.
18
18
19
19
## Legal Notices
20
20
Microsoft and any contributors grant you a license to the Microsoft documentation and other content
21
21
in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode),
22
-
see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the
22
+
see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT). See the
23
23
[LICENSE-CODE](LICENSE-CODE) file.
24
24
25
-
Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation
25
+
Microsoft, Windows, Microsoft Azure, and/or other Microsoft products and services referenced in the documentation
26
26
may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries.
27
27
The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks.
28
28
Microsoft's general trademark guidelines can be found at https://go.microsoft.com/fwlink/?LinkID=254653.
29
29
30
30
Privacy information can be found at https://privacy.microsoft.com/en-us/
31
31
32
32
Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents,
33
-
or trademarks, whether by implication, estoppel or otherwise.
33
+
or trademarks, whether by implication, estoppel, or otherwise.
# Build resources into your app package, instead of into a resource pack
12
+
# Build resources into your app package instead of into a resource pack
13
13
14
-
Some kinds of apps (multilingual dictionaries, translation tools, etc.) need to override the default behavior of an app bundle, and build resources into the app package instead of having them in separate resource packages (or resource packs). This topic explains how to do that.
14
+
Some kinds of apps (multilingual dictionaries, translation tools, etc.) need to override the default behavior of an app bundle and build resources into the app package instead of having them in separate resource packages (or resource packs). This topic explains how to do that.
15
15
16
-
By default when you build an [app bundle (.appxbundle)](/windows/msix/package/packaging-uwp-apps), only your default resources for language, scale, and DirectX feature level are built into the app package. Your translated resources—and your resources tailored for non-default scales and/or DirectX feature levels—are built into resource packages and they are only downloaded onto devices that need them. If a customer is buying your app from the Microsoft Store using a device with a language preference set to Spanish, then only your app plus the Spanish resource package are downloaded and installed. If that same user later changes their language preference to French in **Settings**, then your app's French resource package is downloaded and installed. Similar things happen with your resources qualified for scale and for DirectX feature level. For the majority of apps, this behavior constitutes a valuable efficiency, and it's exactly what you and the customer *want* to happen.
16
+
By default, when you build an [app bundle (.appxbundle)](/windows/msix/package/packaging-uwp-apps), only your default resources for language, scale, and DirectX feature level are built into the app package. Your translated resources—and your resources tailored for non-default scales and/or DirectX feature levels—are built into resource packages, and they are only downloaded onto devices that need them. If a customer is buying your app from the Microsoft Store using a device with a language preference set to Spanish, then only your app plus the Spanish resource package are downloaded and installed. If that same user later changes their language preference to French in **Settings**, then your app's French resource package is downloaded and installed. Similar things happen with your resources qualified for scale and for DirectX feature level. For the majority of apps, this behavior constitutes a valuable efficiency, and it's what you and the customer *want* to happen.
17
17
18
18
But if your app allows the user to change the language on the fly from within the app (instead of via **Settings**), then that default behavior is not appropriate. You actually want all of your language resources to be unconditionally downloaded and installed along with the app one time, and then remain on the device. You want to build all of those resources into your app package instead of into separate resource packages.
19
19
20
20
**Note** Including resources in an app package essentially increases the size of the app. That's why it's only worth doing if the nature of the app demands it. If not, then you don't need to do anything except build a regular app bundle as usual.
21
21
22
-
You can configure Visual Studio to build resources into your app package in one of two ways. You can either add a configuration file to your project, or you can edit your project file directly. Use whichever of these options you're most comfortable with, or whichever works best with your build system.
22
+
You can configure Visual Studio to build resources into your app package in one of two ways. You can either add a configuration file to your project or you can edit your project file directly. Use whichever of these options you're most comfortable with or whichever works best with your build system.
23
23
24
24
## Option 1. Use priconfig.packaging.xml to build resources into your app package
25
25
@@ -33,7 +33,7 @@ You can configure Visual Studio to build resources into your app package in one
33
33
<autoResourcePackagequalifier="DXFeatureLevel" />
34
34
</packaging>
35
35
```
36
-
4. Each `<autoResourcePackage>` element tells Visual Studio to automatically split the resources for the given qualifier name out into separate resource packages. This is called *auto-splitting*. With the file contents you have so far, you haven't actually changed Visual Studio's behavior. In other words, Visual Studio *already behaved as if* this file were present with these contents, because these are the defaults. If you don't want Visual Studio to auto-split on a qualifier name then delete that `<autoResourcePackage>` element from the file. Here's how the file would look if you wanted all of your language resources to be built into the app package instead of being auto-split out into separate resource packages.
36
+
4. Each `<autoResourcePackage>` element tells Visual Studio to automatically split the resources for the given qualifier name out into separate resource packages. This is called *auto-splitting*. With the file contents you have so far, you haven't actually changed Visual Studio's behavior. In other words, Visual Studio *already behaved as if* this file were present with these contents because these are the defaults. If you don't want Visual Studio to auto-split on a qualifier name, then delete that `<autoResourcePackage>` element from the file. Here's how the file would look if you wanted all of your language resources to be built into the app package instead of being auto-split out into separate resource packages.
37
37
```xml
38
38
<packaging>
39
39
<autoResourcePackagequalifier="Scale" />
@@ -44,7 +44,7 @@ You can configure Visual Studio to build resources into your app package in one
44
44
45
45
To confirm that your auto-split choices are being taken into account, look for the file `<ProjectFolder>\obj\<ReleaseConfiguration folder>\split.priconfig.xml` and confirm that its contents match your choices. If they do, then you have successfully configured Visual Studio to build the resources of your choice into the app package.
46
46
47
-
There is one final step that you need to do. **But only if you deleted the `Language` qualifier name**. You need to specify the union of all of your app's supported language as your app's default for language. For details, see [Specify the default resources that your app uses](specify-default-resources-installed.md). This is what your `priconfig.default.xml` would contain if you were including resources for English, Spanish, and French in your app package.
47
+
There is one final step that you need to do. **But only if you deleted the `Language` qualifier name**. You need to specify the union of all of your app's supported languages as your app's default language. For details, see [Specify the default resources that your app uses](specify-default-resources-installed.md). This is what your `priconfig.default.xml` would contain if you were including resources for English, Spanish, and French in your app package.
48
48
49
49
```xml
50
50
<default>
@@ -65,27 +65,27 @@ If you name your file `priconfig.packaging.xml`, then Visual Studio will recogni
Replace `FILE-PATH-AND-NAME` with the path to, and name of, your file.
68
+
Replace `FILE-PATH-AND-NAME` with the path to and name of your file.
69
69
70
70
## Option 2. Use your project file to build resources into your app package
71
71
72
-
This is an alternative to Option 1. Once you understand how Option 1 works, you can choose to do Option 2 instead, if that suits your development and/or build workflow better.
72
+
This is an alternative to Option 1. Once you understand how Option 1 works, you can choose to do Option 2 instead if that suits your development and/or build workflow better.
73
73
74
74
In your project file, between the opening and closing tags of the first `<PropertyGroup>` element, add this XML.
There is one final step that you need to do. **But only if you deleted the `Language` qualifier name**. You need to specify the union of all of your app's supported language as your app's default for language. For details, see [Specify the default resources that your app uses](specify-default-resources-installed.md). This is what your project file would contain if you were including resources for English, Spanish, and French in your app package.
88
+
There is one final step that you need to do. **But only if you deleted the `Language` qualifier name**. You need to specify the union of all of your app's supported languages as your app's default language. For details, see [Specify the default resources that your app uses](specify-default-resources-installed.md). This is what your project file would contain if you included resources for English, Spanish, and French in your app package.
Copy file name to clipboardExpand all lines: uwp/app-resources/compile-resources-manually-with-makepri.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,9 +41,9 @@ MakePri.exe is typically used with the `new`, `versioned`, and `resourcepack` op
41
41
42
42
This warning is displayed when MakePri.exe or MSBuild discovers files or string resources for a given named resource that appear to be marked with language qualifiers, but no candidate is found for a default language. The process for using qualifiers in file and folder names is described in [Tailor your resources for language, scale, and other qualifiers](tailor-resources-lang-scale-contrast.md). A file or folder may have a language name in it, but no resources are discovered that are qualified for the exact default language. For example, if a project uses "en-US" as the default language and has a file named "de/logo.png", but does not have any files that are marked with the default language "en-US", this warning will appear. In order to remove this warning, either file(s) or string resource(s) should be qualified with the default language, or the default language should be changed. To change the default language, with your solution open in Visual Studio, open `Package.appxmanifest`. On the Application tab, confirm that the Default language is set appropriately (for example, "en" or "en-US").
43
43
44
-
### No default or neutral resource given for '\<resource identifier>'. The application may throw an exception for certain user configurations when retrieving the resources.
44
+
### No default or neutral resource is given for '\<resource identifier>'. The application may throw an exception for certain user configurations when retrieving the resources.
45
45
46
-
This warning is displayed when MakePri.exe or MSBuild discovers files or resources that appear to be marked with language qualifiers for which the resources are unclear. There are qualifiers, but there is no guarantee that a particular resource candidate can be returned for that resource identifier at run time. If no resource candidate for a particular language, homeregion, or other qualifier can be found that is a default or will always match the context of a user, this warning will be displayed. At run time, for particular user configurations such as a user's language preferences or home location (**Settings** > **Time & Language** > **Region & language**), the APIs used to retrieve the resource may throw an unexpected exception. In order to remove this warning, default resources should be provided, such as a resource in the project's default language or global home region (homeregion-001).
46
+
This warning is displayed when MakePri.exe or MSBuild discovers files or resources that appear to be marked with language qualifiers for which the resources are unclear. There are qualifiers, but there is no guarantee that a particular resource candidate can be returned for that resource identifier at run time. If no resource candidate for a particular language, home region, or another qualifier can be found that is default or will always match the context of a user, this warning will be displayed. At run time, for particular user configurations such as a user's language preferences or home location (**Settings** > **Time & Language** > **Region & language**), the APIs used to retrieve the resource may throw an unexpected exception. In order to remove this warning, default resources should be provided, such as a resource in the project's default language or global home region (homeregion-001).
47
47
48
48
## Using MakePri.exe in a build system
49
49
@@ -53,7 +53,7 @@ Build systems that require explicit control over source files that get indexed c
53
53
54
54
Build systems can also use the PRI format-specific indexer to add pre-built PRI files into the PRI for the package from other components, such as class libraries, assemblies, SDKs, and DLLs.
55
55
56
-
When PRI files are built for other components, class libraries, assemblies, DLLs, and SDKs, the **initialPath** configuration should be used to ensure component resources have their own subresource maps that don't conflict with the app they're included in.
56
+
When PRI files are built for other components, class libraries, assemblies, DLLs, and SDKs, the **initialPath** configuration should be used to ensure component resources have their own sub-resource maps that don't conflict with the app they're included in.
0 commit comments