Commit c43e6520 authored by Felix Paul Kühne's avatar Felix Paul Kühne

http connection: add JS query for l10n strings

parent ee262cdf
......@@ -261,7 +261,7 @@
"WEBINTF_TITLE_ATV"="Remote Playback";
"WEBINTF_DROPFILES_LONG_ATV"="Drop files in the window to play them on your %@.<br>Or click on the \"+\" button to use the file picker dialog.";
"WEBINTF_URL_SENT"="URL sent successfully.";
"WEBINTF_URL_EMPTY"="'URL cannot be empty.";
"WEBINTF_URL_EMPTY"="URL cannot be empty.";
"WEBINTF_URL_INVALID"="Not a valid URL.";
"CLOUD_DRIVES"="Other Cloud Drives";
......
......@@ -469,6 +469,34 @@
return [[HTTPDataResponse alloc] initWithData:returnData];
}
- (NSObject <HTTPResponse> *)_HTTPGETwebResources
{
/* JS response
{
"WEBINTF_URL_SENT" : "URL sent successfully.",
"WEBINTF_URL_EMPTY" :"'URL cannot be empty.",
"WEBINTF_URL_INVALID" : "Not a valid URL."
}
*/
NSString *returnString = [NSString stringWithFormat:
@"var LOCALES = {\n" \
"PLAYER_CONTROL: {\n" \
"URL: {\n" \
"EMPTY: \"%@\",\n" \
"NOT_VALID: \"%@\",\n" \
"SENT_SUCCESSFULLY: \"%@\"\n" \
"}\n" \
"}\n" \
"}",
NSLocalizedString(@"WEBINTF_URL_EMPTY", nil),
NSLocalizedString(@"WEBINTF_URL_INVALID", nil),
NSLocalizedString(@"WEBINTF_URL_SENT", nil)];
NSData *returnData = [returnString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
return [[HTTPDataResponse alloc] initWithData:returnData];
}
- (NSObject <HTTPResponse> *)_HTTPGETPlaylist
{
/* JSON response:
......@@ -538,6 +566,9 @@
if ([path hasPrefix:@"/playlist"]) {
return [self _HTTPGETPlaylist];
}
if ([path hasPrefix:@"/web_resources.js"]) {
return [self _HTTPGETwebResources];
}
#endif
NSString *filePath = [self filePathForURI: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