我在校对 coreutils 翻译的过程中,发现可以修改 ls -l 输出中的文件修改时间的格式,目前对两个 strftime 格式字符串的翻译和原文相同,在中文环境下可读性较差,也不符合上游源码注释中的要求[1]。之前有人提交过 bug 报告[2],但是有日本开发者指出 1. 要限制长度 2. 删除空格可能让依赖它的程序出错,后来就没有修改。不过在我看来,改为规范的中文时间格式最短只需要 14 字符宽度,相比英文原文 12 字符并没有明显加长;而且用脚本或程序处理 ls 命令的输出本来就不是规范的做法。所以打算修改为中文里的规范时间格式,如下(空格用_替代):
原文:Jan__1__2021(%b %e %Y)
旧译:_1月__1__2021(%b %e %Y)
新译:2021年_1月_1日(%Y年%b%e日)
原文:Feb 14 16:33(%b %e %H:%M)
旧译:_2月_14_16:33(%b %e %H:%M)
新译:_2月14日_16:33(%b%e日 %H:%M)
其他 CJK 语言译文中,韩语已经用了类似的译法,但在年月日之间都加了空格,总长度为 16。繁体中文和日语的译文同原文。
不知道各位觉得是否应该修改,或者有没有其他更好的写法?
[1] 上游源码:
static char const *long_time_format[2] =
{
/* strftime format for non-recent files (older than 6 months), in
-l output. This should contain the year, month and day (at
least), in an order that is understood by people in your
locale's territory. Please try to keep the number of used
screen columns small, because many people work in windows with
only 80 columns. But make this as wide as the other string
below, for recent files. */
/* TRANSLATORS: ls output needs to be aligned for ease of reading,
so be wary of using variable width fields from the locale.
Note %b is handled specially by ls and aligned correctly.
Note also that specifying a width as in %5b is erroneous as strftime
will count bytes rather than characters in multibyte locales. */
N_("%b %e %Y"),
/* strftime format for recent files (younger than 6 months), in -l
output. This should contain the month, day and time (at
least), in an order that is understood by people in your
locale's territory. Please try to keep the number of used
screen columns small, because many people work in windows with
only 80 columns. But make this as wide as the other string
above, for non-recent files. */
/* TRANSLATORS: ls output needs to be aligned for ease of reading,
so be wary of using variable width fields from the locale.
Note %b is handled specially by ls and aligned correctly.
Note also that specifying a width as in %5b is erroneous as strftime
will count bytes rather than characters in multibyte locales. */
N_("%b %e %H:%M")
};