AStarDev.Localization
0.1.0
dotnet add package AStarDev.Localization --version 0.1.0
NuGet\Install-Package AStarDev.Localization -Version 0.1.0
<PackageReference Include="AStarDev.Localization" Version="0.1.0" />
<PackageVersion Include="AStarDev.Localization" Version="0.1.0" />
<PackageReference Include="AStarDev.Localization" />
paket add AStarDev.Localization --version 0.1.0
#r "nuget: AStarDev.Localization, 0.1.0"
#:package AStarDev.Localization@0.1.0
#addin nuget:?package=AStarDev.Localization&version=0.1.0
#tool nuget:?package=AStarDev.Localization&version=0.1.0
AStarDev.Localization
JSON-file localisation for AStar Development desktop apps.
Usage
Embed one JSON file per culture in your app at
Assets/Localization/{culture}.json:<EmbeddedResource Include="Assets\Localization\*.json" />{ "locale": "en-GB", "App.Title": "My app", "Greeting": "Hello, {0}" }Register the service, passing the assembly that holds the files:
services.AddLocalizationService(typeof(App).Assembly, new CultureInfo("en-GB"));Read text through
ILocalizationService:localization.GetLocal("App.Title"); localization.GetLocal("Greeting", userName);
A missing key returns the key itself, so the UI never shows blank text. If the requested culture has no file, the service falls back to the two-letter language, then to en-GB.
Culture switching
SetCultureAsync loads the new culture and raises CultureChanged. Derive view models that display text from LocalizedObservableObject: it raises PropertyChanged for all properties when the culture changes, and holds only a weak subscription, so short-lived view models are not kept alive.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- CommunityToolkit.Mvvm (>= 8.4.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AStarDev.Localization:
| Package | Downloads |
|---|---|
|
AStarDev.VelopackPublishingAvalonia
Shared Avalonia update-available dialog, view model, and notification services for AStar Development desktop apps, built on AStar.Dev.Velopack.Publishing. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 63 | 11/18/2026 |
v0.1.0 feat(localization): extract localisation service into AStarDev.Localization package
v0.1.0 feat(localization): extract localisation service from AStarDev.OneDriveSyncClient