You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The WinUI3Localizer is a NuGet package that helps you localize your WinUI 3 app.
3
2
4
-
- Switch languages **without restarting**
3
+
**WinUI3Localizer** is a NuGet package that helps you localize your WinUI 3 app.
4
+
5
+
- Switch languages **without app restarting**
5
6
- You/users can **edit** localized strings even after deployment
6
7
- You/users can **add** new languages even after deployment
7
-
- Use standard **Resources.resw**
8
+
- Use standard **Resources.resw** (see [Microsoft docs](https://learn.microsoft.com/en-us/windows/uwp/app-resources/localize-strings-ui-manifest))
8
9
9
-
## 🙌 Getting started
10
+
## 🙌 Quick Start
10
11
11
-
### Installing the WinUI3Localizer
12
-
Install the WinUI3Localizer from the NuGet Package Manager or using the command below.
12
+
> **Note**: This is a quick start guide. Check the sample app for details.
13
13
14
-
```powershell
15
-
dotnet add package WinUI3Localizer
16
-
```
14
+
### **Install WinUI3Localizer**
15
+
16
+
Install **WinUI3Localizer** from the NuGet Package Manager.
17
17
18
-
### Prepare the "Strings" folder
19
-
Create a "Strings" folder and populate it with your string resources files for the languages you need. For example, this is the basic structure of a "Strings" folder for English (en-US), es-ES (Spanish) and Japanese (ja).
18
+
### **Create localized strings**
19
+
20
+
Create a "Strings" folder in your app project and populate it with your string resources files for each language you need. For example, this is a basic structure for English (en-US), es-ES (Spanish) and Japanese (ja) resources files.
20
21
21
22
- Strings
22
23
- en-US
@@ -26,4 +27,175 @@ Create a "Strings" folder and populate it with your string resources files for t
26
27
- ja
27
28
- Resources.resw
28
29
29
-
The "Strings" folder can be anywhere as long the app can access it. Usually, aside the app executable for non-packaged apps, or in the LocalData folder for packaged-apps.
30
+
Add this ItemGroup in the project file (\*.csproj) of your app.
31
+
32
+
```xml
33
+
<!-- Copy all "Resources.resw" files in the "Strings" folder to the output folder. -->
> **Note**: The "Strings" folder can be anywhere as long the app can access it. Usually, aside the app executable for non-packaged apps, or in the "LocalFolder" for packaged-apps.
42
+
43
+
### **Build WinUI3Localizer**
44
+
45
+
- Non-packaged apps:
46
+
47
+
In App.xaml.cs, build **WinUI3Localizer** like this:
48
+
49
+
```csharp
50
+
privateasyncTaskInitializeLocalizer()
51
+
{
52
+
// Initialize a "Strings" folder in the executables folder.
0 commit comments