Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time module does not respect locale #73

Closed
oschoudhury opened this issue Jul 22, 2017 · 6 comments · Fixed by #863
Closed

Time module does not respect locale #73

oschoudhury opened this issue Jul 22, 2017 · 6 comments · Fixed by #863

Comments

@oschoudhury
Copy link

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.

@greshake
Copy link
Owner

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?

@oschoudhury
Copy link
Author

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.

@ammgws
Copy link
Collaborator

ammgws commented Apr 22, 2020

Let's keep an eye on this: chronotope/chrono#199

@ammgws
Copy link
Collaborator

ammgws commented Jul 31, 2020

FYI Chrono now supports localisation (chronotope/chrono#453)

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

@cecton
Copy link

cecton commented Jul 31, 2020

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

ammgws added a commit to ammgws/i3status-rust that referenced this issue Oct 14, 2020
Resolves greshake#73 via config option.

TODO
- retrieve LC_TIME via env var or from the output of `locale`
- refactor code
- deserialisation support for Locale
ammgws added a commit to ammgws/i3status-rust that referenced this issue Oct 14, 2020
Resolves greshake#73 via a new config option.

TODO

    retrieve LC_TIME from env var or from the output of locale
    refactor code
    deserialisation support for Locale
ammgws added a commit to ammgws/i3status-rust that referenced this issue Oct 14, 2020
Resolves greshake#73 via a new config option.

TODO

    retrieve LC_TIME from env var or from the output of locale
    refactor code
    deserialisation support for Locale
@ammgws
Copy link
Collaborator

ammgws commented Oct 14, 2020

@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.

ammgws added a commit to ammgws/i3status-rust that referenced this issue Oct 14, 2020
Resolves greshake#73 via a new config option.

TODO

    retrieve LC_TIME from env var or from the output of locale
    refactor code
    deserialisation support for Locale
barskern pushed a commit to barskern/i3status-rust that referenced this issue Oct 24, 2020
Resolves greshake#73 via a new config option.

TODO

    retrieve LC_TIME from env var or from the output of locale
    refactor code
    deserialisation support for Locale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants