pkar.Localize
1.0.2
Prefix Reserved
dotnet add package pkar.Localize --version 1.0.2
NuGet\Install-Package pkar.Localize -Version 1.0.2
<PackageReference Include="pkar.Localize" Version="1.0.2" />
<PackageVersion Include="pkar.Localize" Version="1.0.2" />
<PackageReference Include="pkar.Localize" />
paket add pkar.Localize --version 1.0.2
#r "nuget: pkar.Localize, 1.0.2"
#:package pkar.Localize@1.0.2
#addin nuget:?package=pkar.Localize&version=1.0.2
#tool nuget:?package=pkar.Localize&version=1.0.2
This Nuget helps me dealing with localizing software - it's role is to being one, common interface for all UI modes (UWP, WPF, Uno, MAUI...). You can use it directly, or use it via my UI nugets.
Initializing
Before use, you should initialize library in code with sequence similar to this:
Localize.InitResMan(resPrefix = "res:", fallbackReplacePrefix = "") // localize strings prefixed with resPrefix; if no localized replacement is defined, return same string with prefix changed to fallback
Localize.AddResMan("en", resourcemanagerEn, true) // add first resource manager, for 'en' language, and this is default resource manager (if no resman for selected language exist). 'en' is as TwoLetterISOLanguageName
Localize.AddResMan("pl", My.Resources.Resource_PL.ResourceManager) // add other resource managers
...
Localize.SelectCurrentLang // select resource manager for CurrentCulture (without it, default resman would be used)
Check if initialized
Localize.GetResManCount() As Integer
Localize.IsInitialized() As Boolean
Retrieving one string
Localize.GetResManString(sResID , sDefault = "") // returns localized string, or default
Localize.TryGetResManString(inputString , sDefault = "")
// if inputString is not prefixed with resPrefix from InitResMan, then return original string;
// else, if inputString (with stripped resPrefix) is found in current ResMan, returns localized string;
// else (if not found), returns default (if not empty), or inputString with resPrefix changed to fallbackPrefix
Set texts in UI (in any object)
Localize.SetPropertiesUsingObjectName(anyObject)
// if object has Property "name", try to get every String property from ResMan, using GetResManString. resId is constructed same as in UWP: object name "." property name
Localize.SetPrefixedProperties(anyObject)
// try to localize all String properties of object, using has Property "name", try to get every String property from ResMan, using TryGetResManString
how to use it in your XAML code
using object name
XAML: <TextBox Name="uiTBox" ...>
res: uiTBox.Text="some localized text"
.Net: Localize.SetPropertiesUsingObjectName(uiTBox)
using text values
XAML: <TextBox Text="res:pagetitle" ...>
res: pagetitle="some localized text"
.Net: Localize.SetPrefixedProperties(uiTBox)
other methods
Localize.IsCurrentLang(lang = "en") // simple check which lang is used
Localize.LangOverride(forceLanguage) // overriding current language; returns language previously used. Call without parameter to return to resman used before Override
Localize.ResManOverride(forceResMan) // overriding ResMan; returns language previously used; Call without parameter to return to resman used before Override
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.4 is compatible. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 1.4
- NETStandard.Library (>= 1.6.1)
- pkar.DotNetExts (>= 1.2.5)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on pkar.Localize:
Package | Downloads |
---|---|
pkar.Uwp.Extensions
Several extensions of UWP classes |
|
pkar.Wpf.Extensions
This Nuget adds UI extensions for WPF, similar to my other Nuget: pkar.Uwp.Extensions |
|
pkar.UWP.Toasts
some wrappers to make toasts using simpler |
|
pkar.WPF.toasts
some wrappers to make toasts using simpler |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.2 | 224 | 8/5/2025 |