From 03f38fdc3bd45962be8555e50f18fd7761c17989 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 20 Jan 2026 03:38:27 +0100 Subject: more ui refactor --- ui/src/format.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ui/src/format.rs') 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 */ -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" ); } -- cgit v1.3