Skip to content

translord - simple TMS to get your translations up and running in no time.

License

Notifications You must be signed in to change notification settings

margosmat/translord

Repository files navigation

translord


Nuget

NuGet Version NuGet Version NuGet Version NuGet Version NuGet Version NuGet Version


translord


translord - simple TMS to get your translations up and running in no time.

🚧 Project still in the early stages of development

What this tool aims to achieve? To be a central place in your project that handles all things related to your translations:

  • storing
  • translating
  • delivering
  • management
  • revision

Packages

Configuration examples

WebApp with FileStore

builder.Services.AddTranslordFileStore(options =>
{
    options.TranslationsPath = Path.Combine(Directory.GetCurrentDirectory(), "translations");
});
builder.Services.AddTranslord(o =>
{
    List<Language> supportedLanguages = [Language.English, Language.Polish, Language.German];
    o.SupportedLanguages = supportedLanguages;
});

WebApp with PostgresStore and TMS panel

builder.Services.AddTranslordPostgresStore(options =>
    options.ConnectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? string.Empty);
builder.Services.AddTranslord(o =>
{
    List<Language> supportedLanguages = [Language.English, Language.Polish, Language.German];
    o.SupportedLanguages = supportedLanguages;
});
builder.AddTranslordManager();

Console app with FileStore

List<Language> supportedLanguages = [ Language.English, Language.Polish ];
var path = Path.Combine(Directory.GetCurrentDirectory(), "translations");
var deeplTranslator = new DeepLTranslator(new AddTranslordDeepLTranslatorOptions { AuthKey = "your-auth-key" });
var translator =
    new TranslatorConfiguration(
        new TranslatorConfigurationOptions { SupportedLanguages = supportedLanguages, DefaultLanguage = Language.English },
        new FileStore(new FileStoreOptions { TranslationsPath = path }, null),
        deeplTranslator).CreateTranslator();

var label = await translator.GetTranslation("label.test", Language.Polish);
var translations = await translator.GetAllTranslations(Language.English);

FileStore

Core translord package contains the FileStore implementation. The only requirement is the TranslationsPath for the FileStore to load the translations from. Be sure that the directory exists, otherwise FileStore will throw an error.

Custom implementations

You can configure your own custom implementations for the store, cache or translator in translord. Just implement specific interface and be sure to register it in DI:

builder.Services.AddTranslordCustomStore<CustomTranslationsStore>();
builder.Services.AddTranslordCustomCache<CustomTranslationsCache>();
builder.Services.AddTranslordCustomTranslator<CustomTranslationsTranslator>();

Import

For now, you can import your translations in one specific way. You need one .json file per language, with root object containing string key-value pairs of your translations. In the future there could be more import schemas added, please add an issue if you need support for specific import schema. Example of json that can be imported now:

{
    "label.add": "add",
    "label.delete": "delete",
    ...
}

TMS panel

TMS panel screenshot

Demo

translord.demo.mp4

Examples

Please check examples folder for example projects using translord to manage translations.

Features

  • modularity
  • easy configuration
  • storing (EF Core/Postgres/File)
  • DeepL translations
  • CMS-like panel
  • import of existing translations
  • caching (using Redis)
  • examples

Ideas for the next features

  • AI based translations
  • role-based access to the CMS panel
  • translations revision

Inspiration

  • IdentityServer (as for config and ease of use)
  • Serilog (as for modularity, structure)

Support

Feel free to add issues with suggestions.

About

translord - simple TMS to get your translations up and running in no time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages