SimpleLocalizations 1.1.0

dotnet add package SimpleLocalizations --version 1.1.0
                    
NuGet\Install-Package SimpleLocalizations -Version 1.1.0
                    
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="SimpleLocalizations" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleLocalizations" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SimpleLocalizations" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SimpleLocalizations --version 1.1.0
                    
#r "nuget: SimpleLocalizations, 1.1.0"
                    
#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.
#:package SimpleLocalizations@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SimpleLocalizations&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SimpleLocalizations&version=1.1.0
                    
Install as a Cake Tool

SimpleLocalizations 🌍

Platform NuGet Build License: MIT

Localized text whose identity is stored.

The problem

Most localization libraries answer one question: what does this string say in the reader's language.

This one answers a narrower one. Sometimes the text is also a key — a verdict is filed against a record's title, a rule matches on it, a database row points at it. Translate that text in place and every stored reference is orphaned. Not a crash; a quieter kind of wrong.

So this library keeps three rules, and makes the compiler hold them for you:

Rule What it means
Keys are identity The neutral English is what you store. The reader's culture is resolved later, from the key.
The .resx is the only declaration A generator turns it into typed members, so a renamed key moves its callers and a deleted one stops compiling.
The vocabulary is closed An analyzer refuses a key invented at a call site — it would resolve to no text and read as a finished record.

Install

dotnet add package SimpleLocalizations

Quick start

1. Point at a .resx. That is the whole declaration — every setting defaults from the file.

<ItemGroup>
  <VocabularyResource Include="Strings.resx" />
</ItemGroup>

2. Author the words, keyed lowercase. The <comment> becomes the generated member's XmlDoc.

<data name="greeting" xml:space="preserve">
  <value>Hello, {0}</value>
  <comment>Becomes the generated member's XmlDoc.</comment>
</data>

3. Name the member, never the key.

var text = StringsKeys.Catalog(new TextCultures("en-US", "sv-SE"));

text.Get(StringsKeys.Greeting);                // "Hello, {0}" for an English reader, "Hej, {0}" for a Swedish reader
text.Format(StringsKeys.Greeting, "world");    // "Hello, world", or "Hej, world" for a Swedish reader
text.Neutral(StringsKeys.Greeting, "world");   // "Hello, world" whoever is reading — what you persist

StringsKeys is generated from Strings.resx. The class name, namespace, resource name and key type all follow the file, and each one is overridable.

Adding a language? Drop in Strings.sv-SE.resx holding only the entries Swedish spells differently. A culture file is an override list, not a copy.

That is the whole of the simple path.

Documentation

Guide Read it for
Typed keys Text that is an identity: giving a key its own type, and the set it is filed under.
Declaring a vocabulary Every VocabularyResource setting, what gets generated, and the one non-obvious constraint.
Diagnostics SL1001SL1016: what each refuses, and which to make fatal.
Scope What this package leaves to you, and why it ships a list formatter.

Icon

The package icon is the "globe showing Europe-Africa" emoji from Google's Noto Emoji, used unmodified under the Apache License 2.0. It is licensed separately from the source code above — see THIRD-PARTY-NOTICES.md.

Package maintainer

https://github.com/svenrog

Change log

Changes are documented in CHANGELOG.md.

License

MIT.

Product 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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  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 tizen40 was computed.  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.
  • .NETStandard 2.0

    • No dependencies.

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
1.1.0 105 8/13/2026
1.0.0 525 8/1/2026
0.3.0 114 7/31/2026
0.2.0 98 7/31/2026
0.1.0 107 7/31/2026