Skip to content

[Bug]: Valid BCP 47 tags in the resource file name not recognized #9954

@PopSlime

Description

@PopSlime

Issue Description

I was trying to add support of an uncommon language to my app with resource files, before I realized its language tag was not being recognized by MSBuild, and it was not generating the expected satellite assembly for that language.

Steps to Reproduce

  1. Create a project with three resource files: Resources.resx, Resources.zh.resx, and Resources.yue.resx.
  2. Build the project.

Expected Behavior

The satellite assemblies for both zh and yue are generated.

Actual Behavior

The satellite assembly for zh is generated, but the one for yue is not.

Analysis

I suspect that the following code is causing this issue.

CultureInfo.GetCultureInfo(name, predefinedOnly: true);

A valid language code is not necessarily predefined.

Versions & Configurations

No response

Metadata

Metadata

Assignees

Labels

Priority:2Work that is important, but not critical for the releasebugtriaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions