Localise browser "Index of" text

svn path=/trunk/netsurf/; revision=10645
This commit is contained in:
Chris Young 2010-07-15 22:19:01 +00:00
parent 18ffa91361
commit 8940cc18b1
6 changed files with 25 additions and 4 deletions

View File

@ -653,6 +653,7 @@ EncodingUnk:Unbekannt
# Directory browser
#
FileIndex:Index of %s
FileParent:^ Up to parent directory
FileDirectory:Directory
FileName:Name

View File

@ -657,6 +657,7 @@ EncodingUnk:Unknown
# Directory browser
#
FileIndex:Index of %s
FileParent:^ Up to parent directory
FileDirectory:Directory
FileName:Name

View File

@ -653,6 +653,7 @@ EncodingUnk:Inconnu
# Directory browser
#
FileIndex:Index of %s
FileParent:^ Up to parent directory
FileDirectory:Directory
FileName:Name

View File

@ -658,6 +658,7 @@ EncodingUnk:Sconosciuto
# Directory browser
#
FileIndex:Index of %s
FileParent:^ Up to parent directory
FileDirectory:Directory
FileName:Name

View File

@ -653,6 +653,7 @@ EncodingUnk:Unknown
# Directory browser
#
FileIndex:Index of %s
FileParent:^ Up to parent directory
FileDirectory:Directory
FileName:Name

View File

@ -176,13 +176,29 @@ bool dirlist_generate_hide_columns(int flags, char *buffer, int buffer_length)
bool dirlist_generate_title(char *title, char *buffer, int buffer_length)
{
int error = snprintf(buffer, buffer_length,
int error = 0;
int index_title_length = strlen(title) +
strlen(messages_get("FileIndex"));
char *index_title = malloc(index_title_length);
if(index_title == NULL)
/* Title buffer allocation error */
return false;
error = snprintf(index_title, index_title_length,
messages_get("FileIndex"),
title);
if (error < 0 || error >= index_title_length)
/* Error or buffer too small */
return false;
error = snprintf(buffer, buffer_length,
"</style>\n"
"<title>Index of %s</title>\n"
"<title>%s</title>\n"
"</head>\n"
"<body>\n"
"<h1>Index of %s</h1>\n",
title, title);
"<h1>%s</h1>\n",
index_title, index_title);
if (error < 0 || error >= buffer_length)
/* Error or buffer too small */
return false;