rust_widgets 2.5.2

Pure Rust cross-platform native GUI library with hardware-adaptive rendering, 180 widgets, touch/gesture support, i18n, and SVG-pipeline-accurate output
// SPDX-FileCopyrightText: Copyright (c) 2026 Mike Li/Mikewolfli/Wei Li(mikewolfli@163.com)
// SPDX-License-Identifier: MIT

//! i18n options - configuration and initialization types

// `String`/`Vec` resolve through the `compat` bridge rather than the prelude,
// which `#![no_std]` removes on the `mini` profile. `MiniToString` supplies the
// `ToString` trait, which the no-std prelude does not carry either.
use crate::compat::{MiniToString, String, Vec};

/// Initialization options for i18n system
#[derive(Debug, Clone)]
pub struct InitOptions {
    /// Language code (e.g., "en", "zh", "ja")
    pub language: String,
    /// Directory containing translation files
    pub preload_dir: Option<String>,
    /// Enable diagnostics output
    pub diagnostics: bool,
}
impl Default for InitOptions {
    fn default() -> Self {
        Self { language: "en".to_string(), preload_dir: None, diagnostics: false }
    }
}
/// Initialization report
#[derive(Debug, Clone)]
pub struct InitReport {
    /// Number of translation files loaded
    pub files_loaded: usize,
    /// Total number of translations
    pub translations_count: usize,
    /// Any errors that occurred during initialization
    pub errors: Vec<String>,
}
impl InitReport {
    /// Create a new empty report
    pub fn new() -> Self {
        Self { files_loaded: 0, translations_count: 0, errors: Vec::new() }
    }
}
crate::impl_default_via_new!(InitReport);