-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Windows image localization papercut #16755
Comments
Thanks @davidbritch! Could you share a repro and binlog with us? Thanks :) |
Hi @davidbritch. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Related to #16734, was image localization ever an officially supported feature within MAUI? Both of these behaviors in this and the other issue are how you would handle localization for specific target frameworks but if you wanted to have one set of images to be localized on all platforms, we couldn't. IMO that kinda defeats the point of a single project since I would think the idea would be to have one set of images that work correctly on all supported platforms. To be clear, this is still an issue that should be addressed (You may want to have specific platform image localization and that should most likely be handled within the Platform folder) but should the concept of image localization be something supported within single project? |
Another related Windows loc papercut: #16814 |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Rather than using <ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<Content Include="Platforms\Windows\Assets\Images\**" TargetPath="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup> This redirects all files in the Platforms\Windows\Assets\Images to the app root. On all four platforms you can then consume localized images with: <Image Source="image.png" /> |
dotnet-maui-issues-main.zip |
Description
In a .NET MAUI app you can follow the .NET Android approach to handling localized images and it works correctly. On iOS/MacCat you can follow the platform approach to handling localized images and it works with a workaround (see #16734).
Windows is equally mysterious. If you place your localized images, in locale folders, in the root of your MAUI project then image localization works:
This isn't great though. But placing them in Platform/Windows doesn't work:
Similarly, placing them in Platform/Windows/Assets/Images doesn't work, which I'd hoped would work due to it being the UWP approach.
However, it's possible to make it work. Place your localized images in Platforms/Windows/Assets/Images (or whatever you want to call your images folder):
Those images will get copied to
bin/.../win10-x64/AppX/Platforms/Windows/Assets/Images
, which means to retrieve them in XAML you'll need to specify the path:So while this works I'd label it a papercut because the behaviour on one platform is different to the other platforms, where you don't have to worry about the path to the images.
Version with bug
7.0.92
Is this a regression from previous behavior?
No, this is something new
Affected platforms
Windows
The text was updated successfully, but these errors were encountered: