Giter Club home page Giter Club logo

episerver-localization-editor's Introduction

Localization Editor

The purpose of LocalizationEditor is to supply UI for managing localizations in Episerver. Editor can be installed using Nuget: https://www.myget.org/feed/solita-episerver/package/nuget/Solita.LocalizationEditor.UI .

Defining Categorys/Localizations:

```C#
    public class Localizations
    {
		[LocalizationCategory("Common", 100)]
		public static class Common
		{
			[Localization(Description = "myCompany", DefaultValue = "myCompany")]
			public const string Sitename = "/common/sitename";
		}
	}
```

Localization categorys and strings are visible in the left handside in the editor:

Image of Yaktocat

The localizations values(listed in the table, in the image) are read from xml file, using MediaData(blobs) as data-access technology.

The localizations are retrieved in .cshtml files like this:

```html
    <p>Localization editor Blob storage test: @Html.Translate("/common/languagemenufi")</p>
```

Solita.LocalizationEditor.TestProject Up&Running:(using translation /common/languagemenufi)

Image of Yaktocat

Features

  • Edit localizations
  • Export localizations to CSV format
  • Import localizations from CSV/XML format
  • Set default values for localizations

Migration from 1.0 -> 1.1

  • Export localizations to csv file(use the export button)
  • Update localizationEditor from nuget
  • Import localizations from the exported csv -> Save
  • Alternativelly you can import localizations from xml file(episerver localization file)

How it works:

  • Load all translation categorys and localizations to from assemblys loaded in app domain(classes decorated with Category attribute or fields decorated with Localization attribute)
    • Example of defining categorys/localizations: Solita.LocalizationEditor.TestEpiProject\Localizations.cs
    • Category is registered using attribute [LocalizationCategory("category name", "")], where = order number
    • Localization is registered using attribute [Localization(Description="xxx" DefaultValue = "xxx")]
  • Load the xml file that contains localizations, using given FileAccessStrategy implementation(defined in controller LocalizationEditorController.cs)
  • Render the lcoalization values from xml to html table
  • After localizations have been modified and Save functionality is called, a new xml file is created to blob storage

Further development

  • Build solution using configuration DevDeploy
    • DevDeploy configuration packages Solita.LocalizationEditor.UI project
    • Copies the required build artifacts to Solita.LocalizationEditor.TestEpiProject project
    • This way changes in the localizationEditor project are available immediatelly in the test project after build

Tests

All unit tests should be green. Otherwise there is something wrong with core functionalities

Build targets

Custom build targets are defined in Solita.LocalizationEditor.UI.csproj file(in the end). The custom build targets are activated only if "DevDeploy" configuration is selected

Notice

When Episerver.Framework is updated to version >= 9, loading epi site will throw "NullReference" Exception if there is custom VPP-configurations defined in web.config

Performance

UI is updated with JQuery at the moment, manipulating dom directly. When using large datasets for localizations, UI freezes when invoking functionalities like Revert, import, export, or set default values. Replacing dom manipulation with databinding could be something to look at in the future releases(knockout or reactjs for example)

episerver-localization-editor's People

Contributors

kallemarsolita avatar rinorragi avatar tanemann avatar tommiseppanen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

episerver-localization-editor's Issues

Translations missing from the XML import

I tried importing translations from the XML file. It brought some translations, but for some reason some translations were missing. CSV import worked fine. Better check the code for XML import one more time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.