Commit 54d03c5a authored by Felix Paul Kühne's avatar Felix Paul Kühne

web intf: localize page title

parent 9ebbc97c
......@@ -61,7 +61,7 @@ div.main.drop {
}
.nav:before {
content: "WiFi Upload";
content: "%%HTTP_UPLOAD%%";
font-family: "Raleway", "Helvetica Neue";
font-size: 36px;
line-height: 60px;
......
......@@ -104,8 +104,7 @@
NSString *documentRoot = [config documentRoot];
NSString *relativePath = [filePath substringFromIndex:[documentRoot length]];
if ([relativePath isEqualToString:@"/index.html"])
{
if ([relativePath isEqualToString:@"/index.html"]) {
NSArray *allFiles = [MLFile allFiles];
NSString *fileList = @"";
for (MLFile *file in allFiles) {
......@@ -113,17 +112,24 @@
fileList = [fileList stringByAppendingString:fileHTML];
}
NSMutableDictionary *replacementDict = [NSMutableDictionary new];
[replacementDict setObject:fileList forKey:@"FILES"];
[replacementDict setObject:NSLocalizedString(@"WEBINTF_DROPFILES", nil) forKey:@"WEBINTF_DROPFILES"];
[replacementDict setObject:NSLocalizedString(@"WEBINTF_DROPFILES_LONG", nil) forKey:@"WEBINTF_DROPFILES_LONG"];
[replacementDict setObject:NSLocalizedString(@"WEBINTF_DOWNLOADFILES", nil) forKey:@"WEBINTF_DOWNLOADFILES"];
[replacementDict setObject:NSLocalizedString(@"WEBINTF_DOWNLOADFILES_LONG", nil) forKey:@"WEBINTF_DOWNLOADFILES_LONG"];
NSDictionary *replacementDict = @{@"FILES" : fileList,
@"WEBINTF_DROPFILES" : NSLocalizedString(@"WEBINTF_DROPFILES", nil),
@"WEBINTF_DROPFILES_LONG" : NSLocalizedString(@"WEBINTF_DROPFILES_LONG", nil),
@"WEBINTF_DOWNLOADFILES" : NSLocalizedString(@"WEBINTF_DOWNLOADFILES", nil),
@"WEBINTF_DOWNLOADFILES_LONG" : NSLocalizedString(@"WEBINTF_DOWNLOADFILES_LONG", nil)};
return [[HTTPDynamicFileResponse alloc] initWithFilePath:[self filePathForURI:path]
forConnection:self
separator:@"%%"
replacementDictionary:replacementDict];
} else if ([relativePath isEqualToString:@"/style.css"]) {
NSDictionary *replacementDict = @{@"HTTP_UPLOAD" : NSLocalizedString(@"HTTP_UPLOAD", nil)};
return [[HTTPDynamicFileResponse alloc] initWithFilePath:[self filePathForURI:path]
forConnection:self
separator:@"%%"
replacementDictionary:replacementDict];
}
return [super httpResponseForMethod:method URI:path];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment