Fix missing resources for en-US culture #82
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When running a website with Tag Manager installed, a warning appears in the Event Log:
This occurs because the library only registered localization resources for
SystemContext.SYSTEM_CULTURE_NAME(which is "en"), but many Xperience installations run with the "en-US" culture. When Kentico'sLocalizationDataProviderlooks for resources in the en-US culture, it cannot find them and logs a warning.Solution
This PR adds support for the en-US culture by:
TagManagerResources.en-US.resx- A culture-specific resource file containing the same localization strings as the default resource file[assembly: RegisterLocalizationResource]attribute to inform Kentico's localization system that this resource supports en-USEnableDefaultEmbeddedResourceItemsdisabled)Technical Details
The .NET build system compiles
TagManagerResources.en-US.resxinto a satellite assembly (Kentico.Xperience.TagManager.resources.dll) placed in anen-USsubfolder. When the application runs with en-US culture, Kentico's localization system can now find and load the appropriate resources, eliminating the warning.Changes
src/Kentico.Xperience.TagManager/Resources/TagManagerResources.en-US.resxsrc/Kentico.Xperience.TagManager/Resources/TagManagerResources.csto register en-US culturesrc/Kentico.Xperience.TagManager/Kentico.Xperience.TagManager.csprojto explicitly include resource filesFixes #[issue_number]
Original prompt
Fixes #76
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.