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:
parent
17b554d0dd
commit
4050ea8bfe
5 changed files with 31 additions and 10 deletions
|
|
@ -564,14 +564,13 @@ impl cosmic::Application for App {
|
|||
let mut column = widget::column::with_capacity(2).padding(16.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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue