microsoft / Multilingual-App-Toolkit

This repo contains samples that demonstrate the localization workflow for users of the Multilingual Application Toolkit Visual Studio extension and editor. You can also use GitHub Issues to submit feedback, report bugs, or ask questions.
MIT License
25 stars 4 forks source link

.NET MAUI project support #10

Open IeuanWalker opened 1 year ago

IeuanWalker commented 1 year ago

Hi,

I've been using this for years in my Xamarin.Forms apps, and has worked perfectly.

Looking at migrating the apps to .NET MAUI but it doesn't look like its supported. Get this message when clicking on 'Enable selection' - 'Project 'App' was not enabled - it is not a supported project type.'

When will support be added for this?

https://devblogs.microsoft.com/xamarin/add-languages-to-your-apps-with-xamarin-and-multilingual-app-toolkit/

thomasgalliker commented 6 months ago

As a workaround, you can add the translation resources to a separate assembly (e.g. a netstandard2.0 library). Later, when MAT is capable of handling net8.0-android and net8.0-ios projects, you can always move the resx and xlf files back to the MAUI project.

Have a look at this sample project: https://github.com/hsrcasnet/MauiSamples/tree/main/LocalizationDemo

JeroenBer commented 6 months ago

Hi, we just ported from Xamarin to Maui (net8.0-android, net8.0-ios, net8.0-macos). In Xamarin and MAUI we use a lot of native android/iOS code. So we also need the Native translation files, the Multilingual toolkit was able to do that with Xamarin but it's not working for the new net8.0-android/ios projects. Using a netstandard2.0 library is not an option in that case since we need the native localization files generated.

So we are stuck at the moment, we can no longer do translations. So please consider implementing this very quickly. Why is the tooling not open source ? Then we can add the support ourselves. Please consider this also because this tool has been the bottleneck for upgrading a lot of times.

Otherwise we only have two options:

  1. Stop with MAUI.
  2. Completely rebuild the multilingual tooling ourselves.

Neither of them is very attractive for us.

JeroenBer commented 3 months ago

Hi all, Since there is no response here to this request, I wrote a new Open Source .NET tool to generate the multilingual files and resources. It can do this for native .NET android/ios/macos projects as well as "standard" resource files. Also it doesn't depend on Visual Studio since it runs as a .NET tool.

If you are interested, you can find it here:

https://www.nuget.org/packages/dotnet-mlgen/

https://github.com/JeroenBer/multilingual-generator

bodeg commented 3 months ago

@thomasgalliker, great idea!

This makes my porting process easier