Solutions · Speech & Audio · Translation

AI-powered language translation for .NET.

Break language barriers with on-device AI translation. High-accuracy language detection, context-preserving translations, multimodal support, and 34+ languages. 100% local processing, zero cloud dependency.

34+ languages Multimodal detection Format preservation

Elevate your .NET apps with on-device AI translation.

The TextTranslation class preserves the original layout and formatting of input content while processing and translating. Language detection supports plain text, images, and attachments, enabling multimodal translation workflows.

New in 2026: TranslatorAgentTemplate for building agentic translation workflows. Combine with planning strategies, tool integration, and multi-agent orchestration for sophisticated multilingual processing pipelines.

Coverage

34+ languages

Support for major world languages including CJK, RTL scripts, and European languages.

Multimodal

Multimodal detection

Detect language from text, images, and document attachments with VLM integration.

Layout

Format preservation

Maintain original layout, structure, and formatting during translation.

Privacy

100% on-device

Complete privacy with local inference. Your data never leaves your infrastructure.

Language detection

Detect languages with high precision.

Multimodal language detection engine

Accuracy

High accuracy detection

Advanced AI models detect languages with high confidence across a wide range of languages and dialects.

Confidence

Confidence scoring

Access detailed confidence scores for each detection to handle ambiguous cases effectively.

Async

Async processing

Choose between DetectLanguage() and DetectLanguageAsync() for optimal performance.

Sets

Customizable language sets

Specify target languages for detection to optimize performance for your use case.

Detection methods

  • Synchronous language detection with optional candidate languages.
  • Detect language from image content using VLM.
  • Detect language from document attachments.
LanguageDetection.cs
using LMKit.Model;
using LMKit.Translation;
using LMKit.TextGeneration;

// Load the language model
var model = LM.LoadFromModelID("llama3.2:1b");
var translator = new TextTranslation(model);

// Detect language from text
string text = "Bonjour, comment allez-vous?";
Language detected = translator.DetectLanguage(text);

Console.WriteLine($"Detected: {detected}");
Console.WriteLine($"Confidence: {translator.Confidence:P1}");

// Detect from limited set for faster processing
var candidates = new List<Language>
{
    Language.English,
    Language.German,
    Language.French
};

string germanText = "Guten Morgen!";
Language result = translator.DetectLanguage(germanText, candidates);
// Output: German

// Async detection
var asyncResult = await translator.DetectLanguageAsync(text);
Text translation

Translate text while preserving context.

Seamlessly translate text between languages while maintaining original structure and formatting. Powered by sophisticated AI models for accurate, context-aware translations.

Context-aware translation engine

LM-Kit's Text Translation engine empowers your applications to translate text between languages seamlessly. Maintain the original structure and formatting while providing accurate translations, enhancing user experience in multilingual environments.

Powered by sophisticated AI models and LM-Kit's proprietary technologies, the TextTranslation engine delivers exceptional performance. It supports a vast array of languages and scripts, enabling you to handle diverse translation tasks with ease.

Enhance global reach

Break down language barriers to expand your application's global footprint.

Improve user experience

Provide content in users' preferred language, increasing engagement.

Automate processing

Streamline workflows by automating translation tasks.

Maintain data privacy

On-device processing ensures sensitive data never leaves your infrastructure.

Translation methods

  • Synchronous translation preserving original layout and formatting.
  • Asynchronous translation for non-blocking operations.
TextTranslation.cs
using LMKit.Model;
using LMKit.Translation;
using LMKit.TextGeneration;

// Load the language model
var model = LM.LoadFromModelID("llama3.2:1b");
var translator = new TextTranslation(model);

// Translate French to English
string french = @"Bonjour, comment vas-tu ?
J'ai rรฉcemment lu un article fascinant
sur l'impact de l'intelligence artificielle
sur la littรฉrature moderne. Qu'en penses-tu ?";

string english = translator.Translate(french, Language.English);

Console.WriteLine(english);
// "Hello, how are you? I recently read a
// fascinating article about the impact of
// artificial intelligence on modern literature.
// What do you think?"

// Async translation
var result = await translator.TranslateAsync(french, Language.Spanish);

// Event handling for completion
translator.AfterTextCompletion += (s, e) =>
{
    Console.WriteLine($"Completed: {e.Text}");
};
Coverage

