Hi,

This bug is related with "ls -l" command. «ls -l» time style is defined here https://github.com/coreutils/coreutils/blob/master/src/ls.c#L773, and here https://github.com/coreutils/coreutils/blob/master/src/ls.c#L786 .

Default/source English uses US "month followed by day" style ("%b %e %Y" and "%b %e %H:%M"). These time-style format strings are locale dependent, and time-style is provided by localization po files available here https://translationproject.org/domain/coreutils.html . Each locale can define own time-style format, and many European locales use "day followed by month"

Example for German de.po (note relative position of %b (month) and %e (day) placeholders)

msgid "%b %e  %Y"
msgstr "%e. %b %Y "
--
msgid "%b %e %H:%M"
msgstr "%e. %b %H:%M"

Example for French fr.po (note relative position of %b (month) and %e (day) placeholders)

msgid "%b %e  %Y"
msgstr "%e %b  %Y"
--
msgid "%b %e %H:%M"
msgstr "%e %b %H:%M"


But these localization strings are simply ignored by "ls" command if coreutils.mo are not available on LC_TIME directory (current situation).

Run:

 touch test.txt && for i in {ca_ES,es_ES,fr_FR,de_DE,en_GB}; do echo "$i" && LC_ALL=$i.UTF-8 ls -l test.txt && echo;done

Output:

ca_ES
-rw-r--r-- 1 jmontane jmontane 0 de juny  23 09:37 test.txt

es_ES
-rw-r--r-- 1 jmontane jmontane 0 jun 23 09:37 test.txt

fr_FR
-rw-r--r-- 1 jmontane jmontane 0 juin  23 09:37 test.txt

de_DE
-rw-r--r-- 1 jmontane jmontane 0 Jun 23 09:37 test.txt

en_GB
-rw-r--r-- 1 jmontane jmontane 0 Jun 23 09:37 test.txt

Please, note that all locales outputs "%b %e"!!?


But If you just create links in LC_TIME dir targeting coreutils.mo at LC_MESSAGES (desired situation):

#  for i in {ca,es,fr,de,en_GB}; do echo "$i" && mkdir /usr/share/locale/$i/LC_TIME && ln -s /usr/share/locale/$i/LC_MESSAGES/coreutils.mo /usr/share/locale/$i/LC_TIME/coreutils.mo;done

Then running again:

touch test.txt && for i in {ca_ES,es_ES,fr_FR,de_DE,en_GB}; do echo "$i" && LC_ALL=$i.UTF-8 ls -l test.txt && echo;done

Outputs:

ca_ES
-rw-r--r-- 1 jmontane jmontane 0 23 juny 10:06 test.txt

es_ES
-rw-r--r-- 1 jmontane jmontane 0 jun 23 10:06 test.txt

fr_FR
-rw-r--r-- 1 jmontane jmontane 0 23 juin  10:06 test.txt

de_DE
-rw-r--r-- 1 jmontane jmontane 0 23. Jun 10:06 test.txt

en_GB
-rw-r--r-- 1 jmontane jmontane 0 Jun 23 10:06 test.txt


Please, note that 'ca', 'fr', and 'de' based locales output "day followed by month", because time-style format strings are honored now.

I've parsed coreutils translations from https://translationproject.org/domain/coreutils.html, there are 20 locales with affected strings don't starting "%b...":

bg, ca, cs, da, de, et, eu, fi, fr, gl, hu, ia, it, ko, lt, nl, pl, sr, sv, vi

So, at least these locales are impacted by this bug.


Thanks,

Joan

Reply via email to