I3status-rust: Time module does not respect locale

Created on 22 Jul 2017  路  6Comments  路  Source: greshake/i3status-rust

I use a different time locale with setting LC_TIME in /etc/locale.conf. The status bar is ignoring this and showing the day of the week and the name of the month (%A and %B options) in English while the same formatting options in my terminal does not show it in English.

I looked at your code, but as I am not that familiar with Rust, I cannot tell if the problem is in your code or if the problem is upstream in that chrono does not provide this option. If the latter is the case, please excuse for me raising the problem here and feel free to close it.

bug help wanted

All 6 comments

Well, all the formatting is done by the chrono crate, and I have't given much thought to locales so far. Maybe you can investigate whether this is a missing feature/bug in chrono/bug in the time block?

I forgot to answer here. It seems like it should be able by combining the chrono crate with the locale crate, the problem is however that on rust-locale it says "This version is mostly useless. Major rewrite is pending for version 0.3.".

So I guess that for the moment it is a "won't fix" situation.

FYI Chrono now supports localisation (https://github.com/chronotope/chrono/pull/453)

We still have to get LC_TIME ourselves though. Or add another option to the time block to specify the locale.

https://crates.io/crates/locale_config maybe this could be useful?

@oschoudhury This should be fixed in #863. For now you'll have to manually specify your locale in the config but in the future it could be made to retrieve your system LC_TIME by default.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

concatime picture concatime  路  4Comments

kepi picture kepi  路  7Comments

Thra11 picture Thra11  路  6Comments

YodaEmbedding picture YodaEmbedding  路  4Comments

l4l picture l4l  路  6Comments