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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
#![cfg_attr(not(feature = "std"), no_std)] //!Simple library for localization. //! [![Current Crates.io Version](https://img.shields.io/crates/v/localizer.svg)](https://crates.io/crates/localizer) //! [![Document](https://img.shields.io/badge/doc-localizer-green.svg)](https://docs.rs/localizer) //! # no unsafe code //! # Example: //! ``` //! use localizer::*; //! const langs_file : &str = " //! [langs.ru] //! \"ex1\" = \"ПРН{}\" //! //! [langs.en] //! \"ex1\" = \"IKA{}\""; //! localizer::set_loc_string(langs_file); //! //localizator::set_localizer(Localizer::create().file(None).current_lang(Some("ru".to_string()))); //! localizer::change_localizer(&|x|{x.set_current_lang(Some("ru".to_string()));}); //! println!("{:?}", localizer::get_by_key(&"ex1")); //! let loc = Localizer::create().file(None).current_lang(Some("ru".to_string())); //! println!("{:?}", loc.get(&"ex1")); //! ``` //! //! //! # Further examples: //! > cargo run --example %example% //! ## 1: //! [ex1](https://github.com/PSL9902/localizer/blob/master/examples/ex1.rs) //! ## 2: //! [ex2](https://github.com/PSL9902/localizer/blob/master/examples/ex2.rs) //! ## 3: //! [Tic_Tac_Toe game1](https://github.com/PSL9902/localizer/blob/master/examples/tic-tac-toe.rs) //! [Tic_Tac_Toe game2](https://github.com/PSL9902/rust_Tic_Tac_Toe/tree/master) //! # No-Std: //! > feature = "no_std" //! ## Cargo.toml: //! > localizer = {version = ..., default-features = false, features = ["no_std"]} pub mod constants; pub mod structs; pub use structs::localizer::Localizer; pub mod enums; pub mod prelude; pub use prelude::*; pub mod error; pub use error::Error; #[cfg(feature = "format")] pub mod formatter; //#[cfg(feature = "format")] //pub use form::*; pub mod traits; pub use traits::{FnUser}; impl<T> traits::FnUser for T {} //#[cfg(not(feature = "no_std"))] //use enums::standart::res_keeper;