aboutsummaryrefslogtreecommitdiff
path: root/ui/src/format.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-20 03:38:27 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-20 03:38:27 +0100
commit03f38fdc3bd45962be8555e50f18fd7761c17989 (patch)
tree6c81b060e548c9c85922949b5b8aa63ef364778f /ui/src/format.rs
parent508be3ef912572d958c8a2b995d4d1d4d1451b1d (diff)
downloadjellything-03f38fdc3bd45962be8555e50f18fd7761c17989.tar
jellything-03f38fdc3bd45962be8555e50f18fd7761c17989.tar.bz2
jellything-03f38fdc3bd45962be8555e50f18fd7761c17989.tar.zst
more ui refactor
Diffstat (limited to 'ui/src/format.rs')
-rw-r--r--ui/src/format.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/src/format.rs b/ui/src/format.rs
index 3b49695..11040de 100644
--- a/ui/src/format.rs
+++ b/ui/src/format.rs
@@ -4,13 +4,13 @@
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
-use jellycommon::LANG_ENG;
+use jellycommon::{LANG_ENG, Language};
-use crate::locale::{TrString, tr, trs};
+use crate::locale::tr;
use std::fmt::Write;
pub fn format_duration(d: f64) -> String {
- format_duration_mode(d, false, Language::English)
+ format_duration_mode(d, false, LANG_ENG.0)
}
pub fn format_duration_long(d: f64, lang: Language) -> String {
format_duration_mode(d, true, lang)
@@ -55,15 +55,15 @@ fn test_duration_short() {
#[test]
fn test_duration_long() {
assert_eq!(
- format_duration_long(61., LANG_ENG).as_str(),
+ format_duration_long(61., LANG_ENG.0).as_str(),
"1 minute and 1 second"
);
assert_eq!(
- format_duration_long(121., LANG_ENG).as_str(),
+ format_duration_long(121., LANG_ENG.0).as_str(),
"2 minutes and 1 second"
);
assert_eq!(
- format_duration_long(3661., LANG_ENG).as_str(),
+ format_duration_long(3661., LANG_ENG.0).as_str(),
"1 hour, 1 minute and 1 second"
);
}