Skip to content

Commit

Permalink
feat: fmt + pub i18n instance
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Aug 12, 2024
1 parent b751c36 commit 8d9bc6d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/telegram/i18n/i18n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::language::Language;
use std::collections::HashMap;

#[derive(Debug, Clone, Default)]
struct I18n {
pub struct I18n {
users: HashMap<i64, String>,
pub languages: HashMap<String, Language>,
}
Expand Down Expand Up @@ -48,7 +48,7 @@ impl I18n {
mod test {
use super::*;

#[test]
#[test]
fn test_i18n_init() {
// Create instance and load locales
let mut i18n = I18n::new();
Expand All @@ -67,7 +67,7 @@ mod test {
let mut i18n = I18n::new();
i18n.load_translations();

//
//
i18n.add_user(123123123123, "en");

// Let's try sending request
Expand All @@ -76,4 +76,4 @@ mod test {
// Test
assert_eq!(translation, Some(&"ipsum shit".to_string()));
}
}
}
3 changes: 1 addition & 2 deletions src/telegram/i18n/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ impl Language {
}
}


#[cfg(test)]
mod tests {
use super::*;
Expand All @@ -55,4 +54,4 @@ mod tests {
// Test
assert_eq!(translation, Some(&"ipsum shit".to_string()));
}
}
}
1 change: 0 additions & 1 deletion src/telegram/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ pub mod i18n;
pub mod keyboard;
pub mod timer;
pub mod topic;

0 comments on commit 8d9bc6d

Please sign in to comment.