lexicore 1.0.1

dotnet add package lexicore --version 1.0.1
                    
NuGet\Install-Package lexicore -Version 1.0.1
                    
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="lexicore" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="lexicore" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="lexicore" />
                    
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 lexicore --version 1.0.1
                    
#r "nuget: lexicore, 1.0.1"
                    
#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 lexicore@1.0.1
                    
#: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=lexicore&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=lexicore&version=1.0.1
                    
Install as a Cake Tool

LexiCore.

NuGet Version Build Status

LexiCore is a lightweight, database-driven localization engine for modern .NET applications. It replaces static .resx files with a dynamic Entity Framework Core backend, features an embedded React UI for managing translations on the fly, and uses DotLiquid templating for powerful, variable-driven localization strings.

✨ Features

  • Drop-in Replacement: Fully implements IStringLocalizer and IStringLocalizerFactory.
  • Database Driven: Backed by Entity Framework Core (SQL Server, Postgres, SQLite, etc.).
  • Embedded UI: Includes a beautiful, embedded React dashboard (Dark/Light mode, Monaco Editor) to manage keys—no separate deployment required.
  • High Performance: Aggressively caches translations using IMemoryCache to prevent database hits on every request.
  • DotLiquid Templating: Go beyond string.Format. Use Liquid syntax (e.g., Hello {{ user.name }}!) for complex, logical string templates.

📦 Installation

Install the package via the NuGet Package Manager or the .NET CLI:

dotnet add package LexiCore

🚀 Getting Started

1. Register Services

In your Program.cs, add LexiCore to your DI container and configure your DbContext.

using LexiCore;
using Microsoft.EntityFrameworkCore;
using System.Globalization;

var builder = WebApplication.CreateBuilder(args);

// Add LexiCore
builder.Services.AddLexiCore(options =>
{
    // Define the cultures your app supports
    options.SupportedCultures = new[]
    {
        new CultureInfo("en-US"),
        new CultureInfo("es-ES"),
        new CultureInfo("fr-FR")
    };

    // Configure the EF Core database provider
    options.ConfigureDbContext = db =>
        db.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"));
});

2. Configure the Pipeline

Set up the database, the API endpoints, and the embedded UI middleware.

var app = builder.Build();

// Ensure the LexiCore database tables are created
await app.InitializeLexiCoreDatabaseAsync();

// Map the API endpoints used by the React UI
app.MapLexiCoreApi();

// Serve the embedded React UI
app.UseLexiCoreUI("/lexi-core-ui");

app.Run();

💻 Usage

Accessing the Dashboard

Run your application and navigate to https://localhost:<port>/lexi-core-ui. From here, you can:

  • Create and edit translation keys.
  • Write DotLiquid templates with a live preview.
  • Deprecate/Archive old keys.
  • Export and import translations.

Using Translations in Code

Because LexiCore implements Microsoft's standard localization interfaces, you use it exactly like you normally would.

In an API Controller or Minimal API:

app.MapGet("/greeting", (IStringLocalizer localizer) =>
{
    // Simple key lookup
    return localizer["welcome_message"].Value;
});

Using DotLiquid Variables: If your translation value in the database is Welcome to the app, {{ name }}! You have {{ points }} points., you can pass arguments to it:

app.MapGet("/user-greeting", (IStringLocalizer localizer) =>
{
    // LexiCore will automatically parse the anonymous object into the DotLiquid template
    return localizer["user_greeting", new { name = "Alex", points = 150 }].Value;
});

🛠️ Local Development

If you want to clone this repository and build LexiCore from source:

Prerequisites

Building the UI

The React frontend is embedded into the .NET assembly. You must build the UI before running the .NET project, or the UI middleware will fail.

cd src/ClientApp
npm install
npm run build

Running the Tests

LexiCore has a robust test suite covering both the frontend (Vitest) and the backend (xUnit).

Run Frontend Tests:

cd src/ClientApp
npx vitest run

Run Backend Tests:

dotnet test
Product 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. 
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
1.0.1 32 4/4/2026
1.0.0.2 77 3/29/2026
1.0.0.1 69 3/29/2026
1.0.0 68 3/29/2026