Giter VIP home page Giter VIP logo

idee5.globalization's Introduction

idee5.Globalization

Database driven tools for .NET localization. But different.

Why another localizazion library?

The existing solutions are well suited for tailormade products or products without any modifcations for customers or groups of customers.

Every industry has its own parlance. The same thing has a different name and your customers might not understand you or your product.

Maybe you need to create custom versions for your customers industries. Keeping text in your UI in sync with all the versions can quickly create a lot of overhead.

Sometimes customers addiotionally have their own terminology. The mess is even growing.

This is why we created our own implementation of a database driven localization library.

What makes this library differnt?

This library supports parlances for industries and customers. Every resource can have:

  • a neutral version.
  • an industry version.
  • a customer version.

All hidden behind the standard .NET localization. There is no need to make big changes in your product. Only a little bit of configuration.

Getting started

There are three nuget packages available.

  1. idee5.Globalization. The minimum you need.
  2. dee5.Globalization.EFCore. An EF Core based implementation of the database layer.
  3. idee5.Globalization.WebApi. ASP.NET Core integration. Including api controllers for your own application.

The code below assumes you are using the .NET DI container.

Configure your Industry and customer

Using the Options pattern you are able to set the industry and/or customer. Both being null would be the neutral/standard version.

services.Configure<ExtendedLocalizationOptions>(o => {
    o.Customer = null;
    o.Industry = null;
});

In production you should use another configuration provider. E.g. appsettings.json

Register the EF Core module

Just replace the default StringLocalizerFactory.

// add the EF Core localization implementation
services.AddEFCoreLocalization(o => o.UseSqlite(new SimpleDB3ConnectionStringProvider().GetConnectionString("idee5.Resources.db3")));

Integrate the localization controllers

By adding the controllers you can use web api calls to read and mange your resources.

// add the localization controllers
services.AddMvc().AddLocalizationControllers();
// configure the authorization policy
services.AddAuthorizationBuilder()
    .AddPolicy("CommandPolicy", p => p.RequireAssertion(_ => true))
    .AddPolicy("QueryPolicy", p => p.RequireAssertion(_ => true));

Protecting the localization controllers from unauthorized access can be configured with the QueryPolicy and the CommandPolicy.

Managing the resources

For desktop applications we recommend using the commands and queries from idee5.Globalization directly.

For web applications we recommend the integration of the localization controllers from idee5.Globalization.WebApi into your application.

idee5.globalization's People

Contributors

bdongus avatar

Watchers

 avatar

idee5.globalization's Issues

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.