use rust_shared::i18n::{
    Language, LanguageContext, provide_language_context, 
    get_current_language, set_current_language
};
use rust_shared::t8r;

fn main() {
    let context = LanguageContext::new();
    
    provide_language_context(context.clone());
    
    set_current_language(Language::Ru);
    
    println!("Current language: {:?}", get_current_language());
    
    let greeting = t8r!("Hello, world!");
    println!("Greeting: {}", greeting);
    
    let custom_msg = t8r!("Welcome to VProxy", "welcome-msg");
    println!("Custom message: {}", custom_msg);
    
    set_current_language(Language::En);
    println!("Switched to: {:?}", get_current_language());
    
    let greeting_en = t8r!("Hello, world!");
    println!("English greeting: {}", greeting_en);
    
    context.add_listener(|lang| {
        println!("Language changed to: {:?}", lang);
    });
    
    context.set_language(Language::Ru);
}
