Beizsoft.Text 1.0.0-rc2

This is a prerelease version of Beizsoft.Text.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Beizsoft.Text --version 1.0.0-rc2
NuGet\Install-Package Beizsoft.Text -Version 1.0.0-rc2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Beizsoft.Text" Version="1.0.0-rc2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Beizsoft.Text --version 1.0.0-rc2
#r "nuget: Beizsoft.Text, 1.0.0-rc2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Beizsoft.Text as a Cake Addin
#addin nuget:?package=Beizsoft.Text&version=1.0.0-rc2&prerelease

// Install Beizsoft.Text as a Cake Tool
#tool nuget:?package=Beizsoft.Text&version=1.0.0-rc2&prerelease

Beizsoft.Text

A simple .NET string localization base library using Names as language and text resource keys.

Comes with BasicLanguage and BasicLanguageManager implementations which use a dictionary under-the-hood, with the ILanguage, ILanguageManager interfaces providing a consistent API, and LanguageManagerBase providing an easily-extensible abstract base class to work with.

An ILanguage has a Name and exposes a bool TryGetText(Name name, out string value) method, while ILanguageManager handles changing the current language bool TrySetLanguage(Name langugage, out ILanguage language), a way of querying available languages IEnumerable<Name> Languages { get; } & bool TryGetLanguage(Name langugage, out ILanguage language) and knowledge of what the currently active language is ILanguage CurrentLanguage { get; }.

There are two approaches to localization enabled by the ILanguageManager.

  • bool TryGetText(Name name, out string text)
    • Returns false if the current language has no entry for the requested text resource.
    • text always has a value; when true, it is localized string associated with name for the current language and, when false, is simply name.ToString() for a fallback.
  • string GetText(Name name)
    • Always returns a string, either the localized version associated with name for the current language, or name.ToString() as a fallback.

LanguageManagerBase has one abstract property, and two abstract methods:

  • IEnumerable<Name> Languages { get; }
    • Requires an actual implementation, used to query available languages.
  • bool TryGetLanguage(Name name, out ILanguage<TStringComparer> language)
    • Requires an actual implementation, used to query and change languages.
  • void AfterChangingLanguage(ILanguage oldLanguage, ILanguage newLanguage)
    • Can have a noop implementation; called after a language has been changed.
    • Only called when the language is actually changed; is not called if the specified language cannot be found, or if the specified language is already the current language.

All other members are pre-implemented on LangaugeManagerBase. This class can be used to quickly implement a language manager using any storage mechanism you like.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated