🚧 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
- translord
- The core library
- translord.DeepL
- Library containing DeepL API configuration for texts translation in translord.
- translord.EntityFramework
- Library containing configuration data that uses EntityFramework as its database abstraction.
- translord.EntityFramework.Postgres
- Library extending the
translord.EntityFramework
library with Postgres configuration.
- Library extending the
- translord.Manager
- Library containing the TMS admin panel allowing for translations editing/management/translation.
- translord.RedisCache
- Library containing configuration for Redis as the cache for translord.
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;
});
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();
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);
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.
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>();
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",
...
}
translord.demo.mp4
Please check examples folder for example projects using translord to manage translations.
- modularity
- easy configuration
- storing (EF Core/Postgres/File)
- DeepL translations
- CMS-like panel
- import of existing translations
- caching (using Redis)
- examples
- AI based translations
- role-based access to the CMS panel
- translations revision
- IdentityServer (as for config and ease of use)
- Serilog (as for modularity, structure)
Feel free to add issues with suggestions.