Crates.io | langweave |
lib.rs | langweave |
version | 0.0.1 |
source | src |
created_at | 2024-10-19 23:29:46.69002 |
updated_at | 2024-10-19 23:29:46.69002 |
description | A Rust library for seamless internationalization (i18n) and localization. |
homepage | https://langweave.com/ |
repository | https://github.com/sebastienrousseau/langweave |
max_upload_size | |
id | 1415795 |
size | 110,266 |
LangWeave
A powerful Rust library for seamless internationalization and localization.
• Website • Documentation • Report Bug • Request Feature • Contributing Guidelines
langweave
is a robust Rust library that provides efficient internationalization and localization capabilities. Designed for applications requiring multi-language support, it offers fast language detection, fluid translations, and intuitive multilingual content management.
Add langweave
to your Cargo.toml
:
[dependencies]
langweave = "0.0.1"
Here's a basic example of how to use langweave
:
use langweave::language_detector::LanguageDetector;
use langweave::error::I18nError;
use langweave::language_detector_trait::LanguageDetectorTrait;
#[tokio::main]
async fn main() -> Result<(), I18nError> {
// Create a new language detector
let detector = LanguageDetector::new();
// Detect language
let lang = detector.detect_async("Hello, world!").await?;
println!("Detected language: {}", lang);
// Use the detected language for further processing
// (e.g., translation, localization)
Ok(())
}
This example demonstrates how to use LangWeave to detect the language of a given text.
For full API documentation, please visit docs.rs/langweave.
To explore more examples, clone the repository and run the following command:
cargo run --example example_name
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under either of
at your option.
Special thanks to all contributors who have helped build the langweave
library.