Globetrotter 1.0.1

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

Globetrotter

Culture-aware term resolution for ASP.NET Core. Globetrotter reads the caller's culture from a request header and resolves translated terms from a JSON-backed dictionary, all wired through your app's DI container.

Install

dotnet add package Globetrotter

Setup

In Program.cs:

using Globetrotter.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);

builder.Services
    .AddGlobetrotterConfigs(builder.Configuration)
    .AddGlobetrotterDefaultServices();

AddGlobetrotterConfigs binds a Culture section from configuration (or pass a section name / Action<CultureOptions> to configure inline). AddGlobetrotterDefaultServices registers the default ICultureCodeProvider, ITermProvider, and ICulturalTermProvider implementations.

In appsettings.json:

{
  "Culture": {
    "DefaultCulture": "en-US",
    "CultureHeader": "x-culture",
    "DefaultTranslationFile": "translations.json"
  }
}

And a translations file matching that path:

{
  "Translations": {
    "en-US": { "greeting": "Hello" },
    "fr-FR": { "greeting": "Bonjour" }
  }
}

Usage

Inject ICulturalTermProvider wherever you need a translated term. The culture is resolved automatically from the configured request header (falling back to DefaultCulture when absent):

public class GreetingController(ICulturalTermProvider terms) : ControllerBase
{
    [HttpGet("greeting")]
    public async Task<IActionResult> Get(CancellationToken cancellationToken)
        => Ok(await terms.GetTermAsync("greeting", cancellationToken));
}

A request with header x-culture: fr-FR returns Bonjour; a request with no header returns the term for DefaultCulture.

Core interfaces

Interface Responsibility
ICultureCodeProvider Resolves the current request's culture code
ITermProvider Looks up a term for a given culture code + key
ICulturalTermProvider Combines the two above into a single per-request term lookup

Swap in your own implementation of any of these — for example, a database-backed ITermProvider — by registering it before calling AddGlobetrotterDefaultServices, or by registering your own service after it to override the default.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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 119 7/12/2026
1.0.0 114 7/12/2026