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.
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.
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.
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);
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.
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}"); };
34+ supported languages.
Comprehensive language coverage including CJK scripts, RTL languages, and all major European languages.
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.
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.
Key classes & methods.
Core components for building translation pipelines.
TextTranslation
Main class for text translation and language detection with sync and async methods.
Language
Enumeration defining all 34+ supported languages for translation and detection.
Confidence
Property returning the confidence score from the most recent language detection.
GetLanguageDetectionTrainingData
Retrieve training data for fine-tuning language detection models from built-in datasets.
Build it. Read it. Try it.
Working console demos on GitHub, step-by-step how-to guides on the docs site, and the API reference for the classes used on this page.
Text translator
Console demo: translate text across 100+ languages on-device.
Open on GitHub → SampleText translator walkthrough
Step-by-step doc page: prerequisites, setup, code path, expected output.
Read on docs → How-to guideTranslate and localize content
Patterns for chunking, glossary preservation, quality control.
Read the guide → How-to guideBuild a multilingual audio translation pipeline
Combine STT + translation for real-time multilingual workflows.
Read the guide →Ready to build multilingual applications?
Break language barriers with on-device AI translation. 100% local, 100% your infrastructure.