You are not logged in.

#1 2022-06-09 17:21:11

stlab
Member
Registered: 2022-06-09
Posts: 6

[SOLVED] Weird date format in ls -la for pl_PL.UTF-8

Hi,
I am playing with Arch as I want to leave Ubuntu and its snap nonsense. I have problem with weird date format in ls -la output.

Output in Ubuntu

drwxr-xr-x  38 root root  4096 maj 18 19:57 .
drwxr-xr-x 281 root root 12288 maj 22 13:14 ..
drwxr-xr-x  14 root root  4096 maj  1 18:09 Adwaita
drwxr-xr-x   2 root root  4096 lip 31  2020 default
drwxr-xr-x   3 root root  4096 lip 31  2020 DMZ-Black
drwxr-xr-x   3 root root  4096 lip 31  2020 DMZ-White
drwxr-xr-x   3 root root  4096 maj  1 18:12 gnome

Output in Arch

drwxr-xr-x 1 root root   66 06-08 22:58 .
drwxr-xr-x 1 root root 3906 06-09 09:01 ..
drwxr-xr-x 1 root root  222 06-08 19:50 Adwaita
drwxr-xr-x 1 root root   22 06-08 19:50 default
drwxr-xr-x 1 root root   34 06-08 22:58 gnome

LANG variables have the same values in both systems

LANG=en_US.UTF-8
LC_TIME=pl_PL.UTF-8
LC_ALL=
LANGUAGE=

Why I can't see the short name of months in Arch as in Ubuntu?

Last edited by stlab (2022-06-10 06:19:52)

Offline

#2 2022-06-09 17:33:20

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

What's the output of...

alias ls

on both systems?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-06-09 18:30:11

stlab
Member
Registered: 2022-06-09
Posts: 6

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

 alias ls='ls --color=auto'

Both on Ubuntu and Arch

Offline

#4 2022-06-09 18:36:11

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

Did you generate the pl_PL.UTF-8 locale on Arch?

Offline

#5 2022-06-09 18:57:16

stlab
Member
Registered: 2022-06-09
Posts: 6

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

Yes, exactly as described here - https://wiki.archlinux.org/title/locale

Offline

#6 2022-06-09 19:45:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

locale
locale -a
echo $TIME_STYLE

Offline

#7 2022-06-09 20:12:35

stlab
Member
Registered: 2022-06-09
Posts: 6

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=pl_PL.UTF-8
LC_TIME=pl_PL.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pl_PL.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pl_PL.UTF-8
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=pl_PL.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
locale -a
C
C.UTF-8
de_DE.utf8
en_US.utf8
pl_PL.utf8
POSIX
echo $TIME_STYLE

Offline

#8 2022-06-09 20:32:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

Does

LC_TIME=C ls -la

get you a normal date format?

Offline

#9 2022-06-09 21:01:21

stlab
Member
Registered: 2022-06-09
Posts: 6

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

Yes,

export LC_TIME=en_US.UTF-8
ls -la
total 0
drwxr-xr-x 1 root root   66 Jun  8 22:58 .
drwxr-xr-x 1 root root 3906 Jun  9 09:01 ..
drwxr-xr-x 1 root root  222 Jun  8 19:50 Adwaita
drwxr-xr-x 1 root root   22 Jun  8 19:50 default
drwxr-xr-x 1 root root   34 Jun  8 22:58 gnome
export LC_TIME=C
ls -la
total 0
drwxr-xr-x 1 root root   66 Jun  8 22:58 .
drwxr-xr-x 1 root root 3906 Jun  9 09:01 ..
drwxr-xr-x 1 root root  222 Jun  8 19:50 Adwaita
drwxr-xr-x 1 root root   22 Jun  8 19:50 default
drwxr-xr-x 1 root root   34 Jun  8 22:58 gnome
export LC_TIME=de_DE.UTF-8
ls -la
total 0
drwxr-xr-x 1 root root   66  8. Jun 22:58 .
drwxr-xr-x 1 root root 3906  9. Jun 09:01 ..
drwxr-xr-x 1 root root  222  8. Jun 19:50 Adwaita
drwxr-xr-x 1 root root   22  8. Jun 19:50 default
drwxr-xr-x 1 root root   34  8. Jun 22:58 gnome

Offline

#10 2022-06-09 21:34:33

progandy
Member
Registered: 2012-05-17
Posts: 5,319

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

Edit: I can reproduce with pl_PL... see the following response by seth

Last edited by progandy (2022-06-09 21:39:27)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#11 2022-06-09 21:36:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

The polish locale indeed has this format
http://translationproject.org/PO-files/ … pre1.pl.po
http://translationproject.org/PO-files/ … 1.90.pl.po

Search for "TRANSLATORS: ls output needs to be aligned for ease of reading"
"Why" the translator chose this format, I've no idea - but ubuntu might have patched this downstream.

Offline

#12 2022-06-10 06:18:42

stlab
Member
Registered: 2022-06-09
Posts: 6

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

ok, I'm guessing these lines I can blame for

#: src/ls.c:793
msgid "%b %e %H:%M"
msgstr "%m-%d %H:%M"

I have made a quick test with Live CD of Fedora 36 and Debian 11 with the same results as on Arch. It seems Ubuntu has been patched.

seth, thanks a lot for the deep investigation.
The good news is that not my fault smile

Is it possible for me to submit the bug ticket somewhere so the maintainers of translation could explain why they have choosen such a weird format?

Offline

#13 2022-06-10 06:24:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

http://translationproject.org/team/pl.html
Mailing list or coreutils translator directly, I guess (don't know their etiquette)

Offline

#14 2022-06-10 13:39:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,582

Re: [SOLVED] Weird date format in ls -la for pl_PL.UTF-8

addendum: in case this results in a patriotic battle over the proper time format, you can just export TIME_STYLE (check the ls manpage) to enforce a preferred format.

Offline

Board footer

Powered by FluxBB