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

Need samples for .net core, ASP.net, Blazor, WinUI #2

Open PaulDempsey-ms opened 2 years ago

PaulDempsey-ms commented 2 years ago

It would be great to have samples for more than just UWP and WPF. Other technologies also need to do localization:

wstaelens commented 2 years ago

e.g. asp.net.

  1. You simple create a new project called "Myproject.Resources".
  2. Install Microsoft MAT and add translations
  3. In your other project add/reference Myproject.Resources and use e.g. the Myproject.Resources.[yourlocation].Resources.MyTranslatedString

It is simple putting your resx files in a separate assembly for reuse in the project and you keep your resx resources up-to-date via MAT. update the source language strings in the .resx file and for the other languages you update your xlf files.

see: https://stackoverflow.com/questions/1142802/how-to-use-localization-in-c-sharp/60000088#60000088

PaulDempsey-ms commented 2 years ago

I understand the process, but it would be useful to have actual samples for other technologies, so that you can see how resource binding works in each kind of app.

RogerSmithR commented 2 years ago

@PaulDempsey-ms Hello! I made a pull request with the Asp Core demo you requested.

wstaelens commented 2 years ago

Blazor Server might use also some examples :-)

RogerSmithR commented 2 years ago

Oh great!

I would love to contribute to that too.

XamlProf commented 2 years ago

I use WPF + .Net 6, the MAT not working for me ((. The MAT can't find any resources (.resx) in my project. It works if I use .resw files (by path : /strings/en-US/.resw) instead .resx , but the MAT clears all my translations each time after building my project. Please add a sample on how to use WPF + .Net 6 + Windows App SDK. Thanks.