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
24 stars 4 forks source link

Project 'MAUI' was not enabled - it is not a supported project type. #26

Open DominikErnst opened 7 months ago

DominikErnst commented 7 months ago

Please add support for MAUI! Thank you

thomasgalliker commented 4 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

chrisg32 commented 3 months ago

I was able to get the MAT plugin to work with a MAUI project (MAUI Blazor in my case).

1) Create your base language .resx file. e.g. MyApp.resx

2) Add the following to the .csproj project file.

<PropertyGroup Label="MultilingualAppToolkit">
    <MultilingualAppToolkitVersion>4.0</MultilingualAppToolkitVersion>
    <MultilingualFallbackLanguage>en-US</MultilingualFallbackLanguage>
    <TranslationReport Condition="'$(Configuration)' == 'Release'">true</TranslationReport>
    <SuppressPseudoWarning Condition="'$(Configuration)' == 'Debug'">true</SuppressPseudoWarning>
    <Nullable>enable</Nullable>
</PropertyGroup>

and

<Import Project="$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\Microsoft.Multilingual.ResxResources.targets" Label="MultilingualAppToolkit" Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\v$(MultilingualAppToolkitVersion)\Microsoft.Multilingual.ResxResources.targets')" />
<Target Name="MATPrerequisite" BeforeTargets="PrepareForBuild" Condition="!Exists('$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\Microsoft.Multilingual.ResxResources.targets')" Label="MultilingualAppToolkit">
    <Warning Text="$(MSBuildProjectFile) is Multilingual build enabled, but the Multilingual App Toolkit is unavailable during the build. If building with Visual Studio, please check to ensure that toolkit is properly installed." />
</Target>

3) Restart visual studio. This is key.

After the restart, the plugin will have the option to add translation languages from the MAT plugin by right clicking the project.

DominikErnst commented 2 months ago

Hello. Great that it works for you. Unfortunately not for me. :-( I think that Project is dead.

I have the impression that Microsoft is phasing out its support for developers. This can also be seen in the very, very poor MAUI product. In the future, everything will be done by AI. Developers are apparently already superfluous.

joshftb commented 2 months ago

Hi @DominikErnst,

Could you provide a sample (via a GitHub repository) that repro's this issue? That would be very helpful in investigating.

thomasgalliker commented 2 months ago

@joshftb your workaround works perfectly. I could get rid of my separate assembly trick.

@DominikErnst: Have a look at this sample app. This is a very minimal app for demo purposes which works with MAT and .NET MAUI 8.

DominikErnst commented 2 months ago

@thomasgalliker ok, thank you. Interesting. Didn't work on my machine?!? I have meetings all day, will get back to you later.

MAT0 MAT5 MAT1 MAT2 MAT3 MAT4

DominikErnst commented 2 months ago

@thomasgalliker ooohhhhhhh nooooo, it works better with admin rights, but I think not 100%!!! :-) I'll test later!

JeroenBer commented 1 month ago

Since it wasn't working anymore I wrote a new tool for this, if you are interested you can find it here:

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