LocaleNames 48.1.0
See the version list below for details.
dotnet add package LocaleNames --version 48.1.0
NuGet\Install-Package LocaleNames -Version 48.1.0
<PackageReference Include="LocaleNames" Version="48.1.0" />
<PackageVersion Include="LocaleNames" Version="48.1.0" />
<PackageReference Include="LocaleNames" />
paket add LocaleNames --version 48.1.0
#r "nuget: LocaleNames, 48.1.0"
#:package LocaleNames@48.1.0
#addin nuget:?package=LocaleNames&version=48.1.0
#tool nuget:?package=LocaleNames&version=48.1.0
LocaleNames
Names of languages, countries and currencies in almost any language, for .NET. Look a name up by its code, or a code by its name.
The data comes from Unicode CLDR, is embedded in the package, and needs no network access or OS culture data. Targets netstandard2.0, net8.0 and net10.0.
Install
dotnet add package LocaleNames
LocaleNames is a meta package that references two others, which you can use on their own:
| Package | Contents |
|---|---|
LocaleNames.Core |
The code. Contains no data. |
LocaleNames.Data |
The CLDR data, embedded in an assembly. |
LocaleNames.Embed |
Build-time alternative to LocaleNames.Data, see below. |
Embedding the data into your own assembly
Reference LocaleNames.Embed instead of LocaleNames.Data and the data is embedded into your assembly during the build, so no extra assembly is deployed. You can embed only the locales you need:
<PropertyGroup>
<LocaleNamesEmbedLocales>cs;en;en_GB</LocaleNamesEmbedLocales>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LocaleNames.Embed" Version="..." />
</ItemGroup>
LocaleNames.Core finds the resources in loaded assemblies marked by the package. The mark is an assembly attribute generated by the SDK, so it is missing when GenerateAssemblyInfo is false. In that case, when you use LocaleNames.Core with LocaleNames.Embed (not the full LocaleNames or LocaleNames.Data), register the assembly yourself, once at startup, before the first lookup:
LocaleResourceProvider.Register(typeof(SomeTypeInYourAssembly).Assembly);
With the full LocaleNames package no registration is needed, LocaleNames.Data is found on its own. A registered assembly is searched before it, so registering one there deliberately overrides the data in LocaleNames.Data.
Usage
Get a translations object for the language you want the names in, then query it.
var cs = LocaleTranslationsFactory.ForLanguageCode("cs-CZ");
var en = LocaleTranslationsFactory.ForCultureInfo(new CultureInfo("en-US"));
Languages
en.FindLanguageName("cs-CZ"); // Czech (Czechia)
en.FindLanguageCode("Czech"); // cs
en.AllLanguageCodes;
Countries
en.FindCountryName("DE"); // Germany
en.FindCountryCode("Germany"); // DE
en.AllCountryCodes;
Currencies
cs.FindCurrencyName("CZK"); // česká koruna
cs.FindCurrencyName("CZK", PluralCategory.Few); // české koruny
cs.FindCurrencyPluralNames("CZK"); // all plural forms
cs.FindCurrencyCode("česká koruna"); // CZK
en.FindCurrencySymbol("CZK"); // CZK
en.FindCurrencySymbol("CZK", AltVariant.Narrow); // Kč
en.GetAllCurrencyCodes();
Contributing
Issues and pull requests are welcome. See CONTRIBUTING.md.
Activity
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- LocaleNames.Core (>= 48.1.0)
- LocaleNames.Data (>= 48.1.0)
-
net10.0
- LocaleNames.Core (>= 48.1.0)
- LocaleNames.Data (>= 48.1.0)
-
net8.0
- LocaleNames.Core (>= 48.1.0)
- LocaleNames.Data (>= 48.1.0)
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 |
|---|---|---|
| 48.1.1 | 290 | 10/8/2026 |
| 48.1.0 | 215 | 10/6/2026 |
| 48.0.1 | 109 | 10/4/2026 |
| 48.0.0 | 105 | 10/3/2026 |
| 47.0.0 | 72,608 | 5/4/2025 |
| 45.0.0 | 41,262 | 7/7/2024 |
| 43.0.0 | 60,597 | 7/3/2023 |
| 42.0.1 | 7,551 | 12/6/2022 |
| 41.0.1 | 3,305 | 10/17/2022 |
| 41.0.0 | 1,394 | 4/19/2022 |
| 40.0.0 | 2,423 | 11/9/2021 |
| 39.0.5 | 690 | 10/21/2021 |
| 39.0.4 | 611 | 10/15/2021 |
| 39.0.3 | 622 | 9/10/2021 |
| 39.0.2 | 560 | 7/20/2021 |
| 39.0.1 | 539 | 5/12/2021 |
| 39.0.0 | 582 | 5/11/2021 |
| 37.1.3 | 682 | 3/2/2021 |