1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
mod application;
#[rustfmt::skip]
mod config;
mod locations;
mod window;
use gettextrs::{gettext, LocaleCategory};
use gtk::{gio, glib};
use self::application::ExampleApplication;
use self::config::{GETTEXT_PACKAGE, LOCALEDIR, RESOURCES_FILE};
fn main() -> glib::ExitCode {
// Initialize logger
tracing_subscriber::fmt::init();
// Prepare i18n
gettextrs::setlocale(LocaleCategory::LcAll, "");
gettextrs::bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind the text domain");
gettextrs::textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain");
glib::set_application_name(&gettext("Sunrise"));
let res = gio::Resource::load(RESOURCES_FILE).expect("Could not load gresource file");
gio::resources_register(&res);
let app = ExampleApplication::default();
app.run()
}