Knowit.ContentTypeLocalizationProvider 2.0.0

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

Knowit.ContentTypeLocalizationProvider

Optimizely localization provider that provides automatically generated localization keys for content types (Pages, Blocks, Media etc.) which can be used to localize content types with Knowit.ResourceEditor.

Installation:

dotnet add package Knowit.ContentTypeLocalizationProvider --source https://www.myget.org/F/creuna-nuget/api/v3/index.json
After installation:
  • Open Startup.cs
  • Register ContentTypeLocalizationProvider services with extension method AddContentTypeLocalizationProvider
  • Add name for registered localization providers passing it as parameter to methods AddEmbeddedLocalization/AddLocalizationProvider

example:

    public void ConfigureServices(IServiceCollection services)
    {
        if (_webHostingEnvironment.IsDevelopment())
        {
            AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(_webHostingEnvironment.ContentRootPath, "App_Data"));

            services.Configure<SchedulerOptions>(options => options.Enabled = false);
        }

        services
            .AddCmsAspNetIdentity<ApplicationUser>()
            .AddCms()
            .AddAdminUserRegistration()
            ;

        services
            .AddContentTypeLocalizationProvider()
            .AddLocalizationProvider<ContentTypeLocalizationProvider>("ContentTypeLocalizationProvider");
    }
  • Configure ContentTypeLocalizationProvider via code implementing configuratoin action

example:

    services.AddContentTypeLocalizationProvider(options =>
        {
            options.ContentCultureName = "en";
            options.ContentAssemblyNames = new List<string>
            {
                typeof(Startup).Assembly.GetName().Name!
            };
        });

or/and configure via 'appsettings.json' (configuration in appSettings.json has highest proirty over configuration in code)

example:

    "ContentTypeLocalizationProvider": {
        "ContentCulture": "en", // Content culture name. By default 'en' is used
        "ContentAssemblyNames": [
          "WebSiteName" // Assembly names containing content types. By default executing Web App assembly is used
        ]
        "TranslateContentGroups": "false", // Specifies if content groups should be translated; Default is 'true'
        "TranslateContentTypes": "false", // Specifies if content types should be translated; Default is 'true'
        "TranslateCategories": "false" // Specifies if categories should be translated; Default is 'true'
      }
  • Update ResourceEditor configuration - add ContentTypeLocalizationProvider in 'DefaultResourceProviders' (not required): example:
    services.AddResourceEditor(options =>
    {
        options.DefaultResourceProviders = new List<string>
        {
            ...,
            "ContentTypeLocalizationProvider",
            ...
        };
        ...
    });

How to use

Content groups, content types and categories can be translated in Resource Editor

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
2.0.0 314 5/4/2026
1.0.2 90 5/4/2026

2.0.0
       Target framework is updated to .net 8.0

       1.0.2
       Bug fix - incorrect default content assembly name was used

       1.0.1
       Refactorings

       1.0.0
       First release