Skip to content

Adjust ResourceLoader(String) to match documents#4329

Closed
YexuanXiao wants to merge 3 commits into
microsoft:mainfrom
YexuanXiao:ResourceLoader
Closed

Adjust ResourceLoader(String) to match documents#4329
YexuanXiao wants to merge 3 commits into
microsoft:mainfrom
YexuanXiao:ResourceLoader

Conversation

@YexuanXiao

@YexuanXiao YexuanXiao commented Apr 11, 2024

Copy link
Copy Markdown

In documents ResourceLoader and WindowsAppSDK Localize strings in your UI and the app package manifest, str in Microsoft.Windows.ApplicationModel.Resources.ResourceLoader.ResourceLoader(String str) represents resourceMap, usually the file name of resw. In the current implementation, str represents the file name of pri the str of the old obsolete API Windows.ApplicationModel.Resources.ResourceLoader(String str) represents the resourceMap.

So making the two more consistent seems to be a better solution, rather than using Microsoft.Windows.ApplicationModel.Resources.ResourceLoader.GetDefaultResourceFilePath().

documents:

ResourceLoader("ErrorMessages") // implicit "resources.pri" or "modulename.pri"

implement:

ResourceLoader(ResourceLoader.GetDefaultResourceFilePath(), "ErrorMessages")

this pr:
same as documents

breaking change

before:

ResourceLoader("filename.pri") // implicit "Resources" subtree

after:

ResourceLoader("filename.pri", "Resources")

Original issue: #4312 #2406

@lauren-ciha

Copy link
Copy Markdown
Member

Thank you for your contribution! In this case, the docs need an update. Here is the PR for that change.

@lauren-ciha lauren-ciha closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants