2009/3/15 Eric Blake <[email protected]>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Stéphane Raimbault on 3/14/2009 6:57 PM:
>> Hi,
>>
>> It's not possible to translate this string in French and to keep the
>> columns aligned because in French the month abbreviations are variable
>> from 3 to 5 characters:
>
> GNU strftime obeys POSIX 2008, and thus allows for width modifiers.
> Therefore, you can write things like %5b to write the month abbreviation
> that will occupy 5 spaces, which takes care of adding extra spacing for
> short months while still allowing the a fixed-width date string to have
> nice overall alignment.  However, if all of the entries have a short
> month, it still results in a larger spacing in the middle of the date, but
> I'm not sure how easy it would be to patch the code to handle
> adaptive-width date strings.

Yes, it's a nice and easy solution but I've already tried to use %5b
without success on my system:
gcc 4.3.2
glibc 2.8 (may 2008)

gcc complains
warning: field width used with ‘%b’ strftime format

                if (strftime(outstr, sizeof(outstr), "%5b", tmp) == 0) {
                        fprintf(stderr, "1 - strftime returned 0");
                        exit(EXIT_FAILURE);
                }
                printf("Month:|%s|", outstr);

And the output doesn't have extra spacing when the string contains a
French accent (bug spotted?):
LC_TIME in french:
Month:|janv.|
Month:|févr.|
Month:| mars|
Month:|avril|
Month:|  mai|
Month:| juin|
Month:|juil.|
Month:|août|
Month:|sept.|
Month:| oct.|
Month:| nov.|
Month:|déc.|

Same problem when I do the change in coreutils (master).


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to