daydream

A small matrix web client written in rust
git clone git://archive.git.mtrnord.blog/daydream-mx/daydream.git
Log | Files | Refs | README | LICENSE

app.rs (1025B)


      1 #![recursion_limit = "1024"]
      2 extern crate console_error_panic_hook;
      3 //extern crate wee_alloc;
      4 use console_error_panic_hook::set_once as set_panic_hook;
      5 use i18n_embed::{language_loader, I18nEmbed, WebLanguageRequester};
      6 use rust_embed::RustEmbed;
      7 
      8 #[derive(RustEmbed, I18nEmbed)]
      9 #[folder = "i18n/mo"] // path to the compiled localization resources
     10 struct Translations;
     11 
     12 language_loader!(DaydreamLanguageLoader);
     13 
     14 //#[global_allocator]
     15 //static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
     16 
     17 fn main() {
     18     // If the `console_error_panic_hook` feature is enabled this will set a panic hook, otherwise
     19     // it will do nothing.
     20     set_panic_hook();
     21     wasm_logger::init(wasm_logger::Config::default());
     22 
     23     let translations = Translations {};
     24     let language_loader = DaydreamLanguageLoader::new();
     25     let requested_languages = WebLanguageRequester::requested_languages();
     26 
     27     i18n_embed::select(&language_loader, &translations, &requested_languages).unwrap();
     28 
     29     yew::start_app::<daydream::app::App>();
     30 }