34+ supported languages.

Comprehensive language coverage including CJK scripts, RTL languages, and all major European languages.

๐Ÿ‡บ๐Ÿ‡ธ English
๐Ÿ‡ซ๐Ÿ‡ท French
๐Ÿ‡ฉ๐Ÿ‡ช German
๐Ÿ‡ช๐Ÿ‡ธ Spanish
๐Ÿ‡ฎ๐Ÿ‡น Italian
๐Ÿ‡ต๐Ÿ‡น Portuguese
๐Ÿ‡ณ๐Ÿ‡ฑ Dutch
๐Ÿ‡ต๐Ÿ‡ฑ Polish
๐Ÿ‡ท๐Ÿ‡บ Russian
๐Ÿ‡บ๐Ÿ‡ฆ Ukrainian
๐Ÿ‡จ๐Ÿ‡ณ Chinese (Simplified)
๐Ÿ‡น๐Ÿ‡ผ Chinese (Traditional)
๐Ÿ‡ฏ๐Ÿ‡ต Japanese
๐Ÿ‡ฐ๐Ÿ‡ท Korean
๐Ÿ‡ธ๐Ÿ‡ฆ Arabic
๐Ÿ‡ฎ๐Ÿ‡ฑ Hebrew
๐Ÿ‡ฎ๐Ÿ‡ณ Hindi
๐Ÿ‡น๐Ÿ‡ญ Thai
๐Ÿ‡ป๐Ÿ‡ณ Vietnamese
๐Ÿ‡ฎ๐Ÿ‡ฉ Indonesian
๐Ÿ‡น๐Ÿ‡ท Turkish
๐Ÿ‡ฌ๐Ÿ‡ท Greek
๐Ÿ‡ธ๐Ÿ‡ช Swedish
๐Ÿ‡ณ๐Ÿ‡ด Norwegian
๐Ÿ‡ฉ๐Ÿ‡ฐ Danish
๐Ÿ‡ซ๐Ÿ‡ฎ Finnish
๐Ÿ‡จ๐Ÿ‡ฟ Czech
๐Ÿ‡ธ๐Ÿ‡ฐ Slovak
๐Ÿ‡ญ๐Ÿ‡บ Hungarian
๐Ÿ‡ท๐Ÿ‡ด Romanian
๐Ÿ‡ง๐Ÿ‡ฌ Bulgarian
๐Ÿ‡ญ๐Ÿ‡ท Croatian
๐Ÿ‡ท๐Ÿ‡ธ Serbian
๐Ÿ‡ฆ๐Ÿ‡ฒ Armenian
Agent template

TranslatorAgentTemplate.

Build sophisticated translation workflows with the new agent framework.

Agentic translation workflows

The TranslatorAgentTemplate is part of LM-Kit's 18 pre-built agent templates. Combine translation capabilities with planning strategies, tool integration, and multi-agent orchestration for sophisticated multilingual processing pipelines.

Use with PipelineOrchestrator for sequential translation workflows, or ParallelOrchestrator for batch processing multiple documents simultaneously.

TranslatorAgent.cs
using LMKit.Agents;
using LMKit.Agents.Templates;

// Create translator agent from template
var agent = AgentTemplates
    .TranslatorAgentTemplate()
    .WithModel(model)
    .Build();

// Execute translation task
var result = await agent.ExecuteAsync("Translate to Japanese: Hello world");

Console.WriteLine(result.Output);

Text translator demo.

Explore a working example demonstrating translation capabilities.

Sample

Text translator sample

The Text Translator Demo showcases how to utilize the LM-Kit.NET SDK for text translation tasks. This example demonstrates the integration of large language models into a .NET application to translate text across different languages, highlighting the versatility of advanced AI models in enabling multilingual communication.

View demo

Developer Resources

Key classes & methods.

Core components for building translation pipelines.

TextTranslation

Main class for text translation and language detection with sync and async methods.

View documentation

Language

Enumeration defining all 34+ supported languages for translation and detection.

View documentation

Confidence

Property returning the confidence score from the most recent language detection.

View documentation

GetLanguageDetectionTrainingData

Retrieve training data for fine-tuning language detection models from built-in datasets.

View documentation

Ready to build multilingual applications?

Break language barriers with on-device AI translation. 100% local, 100% your infrastructure.

Download free API documentation