diff --git a/src/main.rs b/src/main.rs index b6c0432..6343757 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,6 @@ +//! CAI-Watchdog is a lightweigth watchdog for *nix and Windows +//! Author: Alexander I. Chebykin (CAI) + #[macro_use] extern crate ini; extern crate exitcode; diff --git a/src/mod_fs.rs b/src/mod_fs.rs index 8c855be..d9ad40f 100644 --- a/src/mod_fs.rs +++ b/src/mod_fs.rs @@ -1,3 +1,6 @@ +//! CAI-Watchdog filesystem module +//! Author: Alexander I. Chebykin (CAI) + use std::env; use std::path::PathBuf; diff --git a/src/mod_locales.rs b/src/mod_locales.rs index ed6e64e..414c343 100644 --- a/src/mod_locales.rs +++ b/src/mod_locales.rs @@ -1,3 +1,8 @@ +//! CAI-Watchdog localization module +//! Author: Alexander I. Chebykin (CAI) +//! +//! External localizations stored in /locales/ directory + use std::borrow::Borrow; use std::path::Path; @@ -162,6 +167,18 @@ impl Locale { } } + /// Return object with locale data + /// + /// If there is no localization file for current system locale, fallback (English) locale will be returned + /// + /// # Example + /// + /// ``` + /// let locale = mod_locales::Locale::new(); + /// + /// println!("\u{26a0} {}! {}.", locale.t().error, locale.t().cant_find_config_file); + /// println!("{}", locale.t().exiting); + /// ``` pub fn t(&self) -> &Lang { return self.locale.borrow().clone(); }