Localize date strings

Mostly closes: #103

Analogous to my other patches that localize date strings (e.g.
pop-os/cosmic-files#277).

The "password:" prompt is not localized in this patch because PAM should
yield translated strings on its own. This needs further investigation.
This commit is contained in:
Josh Megnauth 2024-08-27 08:39:16 -04:00 committed by Josh Megnauth
parent 17b554d0dd
commit 4050ea8bfe
No known key found for this signature in database
GPG key ID: 70813183462EFAD3
5 changed files with 31 additions and 10 deletions

View file

@ -912,14 +912,13 @@ impl cosmic::Application for App {
let mut column = widget::column::with_capacity(2).padding(16.0).spacing(12.0);
let dt = chrono::Local::now();
let locale = *crate::localize::LANGUAGE_CHRONO;
//TODO: localized format
let date = dt.format("%A, %B %-d");
let date = dt.format_localized("%A, %B %-d", locale);
column = column
.push(widget::text::title2(format!("{}", date)).style(style::Text::Accent));
//TODO: localized format
let time = dt.format("%R");
let time = dt.format_localized("%R", locale);
column = column.push(
widget::text(format!("{}", time))
.size(112.0)