Knowit.ResourceEditor
3.0.0
dotnet add package Knowit.ResourceEditor --version 3.0.0
NuGet\Install-Package Knowit.ResourceEditor -Version 3.0.0
<PackageReference Include="Knowit.ResourceEditor" Version="3.0.0" />
<PackageVersion Include="Knowit.ResourceEditor" Version="3.0.0" />
<PackageReference Include="Knowit.ResourceEditor" />
paket add Knowit.ResourceEditor --version 3.0.0
#r "nuget: Knowit.ResourceEditor, 3.0.0"
#:package Knowit.ResourceEditor@3.0.0
#addin nuget:?package=Knowit.ResourceEditor&version=3.0.0
#tool nuget:?package=Knowit.ResourceEditor&version=3.0.0
Knowit Resource Editor
Installation
Knowit.ResourceEditor provides a UI for Optimizely editors to translate (or override existing translations) for resource strings. In order to install Resource Editor use the following command:
> dotnet add package Knowit.ResourceEditor --source https://www.myget.org/F/creuna-nuget/api/v3/index.json
After installation:
- Open Startup.cs
- Register Resource Editor services with extension method
AddResourceEditor - 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.AddResourceEditor();
services
.AddEmbeddedLocalization<Startup>("Site translations")
;
}
- Initialize ResourceEditor components with extension method
UseResourceEditor,
example:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseResourceEditor();
app.UseEndpoints(endpoints =>
{
endpoints.MapContent();
});
}
- Configure Resource Editor via code implementing configuratoin action (by default "WebAdmins" required role is used)
example:
services.AddResourceEditor(configurePolicy => configurePolicy.RequireRole("Administrators"), options =>
{
options.DefaultResourceProviders = new List<string>
{
"Site translations" //NOTE: Registered localization providers' names should be used here.
};
options.DefaultFromLanguage = "en";
options.DefaultToLanguage = "no";
});
}
or/and configure via 'appsettings.json' (configuration in appSettings.json has highest proirty over configuration in code)
example:
"ResourceEditor": {
"DefaultResourceProviders":
[
"EmbeddedXmlLocalization"
],
"DefaultPageSize": "200",
"DefaultModeIsSimple": "true",
"DefaultSortField": "From",
"DefaultIsAscending": "false",
"DefaultFromLanguage": "en",
"DefaultToLanguage": "no"
"AutoSaveInterval": "15000",
"TranslationsFileNameFormat": "translations_{0}.xml",
"TranslationsArchiveFileName": "translations.zip",
}
How to use
ResourceEditor can be found under edit mode Main Menu → Resource Editor
Common scenarios
Translate resources
- Select From and To languages
- Optionally add a search phrase and press Load button. Leave search phrase empty to load all resources
- When resources are loaded
- Use To column to add translation and press Enter, Tab or mouse click to next resource in order to save changes. Check Status column to ensure changes are saved
- Use local filtering (heading of each column)
- Sorting
NOTE: There is a toggle Hide translated/Show overridden that can be useful when already translated needs to be hidden or otherwise show translated only. By default, none of them is checked. When this filter is changed resources must be reloaded by pressing Load button
Edit resources
In order to edit existing or previously added translations set From and To languages to a needed language. Use To column for editing.
Advanced scenarios
Configuration
Commonly used providers must be configured in Startup.cs. Usually there are built-in providers like EPiServerShellModulesResources, EPiServerShellProductModulesResources etc. that doesn’t need to be translated and therefore must be hidden by default. Settings->Resource providers in the advanced panel allow to temporary enable them and translate/change.
Export/Import
This function might be useful when changes are done in one environment and then needs to be moved to another for instance from Staging to Production or otherwise when Staging needs to be refreshed from Production.
- Export All - Exports all resources regardless applied filter
- Export Filtered - Exports all filtered. Only server filter is taken into account, local filters (heading of each column) are ignored
- When resources are imported all existing are overwritten so be careful with import in production environment and do a backup using Export All
| Product | Versions 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. |
-
net8.0
- EPiServer.CMS.UI.Core (>= 12.25.1)
- SharpZipLib (>= 1.3.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
3.0.0
Target framework is updated to .net 8.0
2.1.2
Small UI fixes, separate settings to higlight translations changed via Resource Editor, link to Rsource Editor moved to global CMS menu to be at the same place with other custom plugins.
2.1.1
Fixed caching in distributed environment(more then one app/node)
2.1.0
New place in menu (fix for new Shell UI)
Creuna.ResourceEditor automatic data migration
2.0.0
New UI
1.0.4
Minor cleanup
1.0.3
Set fallback culture to EN with ignoring hosted site fallbacks; remove redundant file references after package installation
1.0.2
Bug fix (incorrect CurrentCulture was used for 'From' text translation)
1.0.1
ReadMe configuratoin updates
1.0.0
First release