diff options
| -rw-r--r-- | swaystatus/Cargo.toml | 2 | ||||
| -rw-r--r-- | swaystatus/src/main.rs | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/swaystatus/Cargo.toml b/swaystatus/Cargo.toml index 4728f34..ce213ec 100644 --- a/swaystatus/Cargo.toml +++ b/swaystatus/Cargo.toml @@ -9,7 +9,7 @@ description = "Fully modular status bar text updater, similar to i3bar." [dependencies] crossbeam-utils = "0.8" -gettext-rs = "0.6.0" +gettext-rs = { version = "0.6.0", features = ["gettext-system"] } serde = { version = "1.0", features = ["derive"] } erased-serde = "0.3" toml = "0.5" diff --git a/swaystatus/src/main.rs b/swaystatus/src/main.rs index 90d861d..87608a9 100644 --- a/swaystatus/src/main.rs +++ b/swaystatus/src/main.rs @@ -9,12 +9,17 @@ extern crate gettextrs; use gettextrs::*; use crossbeam_utils::thread; use std::sync::mpsc; +use dirs; #[cfg(test)] pub mod test_plugin; fn main() { - if let Err(_e) = TextDomain::new("swaystatus").prepend("target").init() { + let text_domain = match dirs::data_dir() { + Some (p) => TextDomain::new("swaystatus").prepend("target").push(p), + None => TextDomain::new("swaystatus").prepend("target") + }; + if let Err(_e) = text_domain.init() { eprintln!("Localization could not be loaded. Will use English instead."); } let commandline_parameters = commandline::parse_commandline(); |
