1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-26 01:15:37 +00:00

[date] elinks-date-format.patch from PLD

This commit is contained in:
Witold Filipczyk 2021-11-03 10:47:39 +01:00
parent 26a319e581
commit 01675c6270
3 changed files with 20 additions and 9 deletions

View File

@ -7413,6 +7413,18 @@ msgstr "~Pełny ekran"
msgid "~BeOS terminal"
msgstr "Terminal ~BeOS"
#: src/protocol/ftp/ftp.c:1160 src/util/file.c:464
msgid "%b %e %Y"
msgstr "%e.%m.%Y "
#: src/protocol/ftp/ftp.c:1162 src/util/file.c:466
msgid "%b %e %H:%M"
msgstr "%e.%m %H:%M"
#: src/protocol/ftp/ftp.c:1165 src/protocol/ftp/ftp.c:1172 src/util/file.c:473
msgid " "
msgstr " "
#. name:
#: src/protocol/auth/auth.c:332
msgid "Authentication"

View File

@ -1237,7 +1237,7 @@ display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries,
/* LC_TIME=fi_FI.UTF_8 can generate "elo___ 31 23:59"
* where each _ denotes U+00A0 encoded as 0xC2 0xA0,
* thus needing a 19-byte buffer. */
char date[80];
char date[MAX_STR_LEN];
int wr;
if (ftp_info->local_time_zone)
@ -1247,16 +1247,16 @@ display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries,
if (current_time > when + 6L * 30L * 24L * 60L * 60L
|| current_time < when - 60L * 60L)
fmt = "%b %e %Y";
fmt = gettext("%b %e %Y");
else
fmt = "%b %e %H:%M";
fmt = gettext("%b %e %H:%M");
wr = strftime(date, sizeof(date), fmt, when_tm);
add_cp_html_to_string(&string, format->libc_codepage,
date, wr);
} else
#endif
add_to_string(&string, " ");
add_to_string(&string, gettext(" "));
/* TODO: Above, the number of spaces might not match the width
* of the string generated by strftime. It depends on the
* locale. So if ELinks knows the timestamps of some FTP
@ -1270,8 +1270,6 @@ display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries,
* Any solution chosen here should also be applied to the
* file: protocol handler. */
add_char_to_string(&string, ' ');
if (ftp_info->type == FTP_FILE_DIRECTORY && format->colorize_dir) {
add_to_string(&string, "<font color=\"");
add_to_string(&string, format->dircolor);

View File

@ -4,6 +4,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include "intl/libintl.h"
#include "util/conv.h"
#include "util/string.h"
@ -252,16 +253,16 @@ stat_date(struct string *string, struct stat *stp)
if (current_time > when + 6L * 30L * 24L * 60L * 60L
|| current_time < when - 60L * 60L)
fmt = "%b %e %Y";
fmt = gettext("%b %e %Y");
else
fmt = "%b %e %H:%M";
fmt = gettext("%b %e %H:%M");
add_date_to_string(string, fmt, &when);
add_char_to_string(string, ' ');
return;
}
#endif
add_to_string(string, " ");
add_to_string(string, gettext(" "));
}
#ifdef __cplusplus