Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resw support for language qualifiers #18807

Open
jeromelaban opened this issue Nov 15, 2024 · 1 comment
Open

Add resw support for language qualifiers #18807

jeromelaban opened this issue Nov 15, 2024 · 1 comment
Labels
area/i18n Categorizes an issue or PR as relevant to i18n project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...)

Comments

@jeromelaban
Copy link
Member

Uno default project use different folder to place different language resw file.
PixPin_2024-11-15_17-38-17

But latest visualstudio updated its resource explorer . it is better to use filename rather folder.
PixPin_2024-11-15_17-42-12

For new resource explorer, different resw file in different folders is reagrded as different resource
PixPin_2024-11-15_17-38-05
PixPin_2024-11-15_17-57-47

But if they are in same folder, it will be same resource.

PixPin_2024-11-15_17-56-25

Originally posted by @DJDQfff in #18801

@jeromelaban jeromelaban added area/i18n Categorizes an issue or PR as relevant to i18n project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools labels Nov 15, 2024
@jeromelaban
Copy link
Member Author

Note to contributors

The implementation should be located here:

var resourceCandidate = ResourceCandidate.Parse(resource.ItemSpec, resource.ItemSpec);

and

internal static ResourceCandidate Parse(string fullPath, string relativePath)
{
var logicalPath = GetLogicalPath(relativePath);
var qualifiers = relativePath
.Split(Path.DirectorySeparatorChar, '_', '.')
.Select(ResourceQualifier.Parse)
.Reverse()
.Where(p => p != null)
.ToArray();
return new ResourceCandidate(qualifiers, fullPath, logicalPath);
}

@jeromelaban jeromelaban added project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...) and removed project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/i18n Categorizes an issue or PR as relevant to i18n project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...)
Projects
None yet
Development

No branches or pull requests

1 participant