mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
1999-08-15 David Martin <dmartina@usa.net>
* gtkedit/edit.c: Print localized date with strftime() * src/boxes.c: (symlink_dialog): Move dialog misaligned elements * vfs/vfs.c (vfs_print_stats): Translate vfs stats * vfs/shared_ftp_fish.c (s_read, s_lseek): Mark strings for translation * vfs/fish.c: Translate messages * src/boxes.c: (symlink_dialog): Move dialog misaligned elements * src/cmd.c (get_random_hint): Look for localized hint files * lib/mc.hint.es: NEW FILE. Hints in Spanish flavour. 1999-08-15 Norbert Warmuth <nwarmuth@privat.circular.de> * src/cmd.c (guess_message_value): New function. Determine locale used for messages (get_random_hint): use guess_message_value * lib/Makefile.in: added mc.hint.es to LIBFILES_CONST
This commit is contained in:
parent
de9b574c35
commit
6fae3e0425
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
1999-08-15 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* lib/Makefile.in: added mc.hint.es to LIBFILES_CONST
|
||||
|
||||
1999-08-15 David Martin <dmartina@usa.net>
|
||||
|
||||
* gtkedit/edit.c: Print localized date with strftime()
|
||||
|
||||
* lib/mc.hint.es: NEW FILE. Hints in Spanish flavour.
|
||||
|
||||
1999-08-08 David Martin <dmartina@usa.net>
|
||||
|
||||
* gtkedit/syntax.c (upgrade_syntax_file): Mark error strings for
|
||||
|
@ -2305,9 +2305,12 @@ int edit_execute_cmd (WEdit * edit, int command, int char_for_insertion)
|
||||
break;
|
||||
|
||||
case CK_Date:{
|
||||
char s[1024];
|
||||
|
||||
time_t t;
|
||||
time (&t);
|
||||
edit_printf (edit, ctime (&t));
|
||||
strftime (s, 1024, "%c", localtime (&t));
|
||||
edit_printf (edit, s);
|
||||
edit->force |= REDRAW_PAGE;
|
||||
break;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
LIBFILES_IN = mc.ext.in mc-gnome.ext.in
|
||||
LIBFILES_OUT = mc.ext mc-gnome.ext
|
||||
LIBFILES_CONST = mc.hint mc.lib mc.menu
|
||||
LIBFILES_CONST = mc.hint mc.hint.es mc.lib mc.menu
|
||||
DESKTOP_FILES = startup.links README.desktop
|
||||
TIFILES = README.xterm linux.ti xterm.ad xterm.ti ansi.ti vt100.ti xterm.tcap
|
||||
|
||||
|
1910
po/es_ES.po
1910
po/es_ES.po
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,16 @@
|
||||
1999-08-15 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* cmd.c (guess_message_value): New function. Determine locale used
|
||||
for messages
|
||||
|
||||
(get_random_hint): use guess_message_value
|
||||
|
||||
1999-08-15 David Martin <dmartina@usa.net>
|
||||
|
||||
* boxes.c: (symlink_dialog): Move dialog misaligned elements
|
||||
|
||||
* cmd.c (get_random_hint): Look for localized hint files
|
||||
|
||||
1999-08-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* ext.c: Added missing include file.
|
||||
|
@ -785,10 +785,10 @@ symlink_dialog (char *existing, char *new, char **ret_existing, char **ret_new)
|
||||
#else
|
||||
#define INPUT_INDEX 0
|
||||
#endif
|
||||
{ quick_input, 6, 80, 5, 8, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-1" },
|
||||
{ quick_label, 6, 80, 4, 8, "", 0, 0, 0, 0, XV_WLAY_BELOWOF, "label-1" },
|
||||
{ quick_input, 6, 80, 3, 8, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-2" },
|
||||
{ quick_label, 6, 80, 2, 8, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-2" },
|
||||
{ quick_input, 4, 80, 5, 8, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-1" },
|
||||
{ quick_label, 4, 80, 4, 8, "", 0, 0, 0, 0, XV_WLAY_BELOWOF, "label-1" },
|
||||
{ quick_input, 4, 80, 3, 8, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-2" },
|
||||
{ quick_label, 4, 80, 2, 8, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-2" },
|
||||
{ 0 } };
|
||||
|
||||
Quick_input.xlen = 64;
|
||||
|
51
src/cmd.c
51
src/cmd.c
@ -1216,11 +1216,44 @@ void mkdir_panel_cmd (void)
|
||||
mkdir_cmd (cpanel);
|
||||
}
|
||||
|
||||
/* partly taken from dcgettect.c, returns "" for C locale */
|
||||
static const char *
|
||||
guess_message_value (void)
|
||||
{
|
||||
const char *retval;
|
||||
|
||||
/* The highest priority value is the `LANGUAGE' environment
|
||||
variable. This is a GNU extension. */
|
||||
retval = getenv ("LANGUAGE");
|
||||
if (retval != NULL && retval[0] != '\0')
|
||||
return retval;
|
||||
|
||||
/* Setting of LC_ALL overwrites all other. */
|
||||
retval = getenv ("LC_ALL");
|
||||
if (retval != NULL && retval[0] != '\0')
|
||||
return retval;
|
||||
|
||||
/* Next comes the name of the desired category. */
|
||||
retval = getenv ("LC_MESSAGE");
|
||||
if (retval != NULL && retval[0] != '\0')
|
||||
return retval;
|
||||
|
||||
/* Last possibility is the LANG environment variable. */
|
||||
retval = getenv ("LANG");
|
||||
if (retval != NULL && retval[0] != '\0')
|
||||
return retval;
|
||||
|
||||
/* We use C as the default domain. POSIX says this is implementation
|
||||
defined. */
|
||||
return "";
|
||||
|
||||
}
|
||||
/* Returns a random hint */
|
||||
char *get_random_hint (void)
|
||||
{
|
||||
char *data, *result, *eol;
|
||||
char *hintfile;
|
||||
char *hintfile_base, *hintfile;
|
||||
const char *lang;
|
||||
int len;
|
||||
int start;
|
||||
|
||||
@ -1244,9 +1277,23 @@ char *get_random_hint (void)
|
||||
last_sec = tv.tv_sec;
|
||||
#endif
|
||||
|
||||
hintfile = concat_dir_and_file (mc_home, MC_HINT);
|
||||
hintfile_base = concat_dir_and_file (mc_home, MC_HINT);
|
||||
lang = guess_message_value ();
|
||||
|
||||
hintfile = g_strdup_printf ("%s.%s", hintfile_base, lang);
|
||||
data = load_file (hintfile);
|
||||
g_free (hintfile);
|
||||
|
||||
if (!data) {
|
||||
hintfile = g_strdup_printf ("%s.%.2s", hintfile_base, lang);
|
||||
data = load_file (hintfile);
|
||||
g_free (hintfile);
|
||||
|
||||
if (!data)
|
||||
data = load_file (hintfile_base);
|
||||
}
|
||||
|
||||
g_free (hintfile_base);
|
||||
if (!data)
|
||||
return 0;
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
1999-08-15 David Martin <dmartina@usa.net>
|
||||
|
||||
* vfs.c (vfs_print_stats): Translate vfs stats
|
||||
|
||||
* shared_ftp_fish.c (s_read, s_lseek): Mark strings for translation
|
||||
|
||||
* fish.c: Translate messages
|
||||
|
||||
1999-08-06 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* tar.c (read_header): Don't segfault when a symlink points to the
|
||||
|
32
vfs/fish.c
32
vfs/fish.c
@ -133,7 +133,7 @@ static void
|
||||
free_archive (vfs *me, vfs_s_super *super)
|
||||
{
|
||||
if ((SUP.sockw != -1) || (SUP.sockr != -1)){
|
||||
print_vfs_message ("fish: Disconnecting from %s", super->name?super->name:"???");
|
||||
print_vfs_message (_("fish: Disconnecting from %s"), super->name?super->name:"???");
|
||||
command(me, super, NONE, "#BYE\nlogout\n");
|
||||
close(SUP.sockw);
|
||||
close(SUP.sockr);
|
||||
@ -211,7 +211,7 @@ open_archive_int (vfs *me, vfs_s_super *super)
|
||||
|
||||
{
|
||||
char answer[2048];
|
||||
print_vfs_message( "fish: Waiting for initial line..." );
|
||||
print_vfs_message( _("fish: Waiting for initial line...") );
|
||||
if (!vfs_s_get_line(me, SUP.sockr, answer, sizeof(answer), ':'))
|
||||
ERRNOR (E_PROTO, -1);
|
||||
print_vfs_message( answer );
|
||||
@ -235,23 +235,23 @@ open_archive_int (vfs *me, vfs_s_super *super)
|
||||
SUP.password = g_strdup (op);
|
||||
wipe_password(op);
|
||||
}
|
||||
print_vfs_message( "fish: Sending password..." );
|
||||
print_vfs_message( _("fish: Sending password...") );
|
||||
write(SUP.sockw, SUP.password, strlen(SUP.password));
|
||||
write(SUP.sockw, "\n", 1);
|
||||
}
|
||||
}
|
||||
|
||||
print_vfs_message( "FISH: Sending initial line..." );
|
||||
print_vfs_message( _("fish: Sending initial line...") );
|
||||
if (command (me, super, WAIT_REPLY, "#FISH\necho; start_fish_server; echo '### 200'\n") != COMPLETE)
|
||||
ERRNOR (E_PROTO, -1);
|
||||
|
||||
print_vfs_message( "FISH: Handshaking version..." );
|
||||
print_vfs_message( _("fish: Handshaking version...") );
|
||||
if (command (me, super, WAIT_REPLY, "#VER 0.0.0\necho '### 000'\n") != COMPLETE)
|
||||
ERRNOR (E_PROTO, -1);
|
||||
|
||||
print_vfs_message( "FISH: Setting up current directory..." );
|
||||
print_vfs_message( _("fish: Setting up current directory...") );
|
||||
SUP.home = fish_getcwd (me, super);
|
||||
print_vfs_message( "FISH: Connected, home %s.", SUP.home );
|
||||
print_vfs_message( _("fish: Connected, home %s."), SUP.home );
|
||||
#if 0
|
||||
super->name = g_strconcat ( "/#sh:", SUP.user, "@", SUP.host, "/", NULL );
|
||||
#endif
|
||||
@ -328,7 +328,7 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
|
||||
|
||||
logfile = MEDATA->logfile;
|
||||
|
||||
print_vfs_message("fish: Reading directory %s...", remote_path);
|
||||
print_vfs_message(_("fish: Reading directory %s..."), remote_path);
|
||||
|
||||
gettimeofday(&dir->u.fish.timestamp, NULL);
|
||||
dir->u.fish.timestamp.tv_sec += 10; /* was 360: 10 is good for
|
||||
@ -423,11 +423,11 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
|
||||
if (decode_reply(buffer+4, 0) != COMPLETE)
|
||||
goto error;
|
||||
|
||||
print_vfs_message("fish: got listing");
|
||||
print_vfs_message(_("fish: got listing"));
|
||||
return 0;
|
||||
|
||||
error:
|
||||
print_vfs_message("fish: failed");
|
||||
print_vfs_message(_("fish: failed"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -447,7 +447,7 @@ file_store(vfs *me, vfs_s_super *super, char *name, char *localname)
|
||||
|
||||
/* Use this as stor: ( dd block ; dd smallblock ) | ( cat > file; cat > /dev/null ) */
|
||||
|
||||
print_vfs_message("FISH: store %s: sending command...", name );
|
||||
print_vfs_message(_("fish: store %s: sending command..."), name );
|
||||
if (command (me, super, WAIT_REPLY,
|
||||
"#STOR %d /%s\n> /%s; echo '### 001'; ( dd bs=4096 count=%d; dd bs=%d count=1 ) 2>/dev/null | ( cat > /%s; cat > /dev/null ); echo '### 200'\n",
|
||||
s.st_size, name, name,
|
||||
@ -461,7 +461,7 @@ file_store(vfs *me, vfs_s_super *super, char *name, char *localname)
|
||||
while ((n = read(h, buffer, sizeof(buffer))) < 0) {
|
||||
if ((errno == EINTR) && got_interrupt)
|
||||
continue;
|
||||
print_vfs_message("FISH: Local read failed, sending zeros" );
|
||||
print_vfs_message(_("fish: Local read failed, sending zeros") );
|
||||
close(h);
|
||||
h = open( "/dev/zero", O_RDONLY );
|
||||
}
|
||||
@ -473,7 +473,7 @@ file_store(vfs *me, vfs_s_super *super, char *name, char *localname)
|
||||
}
|
||||
disable_interrupt_key();
|
||||
total += n;
|
||||
print_vfs_message("fish: storing %s %d (%d)",
|
||||
print_vfs_message(_("fish: storing %s %d (%d)"),
|
||||
was_error ? "zeros" : "file", total, s.st_size);
|
||||
}
|
||||
if ((get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) || was_error)
|
||||
@ -513,7 +513,7 @@ linear_abort (vfs *me, vfs_s_fh *fh)
|
||||
char buffer[8192];
|
||||
int n;
|
||||
|
||||
print_vfs_message( "Aborting transfer..." );
|
||||
print_vfs_message( _("Aborting transfer...") );
|
||||
do {
|
||||
n = MIN(8192, fh->u.fish.total - fh->u.fish.got);
|
||||
if (n)
|
||||
@ -522,9 +522,9 @@ linear_abort (vfs *me, vfs_s_fh *fh)
|
||||
} while (n);
|
||||
|
||||
if (get_reply (me, SUP.sockr, NULL, 0) != COMPLETE)
|
||||
print_vfs_message( "Error reported after abort." );
|
||||
print_vfs_message( _("Error reported after abort.") );
|
||||
else
|
||||
print_vfs_message( "Aborted transfer would be successfull." );
|
||||
print_vfs_message( _("Aborted transfer would be successfull.") );
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -512,7 +512,7 @@ static int s_read (void *data, char *buffer, int count)
|
||||
|
||||
fp = data;
|
||||
if (fp->fe->linear_state == LS_LINEAR_CLOSED) {
|
||||
print_vfs_message ("Starting linear transfer...");
|
||||
print_vfs_message (_("Starting linear transfer..."));
|
||||
if (!linear_start (fp->fe, 0))
|
||||
return -1;
|
||||
}
|
||||
@ -740,7 +740,7 @@ static int s_lseek (void *data, off_t offset, int whence)
|
||||
if (fp->fe->linear_state == LS_LINEAR_OPEN)
|
||||
vfs_die ("You promissed not to seek!");
|
||||
if (fp->fe->linear_state == LS_LINEAR_CLOSED) {
|
||||
print_vfs_message ("Preparing reget...");
|
||||
print_vfs_message (_("Preparing reget..."));
|
||||
if (whence != SEEK_SET)
|
||||
vfs_die ("You may not do such seek on linear file");
|
||||
if (!linear_start (fp->fe, offset))
|
||||
|
11
vfs/vfs.c
11
vfs/vfs.c
@ -1786,11 +1786,18 @@ vfs_die (char *m)
|
||||
void
|
||||
vfs_print_stats (char *fs_name, char *action, char *file_name, int have, int need)
|
||||
{
|
||||
static char *i18n_percent_transf_format = NULL, *i18n_transf_format = NULL;
|
||||
|
||||
if (i18n_percent_transf_format == NULL) {
|
||||
i18n_percent_transf_format = _("%s: %s: %s %3d%% (%ld bytes transfered)");
|
||||
i18n_transf_format = _("%s: %s: %s %ld bytes transfered");
|
||||
}
|
||||
|
||||
if (need)
|
||||
print_vfs_message ("%s: %s: %s %3d%% (%ld bytes transfered)",
|
||||
print_vfs_message (i18n_percent_transf_format,
|
||||
fs_name, action, file_name, have*100/need, have);
|
||||
else
|
||||
print_vfs_message ("%s: %s: %s %ld bytes transfered",
|
||||
print_vfs_message (i18n_transf_format,
|
||||
fs_name, action, file_name, have);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user