use rust_shared::i18n::*;

include!(concat!(env!("OUT_DIR"), "/translations.rs"));

use color_eyre::Result;
use std::sync::Once;

static INIT: Once = Once::new();

/// Initialize the i18n system with the TgBot API implementation
pub fn init_i18n() -> Result<()> {
    INIT.call_once(|| {
        let _ = init_translation_dictionary();
    });
    Ok(())
}

/// Preload all translations found in the codebase at compile time
pub async fn preload_all_translations() -> Result<()> {
    init_i18n()?;
    preload_translations_from_keys(get_all_translation_keys).await
}