-
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
iOS/Mac Catalyst image localization #16734
Comments
In particular it must happen before Xamarin.Shared.props is imported in line 211 here: https://gist.github.com/rolfbjarne/b194bc4d4d345425eee1a17fc0523ab6#file-gistfile1-txt-L211 currently it happens in Microsoft.Maui.Controls.SingleProject.targets at line 246: https://gist.github.com/rolfbjarne/b194bc4d4d345425eee1a17fc0523ab6#file-gistfile1-txt-L246 |
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. |
Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on iOS 16.4 and Windows 11 .NET 8, not repro on Android 13.0-API33 with below Project: |
@davidbritch does localization of I want to ask for location permission with localized text. I moved Any suggestions? |
@ArchimedesFTW It worked for me at the time of writing. But there've been multiple releases since then, and I've not tried it since. |
FYI, I got the permission localization working by placing the lproj folders here (with MAUI 8.0.14):
|
Note that this location is slightly different from the one in the workaround mentioned in the original report (i.e. I'm placing the lproj folders into Also, I can confirm that the second workaround works well with permission localization: If the lproj folders are in
in your csproj. |
In my case a working solution is to move files from Keeping the files in Platforms/iOS/Resources and adding the I'm using Visual Studio Version 17.10.0 Preview 3.0. and MAUI 8.0.14. |
Description
The technique for localizing images on iOS are well known. It involves creating folders with the locale name, followed by .lproj, with the images in these folders. These would normally go in a Resources folder. So for MAUI I translated this to the Platforms\iOS\Resources folder:
The images have a build action of BundleResource.
This doesn't work for iOS, or on Mac Catalyst (using the equivalent MacCatalyst folder).
What does work is putting the .lproj folders in the root of the MAUI project:
Localized images are then displayed (on both iOS + MacCat).
While it works it makes me feel dirty having the root of your project contaminated with Apple only resources.
UPDATE: @rolfbjarne has told me that updating the .csproj to include
<IPhoneResourcePrefix>Platforms/iOS/Resources</IPhoneResourcePrefix>
makes localised images, contained in that specific folder, work on iOS + MacCat.Steps to Reproduce
Link to public reproduction project repository
https://github.com/davidbritch/dotnet-maui-issues/tree/main/LocalizationDemo
Version with bug
7.0.92
Is this a regression from previous behavior?
Don't think this has ever worked!
Affected platforms
iOS, macOS
Did you find any workaround?
Place .lproj folders in the root of your MAUI project.
OR (better)
Update your .csproj with the following:
The text was updated successfully, but these errors were encountered: