Knowit.ContentTypeLocalizationProvider
1.0.2
See the version list below for details.
dotnet add package Knowit.ContentTypeLocalizationProvider --version 1.0.2
NuGet\Install-Package Knowit.ContentTypeLocalizationProvider -Version 1.0.2
<PackageReference Include="Knowit.ContentTypeLocalizationProvider" Version="1.0.2" />
<PackageVersion Include="Knowit.ContentTypeLocalizationProvider" Version="1.0.2" />
<PackageReference Include="Knowit.ContentTypeLocalizationProvider" />
paket add Knowit.ContentTypeLocalizationProvider --version 1.0.2
#r "nuget: Knowit.ContentTypeLocalizationProvider, 1.0.2"
#:package Knowit.ContentTypeLocalizationProvider@1.0.2
#addin nuget:?package=Knowit.ContentTypeLocalizationProvider&version=1.0.2
#tool nuget:?package=Knowit.ContentTypeLocalizationProvider&version=1.0.2
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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. |
-
net6.0
- EPiServer.CMS.Core (>= 12.0.3)
- EPiServer.Framework (>= 12.0.3)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.0.2
Bug fix - incorrect default content assembly name was used
1.0.1
Refactorings
1.0.0
First release