-
Notifications
You must be signed in to change notification settings - Fork 88
Using MAT for RESX to XLIFF conversion
The first step is to download and install MAT 4.0 from https://marketplace.visualstudio.com/items?itemName=MultilingualAppToolkit.MultilingualAppToolkit-18308 (or directly from Visual Studio by using Tools->Extensions and Updates.
Once MAT is installed, you will have a new menu item under your Tools menu - "Mutlilingual App Toolkit".
You will use that menu to enable MAT in new projects. You should not need to use it unless you are adding a new project to LibMan (or starting a completely different product/project).
Prior to enabling MAT, you need
- Add Properties\AssemblyInfo.cs if it doesn't exist in your project already
- Add
[assembly: NeutralResourcesLanguage("en")]
entry to the AssemblyInfo.cs
If you don't do that, you'll get Project 'Microsoft.Web.LibraryInstaller.Contracts' was not enabled - the project's source culture could not be determined.
in the Multilingual App Toolkit output window.
Once you've done the steps above, select the desired project in the Solution Explorer and use Tools->Multilingual App Toolkit->Enable Selection to enable MAT in the selected project.
It will modify your csproj file to add something like
<PropertyGroup Label="MultilingualAppToolkit">
<MultilingualAppToolkitVersion>4.0</MultilingualAppToolkitVersion>
<MultilingualFallbackLanguage>en</MultilingualFallbackLanguage>
<TranslationReport Condition="'$(Configuration)' == 'Release'">true</TranslationReport>
<SuppressPseudoWarning Condition="'$(Configuration)' == 'Debug'">true</SuppressPseudoWarning>
</PropertyGroup>
and
<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>
Make sure to save your csproj at this point. You are done enabling MAT for this project. Repeat for other projects as needed. You can also run it on the solution level.
Troubleshooting: Look in the Output Window, and Make sure Multilinguage App Toolkit is selected. If all goes well, you should get
1> Project 'Microsoft.Web.LibraryInstaller.Contracts' was enabled. The project's source culture is 'en' [English].
If something goes wrong, you may get an error. Google is your friend in that case.