eza-community / eza

A modern, maintained replacement for ls
https://eza.rocks
MIT License
9k stars 172 forks source link

bug: Chinese and Japanese missing padding on month #430

Open pickfire opened 9 months ago

pickfire commented 9 months ago

The month section in eza -l should have extra padding for chinese and japanese

> env LC_DATE=ja_JP.UTF-8 ls -l /
drwxr-xr-x   1 root root    28 2021年 2月27日 media
drwxr-xr-x   1 root root    16 2020年10月27日 mnt
> env LC_DATE=zh_CN.UTF-8 ls -l /
drwxr-xr-x   1 root root    28 2021年 2月27日 media
drwxr-xr-x   1 root root    16 2020年10月27日 mnt
> env LC_DATE=zh_CN.UTF-8 eza -l /
drwxr-xr-x - root 27 2月   2021 media
drwxr-xr-x - root 27 10月  2020 mnt
> env LC_DATE=ja_JP.UTF-8 eza -l /
drwxr-xr-x - root 27 2月   2021 media
drwxr-xr-x - root 27 10月  2020 mnt

As seen there, the 2月 should have been 2月.

Also, it is a bit weird such that the day comes before month, it should be year month day for chinese and japanese.

cafkafk commented 9 months ago

Your current command is insufficient for me to get japanese months:

✦ ❯ env LC_DATE=ja_JP.UTF-8 eza -l --no-user --no-permissions --no-filesize
27 Sep 02:59 benches
27 Sep 02:59 build.rs
27 Sep 05:44 Cargo.lock
27 Sep 02:59 Cargo.toml
27 Sep 02:59 CHANGELOG.md
11 Sep 18:54 cliff.toml
11 Sep 18:54 CODE_OF_CONDUCT.md
11 Sep 18:54 completions
16 Sep 15:15 CONTRIBUTING.md
11 Sep 18:54 deb.asc
23 Sep 05:13 deny.toml
22 Sep 12:58 devtools
12 Sep 09:55 dump
19 Sep 16:52 empty
16 Sep 15:15 flake.lock
27 Sep 02:41 flake.nix
25 Sep 11:51 Justfile
11 Sep 18:31 LICENCE
27 Sep 05:52 man
20 Sep 14:36 out.gif
27 Sep 05:52 README.md
27 Sep 03:03 result -> /nix/store/xrhwn9zywrf4v2wfi31xda2g0d45g6bh-eza-0.13.1
23 Sep 05:13 rust-toolchain.toml
27 Sep 05:52 rustfmt.toml
11 Sep 18:54 screenshots.png
11 Sep 18:54 SECURITY.md
23 Sep 05:13 snap
27 Sep 05:52 src
26 Sep 07:42 target
27 Sep 02:59 tests
27 Sep 10:38 treefmt.nix

Also eza shouldn't show groups by default, I'm assuming you have alias ls="eza --group" set?

ariasuni commented 9 months ago

With the ja_JP.UTF-8 locale generated, I could do:

$ env LC_ALL=ja_JP.UTF-8 eza -l --no-user --no-permissions --no-filesize ..
20  9月 18:33 ansiterm-rs
12  9月 00:25 exa
25  9月 16:22 eza
22  9月 23:35 eza-symlink -> eza
16  4月 19:51 florisboard
28  5月  2022 glitch-soc-docs
16  3月  2022 hunspell-inclusif
12  5月  2020 keyboard_generator
 1  5月 16:15 mastodon
10 11月  2020 mastodon_documentation
 1  5月 16:15 mdn_content
 1  5月 16:15 mozilla-unified
14  4月  2017 numtostr
 6  5月  2020 photon-icons
16 12月  2022 procps
 6  7月 04:54 rust-number-prefix
21  5月 19:22 rust-term-grid
21  5月 19:23 sutom
21  5月 19:23 tab-flip
21  5月 19:23 tabcenter-reborn
 8  9月 21:55 test
21  5月 19:24 www.rust-lang.org

I don’t understand why it doesn’t work like that on @pickfire’s computer.

Btw the order is wrong because we use a very basic algorithm for that and at the time, there wasn’t a good Rust library to do internationalization, I don’t know if there is now, but we should look at that at some point.

pickfire commented 9 months ago

Ah, I was taking files that was changed few years back so that's why the year is there, the ones you all have don't have the year because it's in the current year.

I did truncate the output a bit and only take two lines from it.

ariasuni commented 9 months ago

If you look at the output of my command, there’s indeed entry with years, e.g. procps or keyboard_generator. I don’t know why it’s different in your case, but I didn’t investigate yet.